diff --git a/applyPatches.sh b/applyPatches.sh
index 1fb7e40fb..1c0424686 100755
--- a/applyPatches.sh
+++ b/applyPatches.sh
@@ -1,5 +1,7 @@
#!/bin/bash
+set -euo pipefail
+
if [ -z "$1" ]
then
echo "Please run this script again with the clean decompile sources as an argument. In most cases this will be ../work/decompile-XXXX"
@@ -18,19 +20,19 @@ else
}
fi
-nms=$1/net/minecraft/server
-cb=src/main/java/net/minecraft/server
+nms=$1
+cb=src/main/java
#clean up and rebuild
-rm -rf $cb
-mkdir -p $cb
-for file in $(/bin/ls nms-patches)
+rm -rf $cb/net
+for file in $(find nms-patches -type f -printf '%P\n')
do
- patchFile="nms-patches/$file"
+ patchFile="$file"
file="$(echo $file | cut -d. -f1).java"
echo "Patching $file < $patchFile"
strip_cr "$nms/$file" > /dev/null
+ mkdir -p $(dirname $cb/$file)
cp "$nms/$file" "$cb/$file"
- patch -d src/main/java/ "net/minecraft/server/$file" < "$patchFile"
+ patch -d src/main/java -p 1 < "nms-patches/$patchFile"
done
diff --git a/checkstyle.xml b/checkstyle.xml
index 63a6f624f..63914723e 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -58,7 +58,7 @@
-
+
diff --git a/makePatches.sh b/makePatches.sh
index bb711353b..3760fa10c 100755
--- a/makePatches.sh
+++ b/makePatches.sh
@@ -1,5 +1,7 @@
#!/bin/bash
+set -euo pipefail
+
if [ -z "$1" ]
then
echo "Please run this script again with the clean decompile sources as an argument. In most cases this will be ../work/decompile-XXXX"
@@ -18,8 +20,8 @@ else
}
fi
-cb=src/main/java/net/minecraft/server
-nms="$1/net/minecraft/server"
+cb=src/main/java
+nms="$1"
show_diff_msg=true
if [ $# -ge 2 ]
@@ -31,7 +33,7 @@ then
fi
fi
-for file in $(/bin/ls $cb)
+for file in $(find src/main/java/net -type f -printf 'net/%P\n')
do
if [ "$show_diff_msg" = true ]
then
@@ -40,7 +42,7 @@ do
strip_cr "$nms/$file" > /dev/null
strip_cr "$cb/$file" > /dev/null
outName=$(echo nms-patches/"$(echo $file | cut -d. -f1)".patch)
- patchNew=$(diff -u --label a/net/minecraft/server/$file "$nms/$file" --label b/net/minecraft/server/$file "$cb/$file")
+ patchNew=$(diff -u --label a/$file "$nms/$file" --label b/$file "$cb/$file" || true)
if [ -f "$outName" ]
then
patchCut=$(echo "$patchNew" | tail -n +3)
@@ -51,6 +53,7 @@ do
fi
else
echo "New patch $outName"
+ mkdir -p $(dirname $outName)
echo "$patchNew" > "$outName"
fi
done
\ No newline at end of file
diff --git a/nms-patches/net/minecraft/CrashReport.patch b/nms-patches/net/minecraft/CrashReport.patch
index 8ec21a5f9..ba2b8b921 100644
--- a/nms-patches/net/minecraft/CrashReport.patch
+++ b/nms-patches/net/minecraft/CrashReport.patch
@@ -1,5 +1,5 @@
---- a/net/minecraft/server/CrashReport.java
-+++ b/net/minecraft/server/CrashReport.java
+--- a/net/minecraft/CrashReport.java
++++ b/net/minecraft/CrashReport.java
@@ -68,6 +68,7 @@
return String.format("%d total; %s", list.size(), list.stream().collect(Collectors.joining(" ")));
diff --git a/nms-patches/net/minecraft/advancements/Advancement.patch b/nms-patches/net/minecraft/advancements/Advancement.patch
index 57f6fdfdf..9cdb7960f 100644
--- a/nms-patches/net/minecraft/advancements/Advancement.patch
+++ b/nms-patches/net/minecraft/advancements/Advancement.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/Advancement.java
-+++ b/net/minecraft/server/Advancement.java
-@@ -26,6 +26,7 @@
+--- a/net/minecraft/advancements/Advancement.java
++++ b/net/minecraft/advancements/Advancement.java
+@@ -39,6 +39,7 @@
private final String[][] requirements;
private final Set children = Sets.newLinkedHashSet();
private final IChatBaseComponent chatComponent;
@@ -8,7 +8,7 @@
public Advancement(MinecraftKey minecraftkey, @Nullable Advancement advancement, @Nullable AdvancementDisplay advancementdisplay, AdvancementRewards advancementrewards, Map map, String[][] astring) {
this.key = minecraftkey;
-@@ -209,7 +210,7 @@
+@@ -222,7 +223,7 @@
}
public Advancement b(MinecraftKey minecraftkey) {
diff --git a/nms-patches/net/minecraft/advancements/Advancements.patch b/nms-patches/net/minecraft/advancements/Advancements.patch
index 53620f873..74e1b52fa 100644
--- a/nms-patches/net/minecraft/advancements/Advancements.patch
+++ b/nms-patches/net/minecraft/advancements/Advancements.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/Advancements.java
-+++ b/net/minecraft/server/Advancements.java
-@@ -72,7 +72,7 @@
+--- a/net/minecraft/advancements/Advancements.java
++++ b/net/minecraft/advancements/Advancements.java
+@@ -73,7 +73,7 @@
}
}
diff --git a/nms-patches/net/minecraft/commands/CommandDispatcher.patch b/nms-patches/net/minecraft/commands/CommandDispatcher.patch
index 1dae2226a..ae67fca8a 100644
--- a/nms-patches/net/minecraft/commands/CommandDispatcher.patch
+++ b/nms-patches/net/minecraft/commands/CommandDispatcher.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/CommandDispatcher.java
-+++ b/net/minecraft/server/CommandDispatcher.java
-@@ -19,12 +19,21 @@
+--- a/net/minecraft/commands/CommandDispatcher.java
++++ b/net/minecraft/commands/CommandDispatcher.java
+@@ -102,12 +102,21 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -22,7 +22,7 @@
CommandAdvancement.a(this.b);
CommandAttribute.a(this.b);
CommandExecute.a(this.b);
-@@ -105,14 +114,57 @@
+@@ -188,14 +197,57 @@
}
this.b.findAmbiguities((commandnode, commandnode1, commandnode2, collection) -> {
@@ -83,7 +83,7 @@
StringReader stringreader = new StringReader(s);
if (stringreader.canRead() && stringreader.peek() == '/') {
-@@ -139,7 +191,7 @@
+@@ -222,7 +274,7 @@
if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor());
IChatMutableComponent ichatmutablecomponent = (new ChatComponentText("")).a(EnumChatFormat.GRAY).format((chatmodifier) -> {
@@ -92,7 +92,7 @@
});
if (j > 10) {
-@@ -189,11 +241,36 @@
+@@ -272,11 +324,36 @@
}
public void a(EntityPlayer entityplayer) {
@@ -130,7 +130,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutCommands(rootcommandnode));
}
-@@ -204,7 +281,7 @@
+@@ -287,7 +364,7 @@
CommandNode commandnode2 = (CommandNode) iterator.next();
if (commandnode2.canUse(commandlistenerwrapper)) {
@@ -139,7 +139,7 @@
argumentbuilder.requires((icompletionprovider) -> {
return true;
-@@ -227,7 +304,7 @@
+@@ -310,7 +387,7 @@
argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect()));
}
diff --git a/nms-patches/net/minecraft/commands/CommandListenerWrapper.patch b/nms-patches/net/minecraft/commands/CommandListenerWrapper.patch
index aae57b973..f7ead9df2 100644
--- a/nms-patches/net/minecraft/commands/CommandListenerWrapper.patch
+++ b/nms-patches/net/minecraft/commands/CommandListenerWrapper.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/CommandListenerWrapper.java
-+++ b/net/minecraft/server/CommandListenerWrapper.java
-@@ -15,6 +15,8 @@
- import java.util.stream.Stream;
- import javax.annotation.Nullable;
+--- a/net/minecraft/commands/CommandListenerWrapper.java
++++ b/net/minecraft/commands/CommandListenerWrapper.java
+@@ -36,6 +36,8 @@
+ import net.minecraft.world.phys.Vec2F;
+ import net.minecraft.world.phys.Vec3D;
+import com.mojang.brigadier.tree.CommandNode; // CraftBukkit
+
public class CommandListenerWrapper implements ICompletionProvider {
public static final SimpleCommandExceptionType a = new SimpleCommandExceptionType(new ChatMessage("permissions.requires.player"));
-@@ -32,6 +34,7 @@
+@@ -53,6 +55,7 @@
private final ResultConsumer l;
private final ArgumentAnchor.Anchor m;
private final Vec2F n;
@@ -17,7 +17,7 @@
public CommandListenerWrapper(ICommandListener icommandlistener, Vec3D vec3d, Vec2F vec2f, WorldServer worldserver, int i, String s, IChatBaseComponent ichatbasecomponent, MinecraftServer minecraftserver, @Nullable Entity entity) {
this(icommandlistener, vec3d, vec2f, worldserver, i, s, ichatbasecomponent, minecraftserver, entity, false, (commandcontext, flag, j) -> {
-@@ -128,9 +131,23 @@
+@@ -149,9 +152,23 @@
@Override
public boolean hasPermission(int i) {
@@ -41,7 +41,7 @@
public Vec3D getPosition() {
return this.d;
}
-@@ -192,7 +209,7 @@
+@@ -213,7 +230,7 @@
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
@@ -50,7 +50,7 @@
entityplayer.sendMessage(ichatmutablecomponent, SystemUtils.b);
}
}
-@@ -252,4 +269,10 @@
+@@ -273,4 +290,10 @@
public IRegistryCustom q() {
return this.i.getCustomRegistry();
}
diff --git a/nms-patches/net/minecraft/commands/ICommandListener.patch b/nms-patches/net/minecraft/commands/ICommandListener.patch
index d28dc9f20..f5c90c937 100644
--- a/nms-patches/net/minecraft/commands/ICommandListener.patch
+++ b/nms-patches/net/minecraft/commands/ICommandListener.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ICommandListener.java
-+++ b/net/minecraft/server/ICommandListener.java
-@@ -22,6 +22,13 @@
+--- a/net/minecraft/commands/ICommandListener.java
++++ b/net/minecraft/commands/ICommandListener.java
+@@ -23,6 +23,13 @@
public boolean shouldBroadcastCommands() {
return false;
}
@@ -14,7 +14,7 @@
};
void sendMessage(IChatBaseComponent ichatbasecomponent, UUID uuid);
-@@ -31,4 +38,6 @@
+@@ -32,4 +39,6 @@
boolean shouldSendFailure();
boolean shouldBroadcastCommands();
diff --git a/nms-patches/net/minecraft/commands/arguments/ArgumentEntity.patch b/nms-patches/net/minecraft/commands/arguments/ArgumentEntity.patch
index 4609ed35a..4e1b63cb8 100644
--- a/nms-patches/net/minecraft/commands/arguments/ArgumentEntity.patch
+++ b/nms-patches/net/minecraft/commands/arguments/ArgumentEntity.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ArgumentEntity.java
-+++ b/net/minecraft/server/ArgumentEntity.java
-@@ -84,9 +84,15 @@
+--- a/net/minecraft/commands/arguments/ArgumentEntity.java
++++ b/net/minecraft/commands/arguments/ArgumentEntity.java
+@@ -93,9 +93,15 @@
}
public EntitySelector parse(StringReader stringreader) throws CommandSyntaxException {
diff --git a/nms-patches/net/minecraft/commands/arguments/blocks/ArgumentBlock.patch b/nms-patches/net/minecraft/commands/arguments/blocks/ArgumentBlock.patch
index 8160fc9f9..2674169a9 100644
--- a/nms-patches/net/minecraft/commands/arguments/blocks/ArgumentBlock.patch
+++ b/nms-patches/net/minecraft/commands/arguments/blocks/ArgumentBlock.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ArgumentBlock.java
-+++ b/net/minecraft/server/ArgumentBlock.java
-@@ -43,7 +43,7 @@
+--- a/net/minecraft/commands/arguments/blocks/ArgumentBlock.java
++++ b/net/minecraft/commands/arguments/blocks/ArgumentBlock.java
+@@ -55,7 +55,7 @@
};
private final StringReader i;
private final boolean j;
@@ -9,7 +9,7 @@
private final Map l = Maps.newHashMap();
private MinecraftKey m = new MinecraftKey("");
private BlockStateList n;
-@@ -219,7 +219,7 @@
+@@ -231,7 +231,7 @@
Iterator iterator = iblockstate.getValues().iterator();
while (iterator.hasNext()) {
@@ -18,7 +18,7 @@
if (t0 instanceof Integer) {
suggestionsbuilder.suggest((Integer) t0);
-@@ -488,7 +488,7 @@
+@@ -500,7 +500,7 @@
Optional optional = iblockstate.b(s);
if (optional.isPresent()) {
@@ -27,7 +27,7 @@
this.k.put(iblockstate, optional.get());
} else {
this.i.setCursor(i);
-@@ -522,7 +522,7 @@
+@@ -534,7 +534,7 @@
private static > void a(StringBuilder stringbuilder, IBlockState iblockstate, Comparable> comparable) {
stringbuilder.append(iblockstate.getName());
stringbuilder.append('=');
diff --git a/nms-patches/net/minecraft/commands/arguments/selector/ArgumentParserSelector.patch b/nms-patches/net/minecraft/commands/arguments/selector/ArgumentParserSelector.patch
index 91abf6dc5..a89f264fc 100644
--- a/nms-patches/net/minecraft/commands/arguments/selector/ArgumentParserSelector.patch
+++ b/nms-patches/net/minecraft/commands/arguments/selector/ArgumentParserSelector.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ArgumentParserSelector.java
-+++ b/net/minecraft/server/ArgumentParserSelector.java
-@@ -127,7 +127,7 @@
+--- a/net/minecraft/commands/arguments/selector/ArgumentParserSelector.java
++++ b/net/minecraft/commands/arguments/selector/ArgumentParserSelector.java
+@@ -137,7 +137,7 @@
axisalignedbb = this.a(this.v == null ? 0.0D : this.v, this.w == null ? 0.0D : this.w, this.x == null ? 0.0D : this.x);
}
@@ -9,7 +9,7 @@
if (this.s == null && this.t == null && this.u == null) {
function = (vec3d) -> {
-@@ -188,8 +188,10 @@
+@@ -198,8 +198,10 @@
};
}
@@ -22,7 +22,7 @@
this.G = this::d;
if (!this.l.canRead()) {
throw ArgumentParserSelector.d.createWithContext(this.l);
-@@ -443,6 +445,12 @@
+@@ -453,6 +455,12 @@
}
public EntitySelector parse() throws CommandSyntaxException {
@@ -35,7 +35,7 @@
this.E = this.l.getCursor();
this.G = this::b;
if (this.l.canRead() && this.l.peek() == '@') {
-@@ -451,7 +459,7 @@
+@@ -461,7 +469,7 @@
}
this.l.skip();
diff --git a/nms-patches/net/minecraft/commands/arguments/selector/EntitySelector.patch b/nms-patches/net/minecraft/commands/arguments/selector/EntitySelector.patch
index 19c2c2c47..708581b9e 100644
--- a/nms-patches/net/minecraft/commands/arguments/selector/EntitySelector.patch
+++ b/nms-patches/net/minecraft/commands/arguments/selector/EntitySelector.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntitySelector.java
-+++ b/net/minecraft/server/EntitySelector.java
-@@ -64,7 +64,7 @@
+--- a/net/minecraft/commands/arguments/selector/EntitySelector.java
++++ b/net/minecraft/commands/arguments/selector/EntitySelector.java
+@@ -75,7 +75,7 @@
}
private void e(CommandListenerWrapper commandlistenerwrapper) throws CommandSyntaxException {
diff --git a/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorBoat.patch b/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorBoat.patch
index 57296f220..ee8d1e2e0 100644
--- a/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorBoat.patch
+++ b/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorBoat.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/DispenseBehaviorBoat.java
-+++ b/net/minecraft/server/DispenseBehaviorBoat.java
-@@ -1,5 +1,10 @@
- package net.minecraft.server;
+--- a/net/minecraft/core/dispenser/DispenseBehaviorBoat.java
++++ b/net/minecraft/core/dispenser/DispenseBehaviorBoat.java
+@@ -10,6 +10,11 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.level.block.BlockDispenser;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
@@ -11,7 +12,7 @@
public class DispenseBehaviorBoat extends DispenseBehaviorItem {
private final DispenseBehaviorItem b = new DispenseBehaviorItem();
-@@ -29,12 +34,40 @@
+@@ -39,12 +44,40 @@
d3 = 0.0D;
}
diff --git a/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorItem.patch b/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorItem.patch
index cca2373de..decde82fa 100644
--- a/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorItem.patch
+++ b/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorItem.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/DispenseBehaviorItem.java
-+++ b/net/minecraft/server/DispenseBehaviorItem.java
-@@ -1,5 +1,11 @@
- package net.minecraft.server;
+--- a/net/minecraft/core/dispenser/DispenseBehaviorItem.java
++++ b/net/minecraft/core/dispenser/DispenseBehaviorItem.java
+@@ -8,6 +8,12 @@
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.level.block.BlockDispenser;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
@@ -12,7 +13,7 @@
public class DispenseBehaviorItem implements IDispenseBehavior {
public DispenseBehaviorItem() {}
-@@ -18,11 +24,19 @@
+@@ -26,11 +32,19 @@
IPosition iposition = BlockDispenser.a(isourceblock);
ItemStack itemstack1 = itemstack.cloneAndSubtract(1);
@@ -34,7 +35,7 @@
double d0 = iposition.getX();
double d1 = iposition.getY();
double d2 = iposition.getZ();
-@@ -37,7 +51,39 @@
+@@ -45,7 +59,39 @@
double d3 = world.random.nextDouble() * 0.1D + 0.2D;
entityitem.setMot(world.random.nextGaussian() * 0.007499999832361937D * (double) i + (double) enumdirection.getAdjacentX() * d3, world.random.nextGaussian() * 0.007499999832361937D * (double) i + 0.20000000298023224D, world.random.nextGaussian() * 0.007499999832361937D * (double) i + (double) enumdirection.getAdjacentZ() * d3);
diff --git a/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorProjectile.patch b/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorProjectile.patch
index bfcd57ec9..6fb0b8475 100644
--- a/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorProjectile.patch
+++ b/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorProjectile.patch
@@ -1,9 +1,12 @@
---- a/net/minecraft/server/DispenseBehaviorProjectile.java
-+++ b/net/minecraft/server/DispenseBehaviorProjectile.java
-@@ -1,5 +1,10 @@
- package net.minecraft.server;
+--- a/net/minecraft/core/dispenser/DispenseBehaviorProjectile.java
++++ b/net/minecraft/core/dispenser/DispenseBehaviorProjectile.java
+@@ -9,6 +9,13 @@
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.level.block.BlockDispenser;
+// CraftBukkit start
++import net.minecraft.world.entity.Entity;
++import net.minecraft.world.level.block.entity.TileEntityDispenser;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.event.block.BlockDispenseEvent;
+// CraftBukkit end
@@ -11,7 +14,7 @@
public abstract class DispenseBehaviorProjectile extends DispenseBehaviorItem {
public DispenseBehaviorProjectile() {}
-@@ -11,9 +16,38 @@
+@@ -20,9 +27,38 @@
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING);
IProjectile iprojectile = this.a((World) worldserver, iposition, itemstack);
diff --git a/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShears.patch b/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShears.patch
index 4915ea060..4e0155872 100644
--- a/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShears.patch
+++ b/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShears.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/DispenseBehaviorShears.java
-+++ b/net/minecraft/server/DispenseBehaviorShears.java
-@@ -3,6 +3,12 @@
- import java.util.Iterator;
- import java.util.List;
+--- a/net/minecraft/core/dispenser/DispenseBehaviorShears.java
++++ b/net/minecraft/core/dispenser/DispenseBehaviorShears.java
+@@ -23,6 +23,12 @@
+ import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.phys.AxisAlignedBB;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -13,7 +13,7 @@
public class DispenseBehaviorShears extends DispenseBehaviorMaybe {
public DispenseBehaviorShears() {}
-@@ -10,11 +16,34 @@
+@@ -30,11 +36,34 @@
@Override
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
WorldServer worldserver = isourceblock.getWorld();
@@ -49,7 +49,7 @@
if (this.a() && itemstack.isDamaged(1, worldserver.getRandom(), (EntityPlayer) null)) {
itemstack.setCount(0);
}
-@@ -40,7 +69,7 @@
+@@ -60,7 +89,7 @@
return false;
}
@@ -58,7 +58,7 @@
List list = worldserver.a(EntityLiving.class, new AxisAlignedBB(blockposition), IEntitySelector.g);
Iterator iterator = list.iterator();
-@@ -51,6 +80,11 @@
+@@ -71,6 +100,11 @@
IShearable ishearable = (IShearable) entityliving;
if (ishearable.canShear()) {
diff --git a/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.patch b/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.patch
index ea7d1be96..0ed0860b2 100644
--- a/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.patch
+++ b/nms-patches/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/DispenseBehaviorShulkerBox.java
-+++ b/net/minecraft/server/DispenseBehaviorShulkerBox.java
-@@ -1,5 +1,10 @@
- package net.minecraft.server;
+--- a/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.java
++++ b/net/minecraft/core/dispenser/DispenseBehaviorShulkerBox.java
+@@ -10,6 +10,11 @@
+ import net.minecraft.world.item.context.BlockActionContextDirectional;
+ import net.minecraft.world.level.block.BlockDispenser;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
@@ -11,7 +12,7 @@
public class DispenseBehaviorShulkerBox extends DispenseBehaviorMaybe {
public DispenseBehaviorShulkerBox() {}
-@@ -14,6 +19,30 @@
+@@ -24,6 +29,30 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
EnumDirection enumdirection1 = isourceblock.getWorld().isEmpty(blockposition.down()) ? enumdirection : EnumDirection.UP;
diff --git a/nms-patches/net/minecraft/core/dispenser/IDispenseBehavior.patch b/nms-patches/net/minecraft/core/dispenser/IDispenseBehavior.patch
index 5de9d4309..f84e995e0 100644
--- a/nms-patches/net/minecraft/core/dispenser/IDispenseBehavior.patch
+++ b/nms-patches/net/minecraft/core/dispenser/IDispenseBehavior.patch
@@ -1,10 +1,13 @@
---- a/net/minecraft/server/IDispenseBehavior.java
-+++ b/net/minecraft/server/IDispenseBehavior.java
-@@ -4,6 +4,15 @@
- import java.util.List;
- import java.util.Random;
+--- a/net/minecraft/core/dispenser/IDispenseBehavior.java
++++ b/net/minecraft/core/dispenser/IDispenseBehavior.java
+@@ -74,6 +74,18 @@
+ import net.minecraft.world.phys.AxisAlignedBB;
+ import net.minecraft.world.phys.MovingObjectPositionBlock;
+// CraftBukkit start
++import net.minecraft.world.level.block.BlockSapling;
++import net.minecraft.world.level.block.IFluidContainer;
++import net.minecraft.world.level.material.Material;
+import org.bukkit.Location;
+import org.bukkit.TreeType;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
@@ -16,7 +19,7 @@
public interface IDispenseBehavior {
IDispenseBehavior NONE = (isourceblock, itemstack) -> {
-@@ -44,7 +53,7 @@
+@@ -114,7 +126,7 @@
BlockDispenser.a((IMaterial) Items.EGG, (IDispenseBehavior) (new DispenseBehaviorProjectile() {
@Override
protected IProjectile a(World world, IPosition iposition, ItemStack itemstack) {
@@ -25,7 +28,7 @@
entityegg.setItem(itemstack);
});
}
-@@ -52,7 +61,7 @@
+@@ -122,7 +134,7 @@
BlockDispenser.a((IMaterial) Items.SNOWBALL, (IDispenseBehavior) (new DispenseBehaviorProjectile() {
@Override
protected IProjectile a(World world, IPosition iposition, ItemStack itemstack) {
@@ -34,7 +37,7 @@
entitysnowball.setItem(itemstack);
});
}
-@@ -60,7 +69,7 @@
+@@ -130,7 +142,7 @@
BlockDispenser.a((IMaterial) Items.EXPERIENCE_BOTTLE, (IDispenseBehavior) (new DispenseBehaviorProjectile() {
@Override
protected IProjectile a(World world, IPosition iposition, ItemStack itemstack) {
@@ -43,7 +46,7 @@
entitythrownexpbottle.setItem(itemstack);
});
}
-@@ -81,7 +90,7 @@
+@@ -151,7 +163,7 @@
return (new DispenseBehaviorProjectile() {
@Override
protected IProjectile a(World world, IPosition iposition, ItemStack itemstack1) {
@@ -52,7 +55,7 @@
entitypotion.setItem(itemstack1);
});
}
-@@ -104,7 +113,7 @@
+@@ -174,7 +186,7 @@
return (new DispenseBehaviorProjectile() {
@Override
protected IProjectile a(World world, IPosition iposition, ItemStack itemstack1) {
@@ -61,7 +64,7 @@
entitypotion.setItem(itemstack1);
});
}
-@@ -127,8 +136,36 @@
+@@ -197,8 +209,36 @@
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING);
EntityTypes> entitytypes = ((ItemMonsterEgg) itemstack.getItem()).a(itemstack.getTag());
@@ -99,7 +102,7 @@
return itemstack;
}
};
-@@ -146,12 +183,40 @@
+@@ -216,12 +256,40 @@
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING);
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
WorldServer worldserver = isourceblock.getWorld();
@@ -141,7 +144,7 @@
return itemstack;
}
}));
-@@ -252,12 +317,41 @@
+@@ -322,12 +390,41 @@
@Override
public ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING);
@@ -184,7 +187,7 @@
return itemstack;
}
-@@ -280,10 +374,39 @@
+@@ -350,10 +447,39 @@
double d4 = random.nextGaussian() * 0.05D + (double) enumdirection.getAdjacentY();
double d5 = random.nextGaussian() * 0.05D + (double) enumdirection.getAdjacentZ();
@@ -228,7 +231,7 @@
return itemstack;
}
-@@ -307,9 +430,52 @@
+@@ -377,9 +503,52 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING));
WorldServer worldserver = isourceblock.getWorld();
@@ -282,7 +285,7 @@
} else {
return this.b.dispense(isourceblock, itemstack);
}
-@@ -333,13 +499,39 @@
+@@ -403,13 +572,39 @@
Block block = iblockdata.getBlock();
if (block instanceof IFluidSource) {
@@ -323,7 +326,7 @@
itemstack.subtract(1);
if (itemstack.isEmpty()) {
return new ItemStack(item);
-@@ -361,13 +553,41 @@
+@@ -431,13 +626,41 @@
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
WorldServer worldserver = isourceblock.getWorld();
@@ -366,7 +369,7 @@
} else if (BlockCampfire.h(iblockdata)) {
worldserver.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(BlockProperties.r, true));
} else if (iblockdata.getBlock() instanceof BlockTNT) {
-@@ -390,12 +610,57 @@
+@@ -460,12 +683,57 @@
this.a(true);
WorldServer worldserver = isourceblock.getWorld();
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING));
@@ -424,7 +427,7 @@
return itemstack;
}
-@@ -405,11 +670,40 @@
+@@ -475,11 +743,40 @@
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
WorldServer worldserver = isourceblock.getWorld();
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING));
@@ -467,7 +470,7 @@
return itemstack;
}
}));
-@@ -433,6 +727,30 @@
+@@ -503,6 +800,30 @@
EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING);
BlockPosition blockposition = isourceblock.getBlockPosition().shift(enumdirection);
@@ -498,7 +501,7 @@
if (worldserver.isEmpty(blockposition) && BlockWitherSkull.b((World) worldserver, blockposition, itemstack)) {
worldserver.setTypeAndData(blockposition, (IBlockData) Blocks.WITHER_SKELETON_SKULL.getBlockData().set(BlockSkull.a, enumdirection.n() == EnumDirection.EnumAxis.Y ? 0 : enumdirection.opposite().get2DRotationValue() * 4), 3);
TileEntity tileentity = worldserver.getTileEntity(blockposition);
-@@ -457,6 +775,30 @@
+@@ -527,6 +848,30 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING));
BlockPumpkinCarved blockpumpkincarved = (BlockPumpkinCarved) Blocks.CARVED_PUMPKIN;
@@ -529,7 +532,7 @@
if (worldserver.isEmpty(blockposition) && blockpumpkincarved.a((IWorldReader) worldserver, blockposition)) {
if (!worldserver.isClientSide) {
worldserver.setTypeAndData(blockposition, blockpumpkincarved.getBlockData(), 3);
-@@ -504,6 +846,30 @@
+@@ -574,6 +919,30 @@
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING));
IBlockData iblockdata = worldserver.getType(blockposition);
diff --git a/nms-patches/net/minecraft/network/NetworkManager.patch b/nms-patches/net/minecraft/network/NetworkManager.patch
index 9f540d23c..8d747772b 100644
--- a/nms-patches/net/minecraft/network/NetworkManager.patch
+++ b/nms-patches/net/minecraft/network/NetworkManager.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/NetworkManager.java
-+++ b/net/minecraft/server/NetworkManager.java
-@@ -127,7 +127,7 @@
+--- a/net/minecraft/network/NetworkManager.java
++++ b/net/minecraft/network/NetworkManager.java
+@@ -137,7 +137,7 @@
}
private static void a(Packet packet, PacketListener packetlistener) {
@@ -9,7 +9,7 @@
}
public void setPacketListener(PacketListener packetlistener) {
-@@ -237,7 +237,7 @@
+@@ -247,7 +247,7 @@
public void close(IChatBaseComponent ichatbasecomponent) {
if (this.channel.isOpen()) {
diff --git a/nms-patches/net/minecraft/network/PacketDataSerializer.patch b/nms-patches/net/minecraft/network/PacketDataSerializer.patch
index 2cf9923c0..94c816fe8 100644
--- a/nms-patches/net/minecraft/network/PacketDataSerializer.patch
+++ b/nms-patches/net/minecraft/network/PacketDataSerializer.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/PacketDataSerializer.java
-+++ b/net/minecraft/server/PacketDataSerializer.java
-@@ -26,6 +26,8 @@
- import java.util.UUID;
- import javax.annotation.Nullable;
+--- a/net/minecraft/network/PacketDataSerializer.java
++++ b/net/minecraft/network/PacketDataSerializer.java
+@@ -39,6 +39,8 @@
+ import net.minecraft.world.phys.MovingObjectPositionBlock;
+ import net.minecraft.world.phys.Vec3D;
+import org.bukkit.craftbukkit.inventory.CraftItemStack; // CraftBukkit
+
public class PacketDataSerializer extends ByteBuf {
private final ByteBuf a;
-@@ -154,7 +156,7 @@
+@@ -167,7 +169,7 @@
}
public > T a(Class oclass) {
@@ -18,7 +18,7 @@
}
public PacketDataSerializer a(Enum> oenum) {
-@@ -231,7 +233,7 @@
+@@ -244,7 +246,7 @@
} else {
try {
NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) (new ByteBufOutputStream(this)));
@@ -27,7 +27,7 @@
throw new EncoderException(ioexception);
}
}
-@@ -268,7 +270,7 @@
+@@ -281,7 +283,7 @@
}
public PacketDataSerializer a(ItemStack itemstack) {
@@ -36,7 +36,7 @@
this.writeBoolean(false);
} else {
this.writeBoolean(true);
-@@ -297,6 +299,11 @@
+@@ -310,6 +312,11 @@
ItemStack itemstack = new ItemStack(Item.getById(i), b0);
itemstack.setTag(this.l());
diff --git a/nms-patches/net/minecraft/network/chat/ChatHexColor.patch b/nms-patches/net/minecraft/network/chat/ChatHexColor.patch
index fb88ca604..1b1fdc4ed 100644
--- a/nms-patches/net/minecraft/network/chat/ChatHexColor.patch
+++ b/nms-patches/net/minecraft/network/chat/ChatHexColor.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ChatHexColor.java
-+++ b/net/minecraft/server/ChatHexColor.java
-@@ -10,7 +10,7 @@
+--- a/net/minecraft/network/chat/ChatHexColor.java
++++ b/net/minecraft/network/chat/ChatHexColor.java
+@@ -11,7 +11,7 @@
public final class ChatHexColor {
private static final Map a = (Map) Stream.of(EnumChatFormat.values()).filter(EnumChatFormat::d).collect(ImmutableMap.toImmutableMap(Function.identity(), (enumchatformat) -> {
@@ -9,7 +9,7 @@
}));
private static final Map b = (Map) ChatHexColor.a.values().stream().collect(ImmutableMap.toImmutableMap((chathexcolor) -> {
return chathexcolor.name;
-@@ -18,16 +18,22 @@
+@@ -19,16 +19,22 @@
private final int rgb;
@Nullable
public final String name;
diff --git a/nms-patches/net/minecraft/network/chat/ChatModifier.patch b/nms-patches/net/minecraft/network/chat/ChatModifier.patch
index ad063eb02..09c2d6f88 100644
--- a/nms-patches/net/minecraft/network/chat/ChatModifier.patch
+++ b/nms-patches/net/minecraft/network/chat/ChatModifier.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ChatModifier.java
-+++ b/net/minecraft/server/ChatModifier.java
-@@ -114,6 +114,20 @@
+--- a/net/minecraft/network/chat/ChatModifier.java
++++ b/net/minecraft/network/chat/ChatModifier.java
+@@ -118,6 +118,20 @@
return new ChatModifier(this.color, this.bold, obool, this.underlined, this.strikethrough, this.obfuscated, this.clickEvent, this.hoverEvent, this.insertion, this.font);
}
diff --git a/nms-patches/net/minecraft/network/chat/IChatBaseComponent.patch b/nms-patches/net/minecraft/network/chat/IChatBaseComponent.patch
index 95b2fbcde..3f88e48f6 100644
--- a/nms-patches/net/minecraft/network/chat/IChatBaseComponent.patch
+++ b/nms-patches/net/minecraft/network/chat/IChatBaseComponent.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/IChatBaseComponent.java
-+++ b/net/minecraft/server/IChatBaseComponent.java
-@@ -23,7 +23,23 @@
- import java.util.Optional;
- import javax.annotation.Nullable;
+--- a/net/minecraft/network/chat/IChatBaseComponent.java
++++ b/net/minecraft/network/chat/IChatBaseComponent.java
+@@ -27,7 +27,23 @@
+ import net.minecraft.util.ChatDeserializer;
+ import net.minecraft.util.ChatTypeAdapterFactory;
-public interface IChatBaseComponent extends Message, IChatFormatted {
+// CraftBukkit start
diff --git a/nms-patches/net/minecraft/network/protocol/PlayerConnectionUtils.patch b/nms-patches/net/minecraft/network/protocol/PlayerConnectionUtils.patch
index ca65b01e9..5736dc94d 100644
--- a/nms-patches/net/minecraft/network/protocol/PlayerConnectionUtils.patch
+++ b/nms-patches/net/minecraft/network/protocol/PlayerConnectionUtils.patch
@@ -1,6 +1,18 @@
---- a/net/minecraft/server/PlayerConnectionUtils.java
-+++ b/net/minecraft/server/PlayerConnectionUtils.java
-@@ -14,6 +14,7 @@
+--- a/net/minecraft/network/protocol/PlayerConnectionUtils.java
++++ b/net/minecraft/network/protocol/PlayerConnectionUtils.java
+@@ -7,6 +7,11 @@
+ import org.apache.logging.log4j.LogManager;
+ import org.apache.logging.log4j.Logger;
+
++// CraftBukkit start
++import net.minecraft.server.MinecraftServer;
++import net.minecraft.server.network.PlayerConnection;
++// CraftBukkit end
++
+ public class PlayerConnectionUtils {
+
+ private static final Logger LOGGER = LogManager.getLogger();
+@@ -18,6 +23,7 @@
public static void ensureMainThread(Packet packet, T t0, IAsyncTaskHandler> iasynctaskhandler) throws CancelledPacketHandleException {
if (!iasynctaskhandler.isMainThread()) {
iasynctaskhandler.execute(() -> {
@@ -8,7 +20,7 @@
if (t0.a().isConnected()) {
packet.a(t0);
} else {
-@@ -22,6 +23,10 @@
+@@ -26,6 +32,10 @@
});
throw CancelledPacketHandleException.INSTANCE;
diff --git a/nms-patches/net/minecraft/network/protocol/game/PacketPlayInCloseWindow.patch b/nms-patches/net/minecraft/network/protocol/game/PacketPlayInCloseWindow.patch
index c17757e85..65269fb77 100644
--- a/nms-patches/net/minecraft/network/protocol/game/PacketPlayInCloseWindow.patch
+++ b/nms-patches/net/minecraft/network/protocol/game/PacketPlayInCloseWindow.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PacketPlayInCloseWindow.java
-+++ b/net/minecraft/server/PacketPlayInCloseWindow.java
-@@ -8,6 +8,12 @@
+--- a/net/minecraft/network/protocol/game/PacketPlayInCloseWindow.java
++++ b/net/minecraft/network/protocol/game/PacketPlayInCloseWindow.java
+@@ -10,6 +10,12 @@
public PacketPlayInCloseWindow() {}
diff --git a/nms-patches/net/minecraft/network/protocol/game/PacketPlayOutMultiBlockChange.patch b/nms-patches/net/minecraft/network/protocol/game/PacketPlayOutMultiBlockChange.patch
index 01fa23df8..258e6468d 100644
--- a/nms-patches/net/minecraft/network/protocol/game/PacketPlayOutMultiBlockChange.patch
+++ b/nms-patches/net/minecraft/network/protocol/game/PacketPlayOutMultiBlockChange.patch
@@ -1,11 +1,11 @@
---- a/net/minecraft/server/PacketPlayOutMultiBlockChange.java
-+++ b/net/minecraft/server/PacketPlayOutMultiBlockChange.java
-@@ -24,7 +24,7 @@
+--- a/net/minecraft/network/protocol/game/PacketPlayOutMultiBlockChange.java
++++ b/net/minecraft/network/protocol/game/PacketPlayOutMultiBlockChange.java
+@@ -31,7 +31,7 @@
short short0 = (Short) shortiterator.next();
this.b[i] = short0;
- this.c[i] = chunksection.getType(SectionPosition.a(short0), SectionPosition.b(short0), SectionPosition.c(short0));
-+ this.c[i] = (chunksection != null) ? chunksection.getType(SectionPosition.a(short0), SectionPosition.b(short0), SectionPosition.c(short0)) : Blocks.AIR.getBlockData(); // CraftBukkit - SPIGOT-6076, Mojang bug when empty chunk section notified
++ this.c[i] = (chunksection != null) ? chunksection.getType(SectionPosition.a(short0), SectionPosition.b(short0), SectionPosition.c(short0)) : net.minecraft.world.level.block.Blocks.AIR.getBlockData(); // CraftBukkit - SPIGOT-6076, Mojang bug when empty chunk section notified
}
}
diff --git a/nms-patches/net/minecraft/network/protocol/game/PacketPlayOutWorldBorder.patch b/nms-patches/net/minecraft/network/protocol/game/PacketPlayOutWorldBorder.patch
index 90fd6b81e..8c73743e1 100644
--- a/nms-patches/net/minecraft/network/protocol/game/PacketPlayOutWorldBorder.patch
+++ b/nms-patches/net/minecraft/network/protocol/game/PacketPlayOutWorldBorder.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PacketPlayOutWorldBorder.java
-+++ b/net/minecraft/server/PacketPlayOutWorldBorder.java
-@@ -18,8 +18,10 @@
+--- a/net/minecraft/network/protocol/game/PacketPlayOutWorldBorder.java
++++ b/net/minecraft/network/protocol/game/PacketPlayOutWorldBorder.java
+@@ -21,8 +21,10 @@
public PacketPlayOutWorldBorder(WorldBorder worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction packetplayoutworldborder_enumworldborderaction) {
this.a = packetplayoutworldborder_enumworldborderaction;
diff --git a/nms-patches/net/minecraft/network/syncher/DataWatcher.patch b/nms-patches/net/minecraft/network/syncher/DataWatcher.patch
index dcd9692a2..a588c366e 100644
--- a/nms-patches/net/minecraft/network/syncher/DataWatcher.patch
+++ b/nms-patches/net/minecraft/network/syncher/DataWatcher.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/DataWatcher.java
-+++ b/net/minecraft/server/DataWatcher.java
-@@ -129,6 +129,13 @@
+--- a/net/minecraft/network/syncher/DataWatcher.java
++++ b/net/minecraft/network/syncher/DataWatcher.java
+@@ -134,6 +134,13 @@
}
diff --git a/nms-patches/net/minecraft/server/AdvancementDataPlayer.patch b/nms-patches/net/minecraft/server/AdvancementDataPlayer.patch
index 82ceec033..0a582f0dd 100644
--- a/nms-patches/net/minecraft/server/AdvancementDataPlayer.patch
+++ b/nms-patches/net/minecraft/server/AdvancementDataPlayer.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/AdvancementDataPlayer.java
+++ b/net/minecraft/server/AdvancementDataPlayer.java
-@@ -163,7 +163,11 @@
+@@ -181,7 +181,11 @@
Advancement advancement = advancementdataworld.a((MinecraftKey) entry.getKey());
if (advancement == null) {
@@ -13,7 +13,7 @@
} else {
this.a(advancement, (AdvancementProgress) entry.getValue());
}
-@@ -278,6 +282,7 @@
+@@ -296,6 +300,7 @@
this.j.add(advancement);
flag = true;
if (!flag1 && advancementprogress.isDone()) {
diff --git a/nms-patches/net/minecraft/server/CustomFunctionData.patch b/nms-patches/net/minecraft/server/CustomFunctionData.patch
index 113934fe1..3011b3c60 100644
--- a/nms-patches/net/minecraft/server/CustomFunctionData.patch
+++ b/nms-patches/net/minecraft/server/CustomFunctionData.patch
@@ -1,9 +1,9 @@
--- a/net/minecraft/server/CustomFunctionData.java
+++ b/net/minecraft/server/CustomFunctionData.java
-@@ -30,7 +30,7 @@
+@@ -36,7 +36,7 @@
}
- public com.mojang.brigadier.CommandDispatcher getCommandDispatcher() {
+ public CommandDispatcher getCommandDispatcher() {
- return this.server.getCommandDispatcher().a();
+ return this.server.vanillaCommandDispatcher.a(); // CraftBukkit
}
diff --git a/nms-patches/net/minecraft/server/DispenserRegistry.patch b/nms-patches/net/minecraft/server/DispenserRegistry.patch
index 3a9628978..74bb56c6c 100644
--- a/nms-patches/net/minecraft/server/DispenserRegistry.patch
+++ b/nms-patches/net/minecraft/server/DispenserRegistry.patch
@@ -1,6 +1,19 @@
--- a/net/minecraft/server/DispenserRegistry.java
+++ b/net/minecraft/server/DispenserRegistry.java
-@@ -31,6 +31,69 @@
+@@ -26,6 +26,12 @@
+ import org.apache.logging.log4j.LogManager;
+ import org.apache.logging.log4j.Logger;
+
++// CraftBukkit start
++import net.minecraft.util.datafix.fixes.DataConverterFlattenData;
++import net.minecraft.util.datafix.fixes.DataConverterMaterialId;
++import net.minecraft.util.datafix.fixes.DataConverterSpawnEgg;
++// CraftBukkit end
++
+ public class DispenserRegistry {
+
+ public static final PrintStream a = System.out;
+@@ -50,6 +56,69 @@
TagStatic.b();
d();
}
diff --git a/nms-patches/net/minecraft/server/Main.patch b/nms-patches/net/minecraft/server/Main.patch
index 4cad0c466..96c2a42d8 100644
--- a/nms-patches/net/minecraft/server/Main.patch
+++ b/nms-patches/net/minecraft/server/Main.patch
@@ -1,6 +1,18 @@
--- a/net/minecraft/server/Main.java
+++ b/net/minecraft/server/Main.java
-@@ -27,7 +27,8 @@
+@@ -54,13 +54,20 @@
+ import org.apache.logging.log4j.LogManager;
+ import org.apache.logging.log4j.Logger;
+
++// CraftBukkit start
++import net.minecraft.SharedConstants;
++import net.minecraft.world.level.dimension.DimensionManager;
++import net.minecraft.world.level.dimension.WorldDimension;
++// CraftBukkit end
++
+ public class Main {
+
+ private static final Logger LOGGER = LogManager.getLogger();
public Main() {}
@@ -10,7 +22,7 @@
OptionParser optionparser = new OptionParser();
OptionSpec optionspec = optionparser.accepts("nogui");
OptionSpec optionspec1 = optionparser.accepts("initSettings", "Initializes 'server.properties' and 'eula.txt', then quits");
-@@ -51,20 +52,22 @@
+@@ -84,21 +91,23 @@
optionparser.printHelpOn(System.err);
return;
}
@@ -22,20 +34,25 @@
DispenserRegistry.c();
SystemUtils.l();
IRegistryCustom.Dimension iregistrycustom_dimension = IRegistryCustom.b();
- java.nio.file.Path java_nio_file_path = Paths.get("server.properties");
-- DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(iregistrycustom_dimension, java_nio_file_path);
+- Path path = Paths.get("server.properties");
+- DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(iregistrycustom_dimension, path);
++ java.nio.file.Path java_nio_file_path = Paths.get("server.properties");
+ DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(iregistrycustom_dimension, optionset); // CraftBukkit - CLI argument support
dedicatedserversettings.save();
- java.nio.file.Path java_nio_file_path1 = Paths.get("eula.txt");
- EULA eula = new EULA(java_nio_file_path1);
+- Path path1 = Paths.get("eula.txt");
+- EULA eula = new EULA(path1);
++ java.nio.file.Path java_nio_file_path1 = Paths.get("eula.txt");
++ EULA eula = new EULA(java_nio_file_path1);
- if (optionset.has(optionspec1)) {
+- Main.LOGGER.info("Initialized '{}' and '{}'", path.toAbsolutePath(), path1.toAbsolutePath());
+ if (optionset.has("initSettings")) { // CraftBukkit
- Main.LOGGER.info("Initialized '{}' and '{}'", java_nio_file_path.toAbsolutePath(), java_nio_file_path1.toAbsolutePath());
++ Main.LOGGER.info("Initialized '{}' and '{}'", java_nio_file_path.toAbsolutePath(), java_nio_file_path1.toAbsolutePath());
return;
}
-@@ -74,24 +77,42 @@
+
+@@ -107,24 +116,42 @@
return;
}
@@ -82,7 +99,7 @@
DataPackConfiguration datapackconfiguration1 = MinecraftServer.a(resourcepackrepository, datapackconfiguration == null ? DataPackConfiguration.a : datapackconfiguration, flag);
CompletableFuture completablefuture = DataPackResources.a(resourcepackrepository.f(), CommandDispatcher.ServerType.DEDICATED, dedicatedserversettings.getProperties().functionPermissionLevel, SystemUtils.f(), Runnable::run);
-@@ -106,6 +127,7 @@
+@@ -139,6 +166,7 @@
}
datapackresources.i();
@@ -90,7 +107,7 @@
RegistryReadOps registryreadops = RegistryReadOps.a((DynamicOps) DynamicOpsNBT.a, datapackresources.h(), iregistrycustom_dimension);
Object object = convertable_conversionsession.a((DynamicOps) registryreadops, datapackconfiguration1);
-@@ -133,21 +155,32 @@
+@@ -166,21 +194,32 @@
}
convertable_conversionsession.a((IRegistryCustom) iregistrycustom_dimension, (SaveData) object);
@@ -125,7 +142,7 @@
Thread thread = new Thread("Server Shutdown Thread") {
public void run() {
dedicatedserver.safeShutdown(true);
-@@ -156,14 +189,15 @@
+@@ -189,14 +228,15 @@
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(Main.LOGGER));
Runtime.getRuntime().addShutdownHook(thread);
diff --git a/nms-patches/net/minecraft/server/MinecraftServer.patch b/nms-patches/net/minecraft/server/MinecraftServer.patch
index 0022c7eab..431afd605 100644
--- a/nms-patches/net/minecraft/server/MinecraftServer.patch
+++ b/nms-patches/net/minecraft/server/MinecraftServer.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
-@@ -55,6 +55,18 @@
+@@ -155,6 +155,25 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -10,6 +10,13 @@
+import com.google.common.collect.ImmutableSet;
+import jline.console.ConsoleReader;
+import joptsimple.OptionSet;
++import net.minecraft.nbt.DynamicOpsNBT;
++import net.minecraft.nbt.NBTBase;
++import net.minecraft.resources.RegistryReadOps;
++import net.minecraft.server.dedicated.DedicatedServer;
++import net.minecraft.server.dedicated.DedicatedServerProperties;
++import net.minecraft.util.datafix.DataConverterRegistry;
++import net.minecraft.world.level.storage.WorldDataServer;
+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.craftbukkit.Main;
@@ -19,7 +26,7 @@
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant implements IMojangStatistics, ICommandListener, AutoCloseable {
public static final Logger LOGGER = LogManager.getLogger();
-@@ -124,6 +136,20 @@
+@@ -224,6 +243,20 @@
private final DefinedStructureManager ak;
protected SaveData saveData;
@@ -40,7 +47,7 @@
public static S a(Function function) {
AtomicReference atomicreference = new AtomicReference();
Thread thread = new Thread(() -> {
-@@ -133,21 +159,21 @@
+@@ -233,21 +266,21 @@
thread.setUncaughtExceptionHandler((thread1, throwable) -> {
MinecraftServer.LOGGER.error(throwable);
});
@@ -65,7 +72,7 @@
this.isRunning = true;
this.h = new long[100];
this.K = "";
-@@ -173,7 +199,34 @@
+@@ -273,7 +306,34 @@
this.ak = new DefinedStructureManager(datapackresources.h(), convertable_conversionsession, datafixer);
this.serverThread = thread;
this.executorService = SystemUtils.f();
@@ -100,7 +107,7 @@
private void initializeScoreboards(WorldPersistentData worldpersistentdata) {
PersistentScoreboard persistentscoreboard = (PersistentScoreboard) worldpersistentdata.a(PersistentScoreboard::new, "scoreboard");
-@@ -186,7 +239,7 @@
+@@ -286,7 +346,7 @@
public static void convertWorld(Convertable.ConversionSession convertable_conversionsession) {
if (convertable_conversionsession.isConvertable()) {
@@ -109,7 +116,7 @@
convertable_conversionsession.convert(new IProgressUpdate() {
private long a = SystemUtils.getMonotonicMillis();
-@@ -209,45 +262,184 @@
+@@ -309,45 +369,184 @@
}
@@ -325,7 +332,7 @@
WorldBorder worldborder = worldserver.getWorldBorder();
worldborder.a(iworlddataserver.r());
-@@ -272,31 +464,8 @@
+@@ -372,31 +571,8 @@
iworlddataserver.c(true);
}
@@ -358,7 +365,7 @@
private static void a(WorldServer worldserver, IWorldDataServer iworlddataserver, boolean flag, boolean flag1, boolean flag2) {
ChunkGenerator chunkgenerator = worldserver.getChunkProvider().getChunkGenerator();
-@@ -312,6 +481,21 @@
+@@ -412,6 +588,21 @@
return biomebase.b().b();
}, random);
ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
@@ -380,7 +387,7 @@
if (blockposition == null) {
MinecraftServer.LOGGER.warn("Unable to find spawn biome");
-@@ -378,8 +562,15 @@
+@@ -478,8 +669,15 @@
iworlddataserver.setGameType(EnumGamemode.SPECTATOR);
}
@@ -398,7 +405,7 @@
MinecraftServer.LOGGER.info("Preparing start region for dimension {}", worldserver.getDimensionKey().a());
BlockPosition blockposition = worldserver.getSpawn();
-@@ -392,17 +583,21 @@
+@@ -492,17 +690,21 @@
chunkproviderserver.addTicket(TicketType.START, new ChunkCoordIntPair(blockposition), 11, Unit.INSTANCE);
while (chunkproviderserver.b() != 441) {
@@ -429,7 +436,7 @@
if (forcedchunk != null) {
LongIterator longiterator = forcedchunk.a().iterator();
-@@ -416,11 +611,18 @@
+@@ -516,11 +718,18 @@
}
}
@@ -451,7 +458,7 @@
}
protected void loadResourcesZip() {
-@@ -465,12 +667,16 @@
+@@ -565,12 +774,16 @@
worldserver.save((IProgressUpdate) null, flag1, worldserver.savingDisabled && !flag2);
}
@@ -468,7 +475,7 @@
return flag3;
}
-@@ -479,8 +685,29 @@
+@@ -579,8 +792,29 @@
this.stop();
}
@@ -498,7 +505,7 @@
if (this.getServerConnection() != null) {
this.getServerConnection().b();
}
-@@ -489,6 +716,7 @@
+@@ -589,6 +823,7 @@
MinecraftServer.LOGGER.info("Saving players");
this.playerList.savePlayers();
this.playerList.shutdown();
@@ -506,7 +513,7 @@
}
MinecraftServer.LOGGER.info("Saving worlds");
-@@ -566,14 +794,16 @@
+@@ -666,14 +901,16 @@
while (this.isRunning) {
long i = SystemUtils.getMonotonicMillis() - this.nextTick;
@@ -524,7 +531,7 @@
this.nextTick += 50L;
GameProfilerTick gameprofilertick = GameProfilerTick.a("Server");
-@@ -619,6 +849,12 @@
+@@ -719,6 +956,12 @@
} catch (Throwable throwable1) {
MinecraftServer.LOGGER.error("Exception stopping the server", throwable1);
} finally {
@@ -537,7 +544,7 @@
this.exit();
}
-@@ -627,8 +863,15 @@
+@@ -727,8 +970,15 @@
}
private boolean canSleepForTick() {
@@ -554,7 +561,7 @@
protected void sleepForTick() {
this.executeAll();
-@@ -734,7 +977,7 @@
+@@ -834,7 +1084,7 @@
this.serverPing.b().a(agameprofile);
}
@@ -563,7 +570,7 @@
MinecraftServer.LOGGER.debug("Autosave started");
this.methodProfiler.enter("save");
this.playerList.savePlayers();
-@@ -764,22 +1007,39 @@
+@@ -864,22 +1114,39 @@
}
protected void b(BooleanSupplier booleansupplier) {
@@ -603,7 +610,7 @@
this.methodProfiler.enter("tick");
-@@ -863,7 +1123,7 @@
+@@ -963,7 +1230,7 @@
}
public String getServerModName() {
@@ -612,7 +619,7 @@
}
public CrashReport b(CrashReport crashreport) {
-@@ -1220,16 +1480,17 @@
+@@ -1320,16 +1587,17 @@
public CompletableFuture a(Collection collection) {
CompletableFuture completablefuture = CompletableFuture.supplyAsync(() -> {
@@ -632,7 +639,7 @@
this.resourcePackRepository.a(collection);
this.saveData.a(a(this.resourcePackRepository));
datapackresources.i();
-@@ -1595,6 +1856,22 @@
+@@ -1695,6 +1963,22 @@
}
diff --git a/nms-patches/net/minecraft/server/ScoreboardServer.patch b/nms-patches/net/minecraft/server/ScoreboardServer.patch
index aa58fe766..8de9c327c 100644
--- a/nms-patches/net/minecraft/server/ScoreboardServer.patch
+++ b/nms-patches/net/minecraft/server/ScoreboardServer.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/ScoreboardServer.java
+++ b/net/minecraft/server/ScoreboardServer.java
-@@ -22,7 +22,7 @@
+@@ -32,7 +32,7 @@
public void handleScoreChanged(ScoreboardScore scoreboardscore) {
super.handleScoreChanged(scoreboardscore);
if (this.b.contains(scoreboardscore.getObjective())) {
@@ -9,7 +9,7 @@
}
this.b();
-@@ -31,7 +31,7 @@
+@@ -41,7 +41,7 @@
@Override
public void handlePlayerRemoved(String s) {
super.handlePlayerRemoved(s);
@@ -18,7 +18,7 @@
this.b();
}
-@@ -39,7 +39,7 @@
+@@ -49,7 +49,7 @@
public void a(String s, ScoreboardObjective scoreboardobjective) {
super.a(s, scoreboardobjective);
if (this.b.contains(scoreboardobjective)) {
@@ -27,7 +27,7 @@
}
this.b();
-@@ -52,7 +52,7 @@
+@@ -62,7 +62,7 @@
super.setDisplaySlot(i, scoreboardobjective);
if (scoreboardobjective1 != scoreboardobjective && scoreboardobjective1 != null) {
if (this.h(scoreboardobjective1) > 0) {
@@ -36,7 +36,7 @@
} else {
this.g(scoreboardobjective1);
}
-@@ -60,7 +60,7 @@
+@@ -70,7 +70,7 @@
if (scoreboardobjective != null) {
if (this.b.contains(scoreboardobjective)) {
@@ -45,7 +45,7 @@
} else {
this.e(scoreboardobjective);
}
-@@ -72,7 +72,7 @@
+@@ -82,7 +82,7 @@
@Override
public boolean addPlayerToTeam(String s, ScoreboardTeam scoreboardteam) {
if (super.addPlayerToTeam(s, scoreboardteam)) {
@@ -54,7 +54,7 @@
this.b();
return true;
} else {
-@@ -83,7 +83,7 @@
+@@ -93,7 +93,7 @@
@Override
public void removePlayerFromTeam(String s, ScoreboardTeam scoreboardteam) {
super.removePlayerFromTeam(s, scoreboardteam);
@@ -63,7 +63,7 @@
this.b();
}
-@@ -97,7 +97,7 @@
+@@ -107,7 +107,7 @@
public void handleObjectiveChanged(ScoreboardObjective scoreboardobjective) {
super.handleObjectiveChanged(scoreboardobjective);
if (this.b.contains(scoreboardobjective)) {
@@ -72,7 +72,7 @@
}
this.b();
-@@ -116,21 +116,21 @@
+@@ -126,21 +126,21 @@
@Override
public void handleTeamAdded(ScoreboardTeam scoreboardteam) {
super.handleTeamAdded(scoreboardteam);
@@ -97,7 +97,7 @@
this.b();
}
-@@ -179,6 +179,7 @@
+@@ -189,6 +189,7 @@
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
@@ -105,7 +105,7 @@
Iterator iterator1 = list.iterator();
while (iterator1.hasNext()) {
-@@ -211,6 +212,7 @@
+@@ -221,6 +222,7 @@
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
@@ -113,7 +113,7 @@
Iterator iterator1 = list.iterator();
while (iterator1.hasNext()) {
-@@ -235,6 +237,16 @@
+@@ -245,6 +247,16 @@
return i;
}
diff --git a/nms-patches/net/minecraft/server/bossevents/BossBattleCustom.patch b/nms-patches/net/minecraft/server/bossevents/BossBattleCustom.patch
index ce2c0d372..e8a5292d5 100644
--- a/nms-patches/net/minecraft/server/bossevents/BossBattleCustom.patch
+++ b/nms-patches/net/minecraft/server/bossevents/BossBattleCustom.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BossBattleCustom.java
-+++ b/net/minecraft/server/BossBattleCustom.java
-@@ -6,12 +6,27 @@
- import java.util.Set;
- import java.util.UUID;
+--- a/net/minecraft/server/bossevents/BossBattleCustom.java
++++ b/net/minecraft/server/bossevents/BossBattleCustom.java
+@@ -18,12 +18,27 @@
+ import net.minecraft.util.MathHelper;
+ import net.minecraft.world.BossBattle;
+// CraftBukkit start
+import org.bukkit.boss.KeyedBossBar;
diff --git a/nms-patches/net/minecraft/server/commands/CommandEffect.patch b/nms-patches/net/minecraft/server/commands/CommandEffect.patch
index 42f552438..c7a2f22e4 100644
--- a/nms-patches/net/minecraft/server/commands/CommandEffect.patch
+++ b/nms-patches/net/minecraft/server/commands/CommandEffect.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/CommandEffect.java
-+++ b/net/minecraft/server/CommandEffect.java
-@@ -62,7 +62,7 @@
+--- a/net/minecraft/server/commands/CommandEffect.java
++++ b/net/minecraft/server/commands/CommandEffect.java
+@@ -71,7 +71,7 @@
if (entity instanceof EntityLiving) {
MobEffect mobeffect = new MobEffect(mobeffectlist, k, i, false, flag);
@@ -9,7 +9,7 @@
++j;
}
}
-@@ -88,7 +88,7 @@
+@@ -97,7 +97,7 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
@@ -18,7 +18,7 @@
++i;
}
}
-@@ -113,7 +113,7 @@
+@@ -122,7 +122,7 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
diff --git a/nms-patches/net/minecraft/server/commands/CommandGamemode.patch b/nms-patches/net/minecraft/server/commands/CommandGamemode.patch
index b29b48284..a6e32badd 100644
--- a/nms-patches/net/minecraft/server/commands/CommandGamemode.patch
+++ b/nms-patches/net/minecraft/server/commands/CommandGamemode.patch
@@ -1,12 +1,12 @@
---- a/net/minecraft/server/CommandGamemode.java
-+++ b/net/minecraft/server/CommandGamemode.java
-@@ -55,6 +55,12 @@
+--- a/net/minecraft/server/commands/CommandGamemode.java
++++ b/net/minecraft/server/commands/CommandGamemode.java
+@@ -63,6 +63,12 @@
if (entityplayer.playerInteractManager.getGameMode() != enumgamemode) {
entityplayer.a(enumgamemode);
+ // CraftBukkit start - handle event cancelling the change
+ if (entityplayer.playerInteractManager.getGameMode() != enumgamemode) {
-+ commandcontext.getSource().sendFailureMessage(new ChatComponentText("Failed to set the gamemode of '" + entityplayer.getName() + "'"));
++ commandcontext.getSource().sendFailureMessage(new net.minecraft.network.chat.ChatComponentText("Failed to set the gamemode of '" + entityplayer.getName() + "'"));
+ continue;
+ }
+ // CraftBukkit end
diff --git a/nms-patches/net/minecraft/server/commands/CommandGamerule.patch b/nms-patches/net/minecraft/server/commands/CommandGamerule.patch
index ee5121aff..b15ef20f8 100644
--- a/nms-patches/net/minecraft/server/commands/CommandGamerule.patch
+++ b/nms-patches/net/minecraft/server/commands/CommandGamerule.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/CommandGamerule.java
-+++ b/net/minecraft/server/CommandGamerule.java
-@@ -25,7 +25,7 @@
+--- a/net/minecraft/server/commands/CommandGamerule.java
++++ b/net/minecraft/server/commands/CommandGamerule.java
+@@ -29,7 +29,7 @@
private static > int b(CommandContext commandcontext, GameRules.GameRuleKey gamerules_gamerulekey) {
CommandListenerWrapper commandlistenerwrapper = (CommandListenerWrapper) commandcontext.getSource();
@@ -9,7 +9,7 @@
t0.b(commandcontext, "value");
commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamerule.set", new Object[]{gamerules_gamerulekey.a(), t0.toString()}), true);
-@@ -33,7 +33,7 @@
+@@ -37,7 +37,7 @@
}
private static > int b(CommandListenerWrapper commandlistenerwrapper, GameRules.GameRuleKey gamerules_gamerulekey) {
diff --git a/nms-patches/net/minecraft/server/commands/CommandReload.patch b/nms-patches/net/minecraft/server/commands/CommandReload.patch
index 4257289f4..aa80246d7 100644
--- a/nms-patches/net/minecraft/server/commands/CommandReload.patch
+++ b/nms-patches/net/minecraft/server/commands/CommandReload.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/CommandReload.java
-+++ b/net/minecraft/server/CommandReload.java
-@@ -36,6 +36,16 @@
+--- a/net/minecraft/server/commands/CommandReload.java
++++ b/net/minecraft/server/commands/CommandReload.java
+@@ -42,6 +42,16 @@
return collection1;
}
@@ -14,6 +14,6 @@
+ }
+ // CraftBukkit end
+
- public static void a(com.mojang.brigadier.CommandDispatcher com_mojang_brigadier_commanddispatcher) {
- com_mojang_brigadier_commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("reload").requires((commandlistenerwrapper) -> {
+ public static void a(CommandDispatcher commanddispatcher) {
+ commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) net.minecraft.commands.CommandDispatcher.a("reload").requires((commandlistenerwrapper) -> {
return commandlistenerwrapper.hasPermission(2);
diff --git a/nms-patches/net/minecraft/server/commands/CommandSpreadPlayers.patch b/nms-patches/net/minecraft/server/commands/CommandSpreadPlayers.patch
index 928dadb88..908a245e6 100644
--- a/nms-patches/net/minecraft/server/commands/CommandSpreadPlayers.patch
+++ b/nms-patches/net/minecraft/server/commands/CommandSpreadPlayers.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/CommandSpreadPlayers.java
-+++ b/net/minecraft/server/CommandSpreadPlayers.java
-@@ -61,7 +61,7 @@
+--- a/net/minecraft/server/commands/CommandSpreadPlayers.java
++++ b/net/minecraft/server/commands/CommandSpreadPlayers.java
+@@ -77,7 +77,7 @@
if (entity instanceof EntityHuman) {
set.add(entity.getScoreboardTeam());
} else {
@@ -9,7 +9,7 @@
}
}
-@@ -270,7 +270,7 @@
+@@ -286,7 +286,7 @@
for (boolean flag2 = iblockaccess.getType(blockposition_mutableblockposition).isAir(); blockposition_mutableblockposition.getY() > 0; flag2 = flag1) {
blockposition_mutableblockposition.c(EnumDirection.DOWN);
@@ -18,7 +18,7 @@
if (!flag1 && flag2 && flag) {
return blockposition_mutableblockposition.getY() + 1;
}
-@@ -283,7 +283,7 @@
+@@ -299,7 +299,7 @@
public boolean b(IBlockAccess iblockaccess, int i) {
BlockPosition blockposition = new BlockPosition(this.a, (double) (this.a(iblockaccess, i) - 1), this.b);
@@ -27,7 +27,7 @@
Material material = iblockdata.getMaterial();
return blockposition.getY() < i && !material.isLiquid() && material != Material.FIRE;
-@@ -293,5 +293,12 @@
+@@ -309,5 +309,12 @@
this.a = MathHelper.a(random, d0, d2);
this.b = MathHelper.a(random, d1, d3);
}
diff --git a/nms-patches/net/minecraft/server/commands/CommandTeleport.patch b/nms-patches/net/minecraft/server/commands/CommandTeleport.patch
index d19b84e27..d00d4e10d 100644
--- a/nms-patches/net/minecraft/server/commands/CommandTeleport.patch
+++ b/nms-patches/net/minecraft/server/commands/CommandTeleport.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/CommandTeleport.java
-+++ b/net/minecraft/server/CommandTeleport.java
-@@ -13,6 +13,12 @@
- import java.util.Set;
- import javax.annotation.Nullable;
+--- a/net/minecraft/server/commands/CommandTeleport.java
++++ b/net/minecraft/server/commands/CommandTeleport.java
+@@ -35,6 +35,12 @@
+ import net.minecraft.world.phys.Vec2F;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.Location;
@@ -13,7 +13,7 @@
public class CommandTeleport {
private static final SimpleCommandExceptionType a = new SimpleCommandExceptionType(new ChatMessage("commands.teleport.invalidPosition"));
-@@ -128,9 +134,9 @@
+@@ -150,9 +156,9 @@
}
if (worldserver == entity.world) {
@@ -25,7 +25,7 @@
}
entity.setHeadRotation(f);
-@@ -139,6 +145,21 @@
+@@ -161,6 +167,21 @@
float f3 = MathHelper.g(f1);
f3 = MathHelper.a(f3, -90.0F, 90.0F);
diff --git a/nms-patches/net/minecraft/server/commands/CommandTime.patch b/nms-patches/net/minecraft/server/commands/CommandTime.patch
index 70526898e..328f5225f 100644
--- a/nms-patches/net/minecraft/server/commands/CommandTime.patch
+++ b/nms-patches/net/minecraft/server/commands/CommandTime.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/CommandTime.java
-+++ b/net/minecraft/server/CommandTime.java
-@@ -5,6 +5,11 @@
- import com.mojang.brigadier.builder.LiteralArgumentBuilder;
- import java.util.Iterator;
+--- a/net/minecraft/server/commands/CommandTime.java
++++ b/net/minecraft/server/commands/CommandTime.java
+@@ -10,6 +10,11 @@
+ import net.minecraft.network.chat.ChatMessage;
+ import net.minecraft.server.level.WorldServer;
+// CraftBukkit start
+import org.bukkit.Bukkit;
@@ -11,8 +11,8 @@
+
public class CommandTime {
- public static void a(com.mojang.brigadier.CommandDispatcher com_mojang_brigadier_commanddispatcher) {
-@@ -46,7 +51,13 @@
+ public static void a(CommandDispatcher commanddispatcher) {
+@@ -51,7 +56,13 @@
while (iterator.hasNext()) {
WorldServer worldserver = (WorldServer) iterator.next();
@@ -27,7 +27,7 @@
}
commandlistenerwrapper.sendMessage(new ChatMessage("commands.time.set", new Object[]{i}), true);
-@@ -59,7 +70,13 @@
+@@ -64,7 +75,13 @@
while (iterator.hasNext()) {
WorldServer worldserver = (WorldServer) iterator.next();
diff --git a/nms-patches/net/minecraft/server/dedicated/DedicatedServer.patch b/nms-patches/net/minecraft/server/dedicated/DedicatedServer.patch
index d5890e9a2..403bb661b 100644
--- a/nms-patches/net/minecraft/server/dedicated/DedicatedServer.patch
+++ b/nms-patches/net/minecraft/server/dedicated/DedicatedServer.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/DedicatedServer.java
-+++ b/net/minecraft/server/DedicatedServer.java
-@@ -22,6 +22,14 @@
+--- a/net/minecraft/server/dedicated/DedicatedServer.java
++++ b/net/minecraft/server/dedicated/DedicatedServer.java
+@@ -60,6 +60,15 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
++import net.minecraft.world.level.DataPackConfiguration;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.io.IoBuilder;
+import org.bukkit.command.CommandSender;
@@ -15,7 +16,7 @@
public class DedicatedServer extends MinecraftServer implements IMinecraftServer {
private static final Logger LOGGER = LogManager.getLogger();
-@@ -36,8 +44,10 @@
+@@ -74,8 +83,10 @@
@Nullable
private final TextFilter r;
@@ -28,7 +29,7 @@
this.propertyManager = dedicatedserversettings;
this.remoteControlCommandListener = new RemoteControlCommandListener(this);
this.r = null;
-@@ -47,13 +57,44 @@
+@@ -85,13 +96,44 @@
public boolean init() throws IOException {
Thread thread = new Thread("Server console handler") {
public void run() {
@@ -76,7 +77,7 @@
}
} catch (IOException ioexception) {
DedicatedServer.LOGGER.error("Exception handling console input", ioexception);
-@@ -62,6 +103,27 @@
+@@ -100,6 +142,27 @@
}
};
@@ -104,7 +105,7 @@
thread.setDaemon(true);
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER));
thread.start();
-@@ -88,7 +150,7 @@
+@@ -126,7 +189,7 @@
this.setForceGamemode(dedicatedserverproperties.forceGamemode);
super.setIdleTimeout((Integer) dedicatedserverproperties.playerIdleTimeout.get());
this.i(dedicatedserverproperties.enforceWhitelist);
@@ -113,7 +114,7 @@
DedicatedServer.LOGGER.info("Default game type: {}", dedicatedserverproperties.gamemode);
InetAddress inetaddress = null;
-@@ -112,6 +174,12 @@
+@@ -150,6 +213,12 @@
return false;
}
@@ -126,7 +127,7 @@
if (!this.getOnlineMode()) {
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
-@@ -126,7 +194,7 @@
+@@ -164,7 +233,7 @@
if (!NameReferencingFileConverter.e(this)) {
return false;
} else {
@@ -135,7 +136,7 @@
long i = SystemUtils.getMonotonicNanos();
this.c(dedicatedserverproperties.maxBuildHeight);
-@@ -134,7 +202,7 @@
+@@ -172,7 +241,7 @@
TileEntitySkull.a(this.getMinecraftSessionService());
UserCache.a(this.getOnlineMode());
DedicatedServer.LOGGER.info("Preparing level \"{}\"", this.getWorld());
@@ -144,7 +145,7 @@
long j = SystemUtils.getMonotonicNanos() - i;
String s = String.format(Locale.ROOT, "%.3fs", (double) j / 1.0E9D);
-@@ -151,6 +219,7 @@
+@@ -189,6 +258,7 @@
if (dedicatedserverproperties.enableRcon) {
DedicatedServer.LOGGER.info("Starting remote control listener");
this.remoteControlListener = RemoteControlListener.a((IMinecraftServer) this);
@@ -152,7 +153,7 @@
}
if (this.getMaxTickTime() > 0L) {
-@@ -265,6 +334,7 @@
+@@ -303,6 +373,7 @@
this.remoteStatusListener.b();
}
@@ -160,7 +161,7 @@
}
@Override
-@@ -293,7 +363,15 @@
+@@ -331,7 +402,15 @@
while (!this.serverCommandQueue.isEmpty()) {
ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0);
@@ -177,7 +178,7 @@
}
}
-@@ -503,14 +581,45 @@
+@@ -541,14 +620,45 @@
@Override
public String getPlugins() {
@@ -225,7 +226,7 @@
});
return this.remoteControlCommandListener.getMessages();
}
-@@ -552,4 +661,15 @@
+@@ -590,4 +700,15 @@
public ITextFilter a(EntityPlayer entityplayer) {
return this.r != null ? this.r.a(entityplayer.getProfile()) : null;
}
diff --git a/nms-patches/net/minecraft/server/dedicated/DedicatedServerProperties.patch b/nms-patches/net/minecraft/server/dedicated/DedicatedServerProperties.patch
index cf05169f0..dbf763a92 100644
--- a/nms-patches/net/minecraft/server/dedicated/DedicatedServerProperties.patch
+++ b/nms-patches/net/minecraft/server/dedicated/DedicatedServerProperties.patch
@@ -1,12 +1,12 @@
---- a/net/minecraft/server/DedicatedServerProperties.java
-+++ b/net/minecraft/server/DedicatedServerProperties.java
-@@ -3,8 +3,14 @@
- import java.util.Properties;
- import java.util.concurrent.TimeUnit;
+--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
++++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
+@@ -9,8 +9,14 @@
+ import net.minecraft.world.level.EnumGamemode;
+ import net.minecraft.world.level.levelgen.GeneratorSettings;
+// CraftBukkit start
+import joptsimple.OptionSet;
-+import net.minecraft.server.PropertyManager.EditableProperty;
++import net.minecraft.server.dedicated.PropertyManager.EditableProperty;
+// CraftBukkit end
+
public class DedicatedServerProperties extends PropertyManager {
@@ -15,7 +15,7 @@
public final boolean onlineMode = this.getBoolean("online-mode", true);
public final boolean preventProxyConnections = this.getBoolean("prevent-proxy-connections", false);
public final String serverIp = this.getString("server-ip", "");
-@@ -55,8 +61,10 @@
+@@ -61,8 +67,10 @@
public final PropertyManager.EditableProperty whiteList;
public final GeneratorSettings generatorSettings;
@@ -28,15 +28,15 @@
this.difficulty = (EnumDifficulty) this.a("difficulty", a(EnumDifficulty::getById, EnumDifficulty::a), EnumDifficulty::c, EnumDifficulty.EASY);
this.gamemode = (EnumGamemode) this.a("gamemode", a(EnumGamemode::getById, EnumGamemode::a), EnumGamemode::b, EnumGamemode.SURVIVAL);
this.levelName = this.getString("level-name", "world");
-@@ -107,12 +115,14 @@
+@@ -113,12 +121,14 @@
this.generatorSettings = GeneratorSettings.a(iregistrycustom, properties);
}
-- public static DedicatedServerProperties load(IRegistryCustom iregistrycustom, java.nio.file.Path java_nio_file_path) {
-- return new DedicatedServerProperties(loadPropertiesFile(java_nio_file_path), iregistrycustom);
+- public static DedicatedServerProperties load(IRegistryCustom iregistrycustom, Path path) {
+- return new DedicatedServerProperties(loadPropertiesFile(path), iregistrycustom);
+ // CraftBukkit start
-+ public static DedicatedServerProperties load(IRegistryCustom iregistrycustom, java.nio.file.Path java_nio_file_path, OptionSet optionset) {
-+ return new DedicatedServerProperties(loadPropertiesFile(java_nio_file_path), iregistrycustom, optionset);
++ public static DedicatedServerProperties load(IRegistryCustom iregistrycustom, Path path, OptionSet optionset) {
++ return new DedicatedServerProperties(loadPropertiesFile(path), iregistrycustom, optionset);
}
@Override
diff --git a/nms-patches/net/minecraft/server/dedicated/DedicatedServerSettings.patch b/nms-patches/net/minecraft/server/dedicated/DedicatedServerSettings.patch
index 09600053c..c80d143f1 100644
--- a/nms-patches/net/minecraft/server/dedicated/DedicatedServerSettings.patch
+++ b/nms-patches/net/minecraft/server/dedicated/DedicatedServerSettings.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/DedicatedServerSettings.java
-+++ b/net/minecraft/server/DedicatedServerSettings.java
-@@ -2,14 +2,21 @@
-
+--- a/net/minecraft/server/dedicated/DedicatedServerSettings.java
++++ b/net/minecraft/server/dedicated/DedicatedServerSettings.java
+@@ -4,14 +4,21 @@
import java.util.function.UnaryOperator;
+ import net.minecraft.core.IRegistryCustom;
+// CraftBukkit start
+import java.io.File;
@@ -11,12 +11,12 @@
+
public class DedicatedServerSettings {
- private final java.nio.file.Path path;
+ private final Path path;
private DedicatedServerProperties properties;
-- public DedicatedServerSettings(IRegistryCustom iregistrycustom, java.nio.file.Path java_nio_file_path) {
-- this.path = java_nio_file_path;
-- this.properties = DedicatedServerProperties.load(iregistrycustom, java_nio_file_path);
+- public DedicatedServerSettings(IRegistryCustom iregistrycustom, Path path) {
+- this.path = path;
+- this.properties = DedicatedServerProperties.load(iregistrycustom, path);
+ // CraftBukkit start
+ public DedicatedServerSettings(IRegistryCustom iregistrycustom, OptionSet optionset) {
+ this.path = ((File) optionset.valueOf("config")).toPath();
diff --git a/nms-patches/net/minecraft/server/dedicated/PropertyManager.patch b/nms-patches/net/minecraft/server/dedicated/PropertyManager.patch
index ed74157a5..46cb5dac7 100644
--- a/nms-patches/net/minecraft/server/dedicated/PropertyManager.patch
+++ b/nms-patches/net/minecraft/server/dedicated/PropertyManager.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PropertyManager.java
-+++ b/net/minecraft/server/PropertyManager.java
-@@ -15,15 +15,30 @@
+--- a/net/minecraft/server/dedicated/PropertyManager.java
++++ b/net/minecraft/server/dedicated/PropertyManager.java
+@@ -17,15 +17,30 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -29,22 +29,22 @@
+ }
+ // CraftBukkit end
+
- public static Properties loadPropertiesFile(java.nio.file.Path java_nio_file_path) {
+ public static Properties loadPropertiesFile(Path path) {
Properties properties = new Properties();
-@@ -59,6 +74,11 @@
+@@ -61,6 +76,11 @@
- public void savePropertiesFile(java.nio.file.Path java_nio_file_path) {
+ public void savePropertiesFile(Path path) {
try {
+ // CraftBukkit start - Don't attempt writing to file if it's read only
-+ if (java_nio_file_path.toFile().exists() && !java_nio_file_path.toFile().canWrite()) {
++ if (path.toFile().exists() && !path.toFile().canWrite()) {
+ return;
+ }
+ // CraftBukkit end
- OutputStream outputstream = Files.newOutputStream(java_nio_file_path);
+ OutputStream outputstream = Files.newOutputStream(path);
Throwable throwable = null;
-@@ -90,7 +110,7 @@
+@@ -92,7 +112,7 @@
private static Function a(Function function) {
return (s) -> {
try {
@@ -53,7 +53,7 @@
} catch (NumberFormatException numberformatexception) {
return null;
}
-@@ -109,7 +129,7 @@
+@@ -111,7 +131,7 @@
@Nullable
private String c(String s) {
@@ -62,7 +62,7 @@
}
@Nullable
-@@ -137,7 +157,7 @@
+@@ -139,7 +159,7 @@
V v1 = MoreObjects.firstNonNull(s1 != null ? function.apply(s1) : null, v0);
this.properties.put(s, function1.apply(v1));
@@ -71,7 +71,7 @@
}
protected V a(String s, Function function, UnaryOperator unaryoperator, Function function1, V v0) {
-@@ -166,7 +186,7 @@
+@@ -168,7 +188,7 @@
}
protected int getInt(String s, int i) {
@@ -80,7 +80,7 @@
}
protected PropertyManager.EditableProperty b(String s, int i) {
-@@ -178,7 +198,7 @@
+@@ -180,7 +200,7 @@
}
protected long getLong(String s, long i) {
@@ -89,7 +89,7 @@
}
protected boolean getBoolean(String s, boolean flag) {
-@@ -201,7 +221,7 @@
+@@ -203,7 +223,7 @@
return properties;
}
@@ -98,7 +98,7 @@
public class EditableProperty implements Supplier {
-@@ -209,7 +229,7 @@
+@@ -211,7 +231,7 @@
private final V c;
private final Function d;
@@ -107,7 +107,7 @@
this.b = s;
this.c = object;
this.d = function;
-@@ -223,7 +243,7 @@
+@@ -225,7 +245,7 @@
Properties properties = PropertyManager.this.a();
properties.put(this.b, this.d.apply(v0));
diff --git a/nms-patches/net/minecraft/server/gui/ServerGUI.patch b/nms-patches/net/minecraft/server/gui/ServerGUI.patch
index 26d6d72fe..98919073f 100644
--- a/nms-patches/net/minecraft/server/gui/ServerGUI.patch
+++ b/nms-patches/net/minecraft/server/gui/ServerGUI.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ServerGUI.java
-+++ b/net/minecraft/server/ServerGUI.java
-@@ -158,6 +158,7 @@
+--- a/net/minecraft/server/gui/ServerGUI.java
++++ b/net/minecraft/server/gui/ServerGUI.java
+@@ -160,6 +160,7 @@
this.e.forEach(Runnable::run);
}
@@ -8,7 +8,7 @@
public void a(JTextArea jtextarea, JScrollPane jscrollpane, String s) {
if (!SwingUtilities.isEventDispatchThread()) {
SwingUtilities.invokeLater(() -> {
-@@ -173,7 +174,7 @@
+@@ -175,7 +176,7 @@
}
try {
diff --git a/nms-patches/net/minecraft/server/level/ChunkMapDistance.patch b/nms-patches/net/minecraft/server/level/ChunkMapDistance.patch
index 294996698..a22bcbb1a 100644
--- a/nms-patches/net/minecraft/server/level/ChunkMapDistance.patch
+++ b/nms-patches/net/minecraft/server/level/ChunkMapDistance.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ChunkMapDistance.java
-+++ b/net/minecraft/server/ChunkMapDistance.java
-@@ -59,7 +59,7 @@
+--- a/net/minecraft/server/level/ChunkMapDistance.java
++++ b/net/minecraft/server/level/ChunkMapDistance.java
+@@ -65,7 +65,7 @@
while (objectiterator.hasNext()) {
Entry>> entry = (Entry) objectiterator.next();
@@ -9,7 +9,7 @@
return ticket.b(this.currentTick);
})) {
this.ticketLevelTracker.update(entry.getLongKey(), getLowestTicketLevel((ArraySetSorted) entry.getValue()), false);
-@@ -95,10 +95,25 @@
+@@ -101,10 +101,25 @@
}
if (!this.pendingChunkUpdates.isEmpty()) {
@@ -38,7 +38,7 @@
return true;
} else {
if (!this.l.isEmpty()) {
-@@ -134,23 +149,25 @@
+@@ -140,23 +155,25 @@
}
}
@@ -68,7 +68,7 @@
}
if (arraysetsorted.isEmpty()) {
-@@ -158,16 +175,29 @@
+@@ -164,16 +181,29 @@
}
this.ticketLevelTracker.update(i, getLowestTicketLevel(arraysetsorted), false);
@@ -101,7 +101,7 @@
}
public void addTicket(TicketType tickettype, ChunkCoordIntPair chunkcoordintpair, int i, T t0) {
-@@ -210,6 +240,7 @@
+@@ -216,6 +246,7 @@
public void b(SectionPosition sectionposition, EntityPlayer entityplayer) {
long i = sectionposition.r().pair();
ObjectSet objectset = (ObjectSet) this.c.get(i);
@@ -109,7 +109,7 @@
objectset.remove(entityplayer);
if (objectset.isEmpty()) {
-@@ -251,6 +282,26 @@
+@@ -257,6 +288,26 @@
return this.i.a();
}
diff --git a/nms-patches/net/minecraft/server/level/ChunkProviderServer.patch b/nms-patches/net/minecraft/server/level/ChunkProviderServer.patch
index b7f02ad87..9f436d3ca 100644
--- a/nms-patches/net/minecraft/server/level/ChunkProviderServer.patch
+++ b/nms-patches/net/minecraft/server/level/ChunkProviderServer.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ChunkProviderServer.java
-+++ b/net/minecraft/server/ChunkProviderServer.java
-@@ -54,6 +54,24 @@
+--- a/net/minecraft/server/level/ChunkProviderServer.java
++++ b/net/minecraft/server/level/ChunkProviderServer.java
+@@ -79,6 +79,24 @@
this.clearCache();
}
@@ -25,7 +25,7 @@
@Override
public LightEngineThreaded getLightEngine() {
return this.lightEngine;
-@@ -98,7 +116,7 @@
+@@ -123,7 +141,7 @@
for (int l = 0; l < 4; ++l) {
if (k == this.cachePos[l] && chunkstatus == this.cacheStatus[l]) {
ichunkaccess = this.cacheChunk[l];
@@ -34,7 +34,7 @@
return ichunkaccess;
}
}
-@@ -144,12 +162,12 @@
+@@ -169,12 +187,12 @@
if (playerchunk == null) {
return null;
} else {
@@ -49,7 +49,7 @@
if (ichunkaccess1 != null) {
this.a(k, ichunkaccess1, ChunkStatus.FULL);
-@@ -176,7 +194,15 @@
+@@ -201,7 +219,15 @@
int l = 33 + ChunkStatus.a(chunkstatus);
PlayerChunk playerchunk = this.getChunk(k);
@@ -66,7 +66,7 @@
this.chunkMapDistance.a(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair);
if (this.a(playerchunk, l)) {
GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
-@@ -195,7 +221,7 @@
+@@ -220,7 +246,7 @@
}
private boolean a(@Nullable PlayerChunk playerchunk, int i) {
@@ -75,7 +75,7 @@
}
public boolean isLoaded(int i, int j) {
-@@ -257,19 +283,19 @@
+@@ -282,19 +308,19 @@
public boolean a(Entity entity) {
long i = ChunkCoordIntPair.pair(MathHelper.floor(entity.locX()) >> 4, MathHelper.floor(entity.locZ()) >> 4);
@@ -98,7 +98,7 @@
}
private boolean a(long i, Function>> function) {
-@@ -291,11 +317,31 @@
+@@ -316,11 +342,31 @@
@Override
public void close() throws IOException {
@@ -131,7 +131,7 @@
public void tick(BooleanSupplier booleansupplier) {
this.world.getMethodProfiler().enter("purge");
this.chunkMapDistance.purgeTickets();
-@@ -315,12 +361,12 @@
+@@ -340,12 +386,12 @@
this.lastTickTime = i;
WorldData worlddata = this.world.getWorldData();
boolean flag = this.world.isDebugWorld();
@@ -146,7 +146,7 @@
this.world.getMethodProfiler().enter("naturalSpawnCount");
int l = this.chunkMapDistance.b();
-@@ -507,12 +553,18 @@
+@@ -532,12 +578,18 @@
@Override
protected boolean executeNext() {
diff --git a/nms-patches/net/minecraft/server/level/EntityPlayer.patch b/nms-patches/net/minecraft/server/level/EntityPlayer.patch
index b97c40d8e..a37fd60a0 100644
--- a/nms-patches/net/minecraft/server/level/EntityPlayer.patch
+++ b/nms-patches/net/minecraft/server/level/EntityPlayer.patch
@@ -1,10 +1,17 @@
---- a/net/minecraft/server/EntityPlayer.java
-+++ b/net/minecraft/server/EntityPlayer.java
-@@ -15,6 +15,28 @@
+--- a/net/minecraft/server/level/EntityPlayer.java
++++ b/net/minecraft/server/level/EntityPlayer.java
+@@ -135,6 +135,35 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
++import net.minecraft.nbt.NBTBase;
++import net.minecraft.world.damagesource.CombatTracker;
++import net.minecraft.world.food.FoodMetaData;
++import net.minecraft.world.item.enchantment.EnchantmentManager;
++import net.minecraft.world.level.block.BlockChest;
++import net.minecraft.world.level.dimension.DimensionManager;
++import net.minecraft.world.scores.Scoreboard;
+import org.bukkit.Bukkit;
+import org.bukkit.GameMode;
+import org.bukkit.Location;
@@ -29,7 +36,7 @@
public class EntityPlayer extends EntityHuman implements ICrafting {
private static final Logger LOGGER = LogManager.getLogger();
-@@ -60,6 +82,20 @@
+@@ -180,6 +209,20 @@
public int ping;
public boolean viewingCredits;
@@ -50,7 +57,7 @@
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) {
super(worldserver, worldserver.getSpawn(), worldserver.v(), gameprofile);
this.spawnDimension = World.OVERWORLD;
-@@ -71,12 +107,56 @@
+@@ -191,12 +234,56 @@
this.G = 1.0F;
this.c(worldserver);
this.co = minecraftserver.a(this);
@@ -108,7 +115,7 @@
int i = Math.max(0, this.server.a(worldserver));
int j = MathHelper.floor(worldserver.getWorldBorder().b((double) blockposition.getX(), (double) blockposition.getZ()));
-@@ -142,11 +222,20 @@
+@@ -262,11 +349,20 @@
if (nbttagcompound.hasKeyOfType("recipeBook", 10)) {
this.recipeBook.a(nbttagcompound.getCompound("recipeBook"), this.server.getCraftingManager());
}
@@ -129,7 +136,7 @@
if (nbttagcompound.hasKeyOfType("SpawnX", 99) && nbttagcompound.hasKeyOfType("SpawnY", 99) && nbttagcompound.hasKeyOfType("SpawnZ", 99)) {
this.spawn = new BlockPosition(nbttagcompound.getInt("SpawnX"), nbttagcompound.getInt("SpawnY"), nbttagcompound.getInt("SpawnZ"));
this.spawnForced = nbttagcompound.getBoolean("SpawnForced");
-@@ -180,7 +269,20 @@
+@@ -300,7 +396,20 @@
Entity entity = this.getRootVehicle();
Entity entity1 = this.getVehicle();
@@ -151,7 +158,7 @@
NBTTagCompound nbttagcompound2 = new NBTTagCompound();
NBTTagCompound nbttagcompound3 = new NBTTagCompound();
-@@ -198,7 +300,7 @@
+@@ -318,7 +427,7 @@
nbttagcompound.setInt("SpawnZ", this.spawn.getZ());
nbttagcompound.setBoolean("SpawnForced", this.spawnForced);
nbttagcompound.setFloat("SpawnAngle", this.spawnAngle);
@@ -160,7 +167,7 @@
Logger logger = EntityPlayer.LOGGER;
logger.getClass();
-@@ -206,9 +308,33 @@
+@@ -326,9 +435,33 @@
nbttagcompound.set("SpawnDimension", nbtbase);
});
}
@@ -194,7 +201,7 @@
public void a(int i) {
float f = (float) this.getExpToLevel();
float f1 = (f - 1.0F) / f;
-@@ -262,6 +388,11 @@
+@@ -382,6 +515,11 @@
@Override
public void tick() {
@@ -206,7 +213,7 @@
this.playerInteractManager.a();
--this.invulnerableTicks;
if (this.noDamageTicks > 0) {
-@@ -329,7 +460,7 @@
+@@ -449,7 +587,7 @@
}
if (this.getHealth() != this.lastHealthSent || this.lastFoodSent != this.foodData.getFoodLevel() || this.foodData.getSaturationLevel() == 0.0F != this.lastSentSaturationZero) {
@@ -215,7 +222,7 @@
this.lastHealthSent = this.getHealth();
this.lastFoodSent = this.foodData.getFoodLevel();
this.lastSentSaturationZero = this.foodData.getSaturationLevel() == 0.0F;
-@@ -360,6 +491,12 @@
+@@ -480,6 +618,12 @@
this.a(IScoreboardCriteria.XP, MathHelper.f((float) this.lastExpTotalScored));
}
@@ -228,7 +235,7 @@
if (this.expLevel != this.lastExpLevelScored) {
this.lastExpLevelScored = this.expLevel;
this.a(IScoreboardCriteria.LEVEL, MathHelper.f((float) this.lastExpLevelScored));
-@@ -374,6 +511,16 @@
+@@ -494,6 +638,16 @@
CriterionTriggers.p.a(this);
}
@@ -245,7 +252,7 @@
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Ticking player");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Player being ticked");
-@@ -384,7 +531,8 @@
+@@ -504,7 +658,8 @@
}
private void a(IScoreboardCriteria iscoreboardcriteria, int i) {
@@ -255,7 +262,7 @@
scoreboardscore.setScore(i);
});
}
-@@ -392,9 +540,46 @@
+@@ -512,9 +667,46 @@
@Override
public void die(DamageSource damagesource) {
boolean flag = this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES);
@@ -304,7 +311,7 @@
this.playerConnection.a((Packet) (new PacketPlayOutCombatEvent(this.getCombatTracker(), PacketPlayOutCombatEvent.EnumCombatEventType.ENTITY_DIED, ichatbasecomponent)), (future) -> {
if (!future.isSuccess()) {
-@@ -428,12 +613,18 @@
+@@ -548,12 +740,18 @@
if (this.world.getGameRules().getBoolean(GameRules.FORGIVE_DEAD_PLAYERS)) {
this.eW();
}
@@ -327,7 +334,7 @@
EntityLiving entityliving = this.getKillingEntity();
if (entityliving != null) {
-@@ -469,10 +660,12 @@
+@@ -589,10 +787,12 @@
String s = this.getName();
String s1 = entity.getName();
@@ -342,7 +349,7 @@
} else {
this.a(StatisticList.MOB_KILLS);
}
-@@ -490,7 +683,8 @@
+@@ -610,7 +810,8 @@
int i = scoreboardteam.getColor().b();
if (i >= 0 && i < aiscoreboardcriteria.length) {
@@ -352,7 +359,7 @@
}
}
-@@ -534,18 +728,20 @@
+@@ -654,18 +855,20 @@
}
private boolean canPvP() {
@@ -376,7 +383,7 @@
} else {
return shapedetectorshape;
}
-@@ -554,11 +750,20 @@
+@@ -674,11 +877,20 @@
@Nullable
@Override
public Entity b(WorldServer worldserver) {
@@ -400,7 +407,7 @@
this.decouple();
this.getWorldServer().removePlayer(this);
if (!this.viewingCredits) {
-@@ -569,6 +774,8 @@
+@@ -689,6 +901,8 @@
return this;
} else {
@@ -409,7 +416,7 @@
WorldData worlddata = worldserver.getWorldData();
this.playerConnection.sendPacket(new PacketPlayOutRespawn(worldserver.getDimensionManager(), worldserver.getDimensionKey(), BiomeManager.a(worldserver.getSeed()), this.playerInteractManager.getGameMode(), this.playerInteractManager.c(), worldserver.isDebugWorld(), worldserver.isFlatWorld(), true));
-@@ -578,22 +785,52 @@
+@@ -698,22 +912,52 @@
playerlist.d(this);
worldserver1.removePlayer(this);
this.dead = false;
@@ -468,7 +475,7 @@
worldserver1.getMethodProfiler().exit();
this.triggerDimensionAdvancements(worldserver1);
this.playerInteractManager.a(worldserver);
-@@ -612,12 +849,31 @@
+@@ -732,12 +976,31 @@
this.lastSentExp = -1;
this.lastHealthSent = -1.0F;
this.lastFoodSent = -1;
@@ -500,7 +507,7 @@
private void a(WorldServer worldserver, BlockPosition blockposition) {
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.i();
-@@ -634,17 +890,17 @@
+@@ -754,17 +1017,17 @@
}
@Override
@@ -523,7 +530,7 @@
}
return optional1;
-@@ -688,10 +944,8 @@
+@@ -808,10 +1071,8 @@
this.activeContainer.c();
}
@@ -536,7 +543,7 @@
if (!this.isSleeping() && this.isAlive()) {
if (!this.world.getDimensionManager().isNatural()) {
return Either.left(EntityHuman.EnumBedResult.NOT_POSSIBLE_HERE);
-@@ -717,7 +971,36 @@
+@@ -837,7 +1098,36 @@
}
}
@@ -574,7 +581,7 @@
this.a(StatisticList.SLEEP_IN_BED);
CriterionTriggers.q.a(this);
});
-@@ -726,9 +1009,8 @@
+@@ -846,9 +1136,8 @@
return either;
}
}
@@ -585,7 +592,7 @@
}
@Override
-@@ -755,6 +1037,24 @@
+@@ -875,6 +1164,24 @@
@Override
public void wakeup(boolean flag, boolean flag1) {
@@ -610,7 +617,7 @@
if (this.isSleeping()) {
this.getWorldServer().getChunkProvider().broadcastIncludingSelf(this, new PacketPlayOutAnimation(this, 2));
}
-@@ -826,8 +1126,9 @@
+@@ -946,8 +1253,9 @@
this.playerConnection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition()));
}
@@ -621,7 +628,7 @@
}
@Override
-@@ -842,6 +1143,24 @@
+@@ -962,6 +1270,24 @@
this.nextContainerCounter();
Container container = itileinventory.createMenu(this.containerCounter, this.inventory, this);
@@ -646,7 +653,7 @@
if (container == null) {
if (this.isSpectator()) {
this.a((IChatBaseComponent) (new ChatMessage("container.spectatorCantOpen")).a(EnumChatFormat.RED), true);
-@@ -849,9 +1168,11 @@
+@@ -969,9 +1295,11 @@
return OptionalInt.empty();
} else {
@@ -660,7 +667,7 @@
return OptionalInt.of(this.containerCounter);
}
}
-@@ -864,13 +1185,24 @@
+@@ -984,13 +1312,24 @@
@Override
public void openHorseInventory(EntityHorseAbstract entityhorseabstract, IInventory iinventory) {
@@ -687,7 +694,7 @@
this.activeContainer.addSlotListener(this);
}
-@@ -915,6 +1247,11 @@
+@@ -1035,6 +1374,11 @@
public void a(Container container, NonNullList nonnulllist) {
this.playerConnection.sendPacket(new PacketPlayOutWindowItems(container.windowId, nonnulllist));
this.playerConnection.sendPacket(new PacketPlayOutSetSlot(-1, -1, this.inventory.getCarried()));
@@ -699,7 +706,7 @@
}
@Override
-@@ -924,6 +1261,7 @@
+@@ -1044,6 +1388,7 @@
@Override
public void closeInventory() {
@@ -707,7 +714,7 @@
this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId));
this.o();
}
-@@ -958,7 +1296,7 @@
+@@ -1078,7 +1423,7 @@
@Override
public void a(Statistic> statistic, int i) {
this.serverStatisticManager.b(this, statistic, i);
@@ -716,7 +723,7 @@
scoreboardscore.addScore(i);
});
}
-@@ -966,7 +1304,7 @@
+@@ -1086,7 +1431,7 @@
@Override
public void a(Statistic> statistic) {
this.serverStatisticManager.setStatistic(this, statistic, 0);
@@ -725,7 +732,7 @@
}
@Override
-@@ -1015,7 +1353,16 @@
+@@ -1135,7 +1480,16 @@
public void triggerHealthUpdate() {
this.lastHealthSent = -1.0E8F;
@@ -742,7 +749,7 @@
@Override
public void a(IChatBaseComponent ichatbasecomponent, boolean flag) {
-@@ -1068,12 +1415,13 @@
+@@ -1188,12 +1542,13 @@
this.lastSentExp = -1;
this.lastHealthSent = -1.0F;
this.lastFoodSent = -1;
@@ -757,7 +764,7 @@
}
@Override
-@@ -1141,6 +1489,18 @@
+@@ -1261,6 +1616,18 @@
@Override
public void a(EnumGamemode enumgamemode) {
@@ -776,7 +783,7 @@
this.playerInteractManager.setGameMode(enumgamemode);
this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.d, (float) enumgamemode.getId()));
if (enumgamemode == EnumGamemode.SPECTATOR) {
-@@ -1190,7 +1550,20 @@
+@@ -1310,7 +1677,20 @@
return s;
}
@@ -797,7 +804,7 @@
this.bY = packetplayinsettings.d();
this.bZ = packetplayinsettings.e();
this.getDataWatcher().set(EntityPlayer.bi, (byte) packetplayinsettings.f());
-@@ -1226,13 +1599,13 @@
+@@ -1346,13 +1726,13 @@
if (entity instanceof EntityHuman) {
this.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(new int[]{entity.getId()}));
} else {
@@ -813,7 +820,7 @@
}
@Override
-@@ -1256,7 +1629,7 @@
+@@ -1376,7 +1756,7 @@
this.spectatedEntity = (Entity) (entity == null ? this : entity);
if (entity1 != this.spectatedEntity) {
this.playerConnection.sendPacket(new PacketPlayOutCamera(this.spectatedEntity));
@@ -822,7 +829,7 @@
}
}
-@@ -1285,7 +1658,7 @@
+@@ -1405,7 +1785,7 @@
@Nullable
public IChatBaseComponent getPlayerListName() {
@@ -831,7 +838,7 @@
}
@Override
-@@ -1306,9 +1679,16 @@
+@@ -1426,9 +1806,16 @@
return this.advancementDataPlayer;
}
@@ -848,7 +855,7 @@
if (worldserver == this.world) {
this.playerConnection.a(d0, d1, d2, f, f1);
} else {
-@@ -1329,6 +1709,9 @@
+@@ -1449,6 +1836,9 @@
this.server.getPlayerList().a(this, worldserver);
this.server.getPlayerList().updateClient(this);
}
@@ -858,7 +865,7 @@
}
-@@ -1426,4 +1809,144 @@
+@@ -1546,4 +1936,144 @@
public ITextFilter Q() {
return this.co;
}
@@ -954,7 +961,7 @@
+ }
+
+ @Override
-+ protected boolean isFrozen() {
++ public boolean isFrozen() {
+ return super.isFrozen() || !getBukkitEntity().isOnline();
+ }
+
diff --git a/nms-patches/net/minecraft/server/level/EntityTrackerEntry.patch b/nms-patches/net/minecraft/server/level/EntityTrackerEntry.patch
index c867d70d2..4ba2344e4 100644
--- a/nms-patches/net/minecraft/server/level/EntityTrackerEntry.patch
+++ b/nms-patches/net/minecraft/server/level/EntityTrackerEntry.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityTrackerEntry.java
-+++ b/net/minecraft/server/EntityTrackerEntry.java
-@@ -11,6 +11,11 @@
+--- a/net/minecraft/server/level/EntityTrackerEntry.java
++++ b/net/minecraft/server/level/EntityTrackerEntry.java
+@@ -40,6 +40,11 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -12,7 +12,7 @@
public class EntityTrackerEntry {
private static final Logger LOGGER = LogManager.getLogger();
-@@ -31,8 +36,12 @@
+@@ -60,8 +65,12 @@
private List p;
private boolean q;
private boolean r;
@@ -26,7 +26,7 @@
this.m = Vec3D.ORIGIN;
this.p = Collections.emptyList();
this.b = worldserver;
-@@ -52,16 +61,17 @@
+@@ -81,16 +90,17 @@
if (!list.equals(this.p)) {
this.p = list;
@@ -48,7 +48,7 @@
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
-@@ -106,6 +116,17 @@
+@@ -135,6 +145,17 @@
boolean flag2 = flag1 || this.tickCounter % 60 == 0;
boolean flag3 = Math.abs(i - this.yRot) >= 1 || Math.abs(j - this.xRot) >= 1;
@@ -66,7 +66,7 @@
if (this.tickCounter > 0 || this.tracker instanceof EntityArrow) {
long k = PacketPlayOutEntity.a(vec3d.x);
long l = PacketPlayOutEntity.a(vec3d.y);
-@@ -144,6 +165,7 @@
+@@ -173,6 +194,7 @@
}
this.c();
@@ -74,7 +74,7 @@
if (flag2) {
this.d();
}
-@@ -152,6 +174,7 @@
+@@ -181,6 +203,7 @@
this.yRot = i;
this.xRot = j;
}
@@ -82,7 +82,7 @@
this.q = false;
}
-@@ -167,7 +190,27 @@
+@@ -196,7 +219,27 @@
++this.tickCounter;
if (this.tracker.velocityChanged) {
@@ -111,7 +111,7 @@
this.tracker.velocityChanged = false;
}
-@@ -182,14 +225,17 @@
+@@ -211,14 +254,17 @@
PlayerConnection playerconnection = entityplayer.playerConnection;
entityplayer.playerConnection.getClass();
@@ -132,7 +132,7 @@
}
Packet> packet = this.tracker.P();
-@@ -205,6 +251,12 @@
+@@ -234,6 +280,12 @@
if (this.tracker instanceof EntityLiving) {
Collection collection = ((EntityLiving) this.tracker).getAttributeMap().b();
@@ -145,7 +145,7 @@
if (!collection.isEmpty()) {
consumer.accept(new PacketPlayOutUpdateAttributes(this.tracker.getId(), collection));
}
-@@ -236,8 +288,14 @@
+@@ -265,8 +317,14 @@
if (!list.isEmpty()) {
consumer.accept(new PacketPlayOutEntityEquipment(this.tracker.getId(), list));
}
@@ -160,7 +160,7 @@
if (this.tracker instanceof EntityLiving) {
EntityLiving entityliving = (EntityLiving) this.tracker;
Iterator iterator = entityliving.getEffects().iterator();
-@@ -278,6 +336,11 @@
+@@ -307,6 +365,11 @@
Set set = ((EntityLiving) this.tracker).getAttributeMap().getAttributes();
if (!set.isEmpty()) {
diff --git a/nms-patches/net/minecraft/server/level/PlayerChunk.patch b/nms-patches/net/minecraft/server/level/PlayerChunk.patch
index 004473544..6877ff396 100644
--- a/nms-patches/net/minecraft/server/level/PlayerChunk.patch
+++ b/nms-patches/net/minecraft/server/level/PlayerChunk.patch
@@ -1,6 +1,17 @@
---- a/net/minecraft/server/PlayerChunk.java
-+++ b/net/minecraft/server/PlayerChunk.java
-@@ -44,7 +44,7 @@
+--- a/net/minecraft/server/level/PlayerChunk.java
++++ b/net/minecraft/server/level/PlayerChunk.java
+@@ -33,6 +33,10 @@
+ import net.minecraft.world.level.chunk.ProtoChunkExtension;
+ import net.minecraft.world.level.lighting.LightEngine;
+
++// CraftBukkit start
++import net.minecraft.server.MinecraftServer;
++// CraftBukkit end
++
+ public class PlayerChunk {
+
+ public static final Either UNLOADED_CHUNK_ACCESS = Either.right(PlayerChunk.Failure.b);
+@@ -65,7 +69,7 @@
this.fullChunkFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
this.tickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
this.entityTickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
@@ -9,7 +20,7 @@
this.dirtyBlocks = new ShortSet[16];
this.location = chunkcoordintpair;
this.lightEngine = lightengine;
-@@ -56,6 +56,19 @@
+@@ -77,6 +81,19 @@
this.a(i);
}
@@ -29,7 +40,7 @@
public CompletableFuture> getStatusFutureUnchecked(ChunkStatus chunkstatus) {
CompletableFuture> completablefuture = (CompletableFuture) this.statusFutures.get(chunkstatus.c());
-@@ -81,9 +94,9 @@
+@@ -102,9 +119,9 @@
@Nullable
public Chunk getChunk() {
CompletableFuture> completablefuture = this.a();
@@ -41,7 +52,7 @@
}
@Nullable
-@@ -114,6 +127,7 @@
+@@ -135,6 +152,7 @@
if (chunk != null) {
byte b0 = (byte) SectionPosition.a(blockposition.getY());
@@ -49,7 +60,7 @@
if (this.dirtyBlocks[b0] == null) {
this.p = true;
this.dirtyBlocks[b0] = new ShortArraySet();
-@@ -216,7 +230,7 @@
+@@ -237,7 +255,7 @@
CompletableFuture> completablefuture = (CompletableFuture) this.statusFutures.get(i);
if (completablefuture != null) {
@@ -58,7 +69,7 @@
if (either == null || either.left().isPresent()) {
return completablefuture;
-@@ -271,6 +285,30 @@
+@@ -292,6 +310,30 @@
boolean flag1 = this.ticketLevel <= PlayerChunkMap.GOLDEN_TICKET;
PlayerChunk.State playerchunk_state = getChunkState(this.oldTicketLevel);
PlayerChunk.State playerchunk_state1 = getChunkState(this.ticketLevel);
@@ -89,7 +100,7 @@
CompletableFuture completablefuture;
if (flag) {
-@@ -302,7 +340,7 @@
+@@ -323,7 +365,7 @@
if (flag2 && !flag3) {
completablefuture = this.fullChunkFuture;
this.fullChunkFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE;
@@ -98,7 +109,7 @@
playerchunkmap.getClass();
return either1.ifLeft(playerchunkmap::a);
}));
-@@ -340,6 +378,26 @@
+@@ -361,6 +403,26 @@
this.u.a(this.location, this::k, this.ticketLevel, this::d);
this.oldTicketLevel = this.ticketLevel;
diff --git a/nms-patches/net/minecraft/server/level/PlayerChunkMap.patch b/nms-patches/net/minecraft/server/level/PlayerChunkMap.patch
index b24ce144f..789d0084a 100644
--- a/nms-patches/net/minecraft/server/level/PlayerChunkMap.patch
+++ b/nms-patches/net/minecraft/server/level/PlayerChunkMap.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PlayerChunkMap.java
-+++ b/net/minecraft/server/PlayerChunkMap.java
-@@ -45,6 +45,8 @@
+--- a/net/minecraft/server/level/PlayerChunkMap.java
++++ b/net/minecraft/server/level/PlayerChunkMap.java
+@@ -89,6 +89,8 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -9,7 +9,7 @@
public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
private static final Logger LOGGER = LogManager.getLogger();
-@@ -75,6 +77,31 @@
+@@ -119,6 +121,31 @@
private final Queue A;
private int viewDistance;
@@ -41,7 +41,7 @@
public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, Supplier supplier, int i, boolean flag) {
super(new File(convertable_conversionsession.a(worldserver.getDimensionKey()), "region"), datafixer, flag);
this.visibleChunks = this.updatingChunks.clone();
-@@ -195,9 +222,12 @@
+@@ -239,9 +266,12 @@
return completablefuture1.thenApply((list1) -> {
List list2 = Lists.newArrayList();
@@ -56,7 +56,7 @@
final Either either = (Either) iterator.next();
Optional optional = either.left();
-@@ -300,7 +330,7 @@
+@@ -344,7 +374,7 @@
PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.w.getName());
} else {
this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).forEach((playerchunk) -> {
@@ -65,7 +65,7 @@
if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) {
this.saveChunk(ichunkaccess);
-@@ -311,7 +341,6 @@
+@@ -355,7 +385,6 @@
}
}
@@ -73,7 +73,7 @@
protected void unloadChunks(BooleanSupplier booleansupplier) {
GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
-@@ -350,7 +379,7 @@
+@@ -394,7 +423,7 @@
private void a(long i, PlayerChunk playerchunk) {
CompletableFuture completablefuture = playerchunk.getChunkSave();
@@ -82,13 +82,13 @@
CompletableFuture completablefuture1 = playerchunk.getChunkSave();
if (completablefuture1 != completablefuture) {
-@@ -572,8 +601,15 @@
+@@ -616,8 +645,15 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
+ // CraftBukkit start - these are spawned serialized (DefinedStructure) and we don't call an add event below at the moment due to ordering complexities
+ boolean needsRemoval = false;
-+ if (chunk.needsDecoration && !this.world.getServer().getServer().getSpawnNPCs() && entity instanceof NPC) {
++ if (chunk.needsDecoration && !this.world.getServer().getServer().getSpawnNPCs() && entity instanceof net.minecraft.world.entity.npc.NPC) {
+ entity.die();
+ needsRemoval = true;
+ }
@@ -99,7 +99,7 @@
if (list == null) {
list = Lists.newArrayList(new Entity[]{entity});
} else {
-@@ -784,7 +820,8 @@
+@@ -828,7 +864,8 @@
return ichunkaccess instanceof Chunk ? Optional.of((Chunk) ichunkaccess) : Optional.empty();
});
@@ -109,7 +109,7 @@
return Stream.of(chunk.getEntitySlices()).mapToInt(EntitySlice::size).sum();
}).orElse(0), optional1.map((chunk) -> {
return chunk.getTileEntities().size();
-@@ -795,7 +832,7 @@
+@@ -839,7 +876,7 @@
private static String a(CompletableFuture> completablefuture) {
try {
@@ -118,7 +118,7 @@
return either != null ? (String) either.map((chunk) -> {
return "done";
-@@ -813,7 +850,7 @@
+@@ -857,7 +894,7 @@
private NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException {
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
@@ -127,7 +127,7 @@
}
boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) {
-@@ -1145,7 +1182,7 @@
+@@ -1189,7 +1226,7 @@
public final Set trackedPlayers = Sets.newHashSet();
public EntityTracker(Entity entity, int i, int j, boolean flag) {
@@ -136,7 +136,7 @@
this.tracker = entity;
this.trackingDistance = i;
this.e = SectionPosition.a(entity);
-@@ -1198,7 +1235,7 @@
+@@ -1242,7 +1279,7 @@
public void updatePlayer(EntityPlayer entityplayer) {
if (entityplayer != this.tracker) {
@@ -145,7 +145,7 @@
int i = Math.min(this.b(), (PlayerChunkMap.this.viewDistance - 1) * 16);
boolean flag = vec3d.x >= (double) (-i) && vec3d.x <= (double) i && vec3d.z >= (double) (-i) && vec3d.z <= (double) i && this.tracker.a(entityplayer);
-@@ -1214,6 +1251,17 @@
+@@ -1258,6 +1295,17 @@
}
}
diff --git a/nms-patches/net/minecraft/server/level/PlayerInteractManager.patch b/nms-patches/net/minecraft/server/level/PlayerInteractManager.patch
index 9f3df6c0c..07c48f581 100644
--- a/nms-patches/net/minecraft/server/level/PlayerInteractManager.patch
+++ b/nms-patches/net/minecraft/server/level/PlayerInteractManager.patch
@@ -1,11 +1,19 @@
---- a/net/minecraft/server/PlayerInteractManager.java
-+++ b/net/minecraft/server/PlayerInteractManager.java
-@@ -4,6 +4,16 @@
+--- a/net/minecraft/server/level/PlayerInteractManager.java
++++ b/net/minecraft/server/level/PlayerInteractManager.java
+@@ -26,6 +26,24 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import java.util.ArrayList;
++import net.minecraft.network.protocol.game.PacketPlayOutBlockChange;
++import net.minecraft.server.MinecraftServer;
++import net.minecraft.world.entity.EnumItemSlot;
++import net.minecraft.world.level.block.BlockCake;
++import net.minecraft.world.level.block.BlockDoor;
++import net.minecraft.world.level.block.BlockTrapdoor;
++import net.minecraft.world.level.block.Blocks;
++import net.minecraft.world.level.block.state.properties.BlockPropertyDoubleBlockHalf;
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.event.block.BlockBreakEvent;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -17,7 +25,7 @@
public class PlayerInteractManager {
private static final Logger LOGGER = LogManager.getLogger();
-@@ -38,7 +48,7 @@
+@@ -60,7 +78,7 @@
this.gamemode = enumgamemode;
enumgamemode.a(this.player.abilities);
this.player.updateAbilities();
@@ -26,7 +34,7 @@
this.world.everyoneSleeping();
}
-@@ -67,7 +77,7 @@
+@@ -89,7 +107,7 @@
}
public void a() {
@@ -35,7 +43,7 @@
IBlockData iblockdata;
if (this.j) {
-@@ -123,9 +133,31 @@
+@@ -145,9 +163,31 @@
if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.START_DESTROY_BLOCK) {
if (!this.world.a((EntityHuman) this.player, blockposition)) {
@@ -67,7 +75,7 @@
if (this.isCreative()) {
this.a(blockposition, packetplayinblockdig_enumplayerdigtype, "creative destroy");
-@@ -141,11 +173,43 @@
+@@ -163,11 +203,43 @@
float f = 1.0F;
iblockdata = this.world.getType(blockposition);
@@ -112,7 +120,7 @@
if (!iblockdata.isAir() && f >= 1.0F) {
this.a(blockposition, packetplayinblockdig_enumplayerdigtype, "insta mine");
} else {
-@@ -189,7 +253,7 @@
+@@ -211,7 +283,7 @@
} else if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.ABORT_DESTROY_BLOCK) {
this.f = false;
if (!Objects.equals(this.h, blockposition)) {
@@ -121,7 +129,7 @@
this.world.a(this.player.getId(), this.h, -1);
this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(this.h, this.world.getType(this.h), packetplayinblockdig_enumplayerdigtype, true, "aborted mismatched destroying"));
}
-@@ -205,17 +269,73 @@
+@@ -227,17 +299,73 @@
if (this.breakBlock(blockposition)) {
this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, true, s));
} else {
@@ -197,7 +205,7 @@
TileEntity tileentity = this.world.getTileEntity(blockposition);
Block block = iblockdata.getBlock();
-@@ -225,6 +345,10 @@
+@@ -247,6 +375,10 @@
} else if (this.player.a((World) this.world, blockposition, this.gamemode)) {
return false;
} else {
@@ -208,7 +216,7 @@
block.a((World) this.world, blockposition, iblockdata, (EntityHuman) this.player);
boolean flag = this.world.a(blockposition, false);
-@@ -233,19 +357,32 @@
+@@ -255,19 +387,32 @@
}
if (this.isCreative()) {
@@ -244,7 +252,7 @@
}
}
}
-@@ -287,12 +424,46 @@
+@@ -309,12 +454,46 @@
}
}
@@ -291,7 +299,7 @@
if (itileinventory != null) {
entityplayer.openContainer(itileinventory);
-@@ -306,7 +477,7 @@
+@@ -328,7 +507,7 @@
ItemStack itemstack1 = itemstack.cloneItemStack();
if (!flag1) {
@@ -300,7 +308,7 @@
if (enuminteractionresult.a()) {
CriterionTriggers.M.a(entityplayer, blockposition, itemstack1);
-@@ -314,17 +485,17 @@
+@@ -336,17 +515,17 @@
}
}
@@ -321,7 +329,7 @@
}
if (enuminteractionresult1.a()) {
-@@ -332,10 +503,10 @@
+@@ -354,10 +533,10 @@
}
return enuminteractionresult1;
diff --git a/nms-patches/net/minecraft/server/level/RegionLimitedWorldAccess.patch b/nms-patches/net/minecraft/server/level/RegionLimitedWorldAccess.patch
index 27a411c78..165d4e0b8 100644
--- a/nms-patches/net/minecraft/server/level/RegionLimitedWorldAccess.patch
+++ b/nms-patches/net/minecraft/server/level/RegionLimitedWorldAccess.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/RegionLimitedWorldAccess.java
-+++ b/net/minecraft/server/RegionLimitedWorldAccess.java
-@@ -236,6 +236,13 @@
+--- a/net/minecraft/server/level/RegionLimitedWorldAccess.java
++++ b/net/minecraft/server/level/RegionLimitedWorldAccess.java
+@@ -273,6 +273,13 @@
@Override
public boolean addEntity(Entity entity) {
diff --git a/nms-patches/net/minecraft/server/level/TicketType.patch b/nms-patches/net/minecraft/server/level/TicketType.patch
index 16efb14d3..9a4be5c15 100644
--- a/nms-patches/net/minecraft/server/level/TicketType.patch
+++ b/nms-patches/net/minecraft/server/level/TicketType.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/TicketType.java
-+++ b/net/minecraft/server/TicketType.java
-@@ -19,6 +19,8 @@
+--- a/net/minecraft/server/level/TicketType.java
++++ b/net/minecraft/server/level/TicketType.java
+@@ -23,6 +23,8 @@
public static final TicketType PORTAL = a("portal", BaseBlockPosition::compareTo, 300);
public static final TicketType POST_TELEPORT = a("post_teleport", Integer::compareTo, 5);
public static final TicketType UNKNOWN = a("unknown", Comparator.comparingLong(ChunkCoordIntPair::pair), 1);
diff --git a/nms-patches/net/minecraft/server/level/WorldServer.patch b/nms-patches/net/minecraft/server/level/WorldServer.patch
index b1baf9aec..d6259ef0b 100644
--- a/nms-patches/net/minecraft/server/level/WorldServer.patch
+++ b/nms-patches/net/minecraft/server/level/WorldServer.patch
@@ -1,11 +1,14 @@
---- a/net/minecraft/server/WorldServer.java
-+++ b/net/minecraft/server/WorldServer.java
-@@ -39,6 +39,18 @@
+--- a/net/minecraft/server/level/WorldServer.java
++++ b/net/minecraft/server/level/WorldServer.java
+@@ -145,6 +145,21 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import java.util.logging.Level;
++import net.minecraft.world.entity.monster.EntityDrowned;
++import net.minecraft.world.level.block.ITileEntity;
++import net.minecraft.world.level.storage.WorldDataServer;
+import org.bukkit.Bukkit;
+import org.bukkit.WeatherType;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -19,7 +22,7 @@
public class WorldServer extends World implements GeneratorAccessSeed {
public static final BlockPosition a = new BlockPosition(100, 50, 0);
-@@ -50,7 +62,7 @@
+@@ -156,7 +171,7 @@
private final ChunkProviderServer chunkProvider;
boolean tickingEntities;
private final MinecraftServer server;
@@ -28,7 +31,7 @@
public boolean savingDisabled;
private boolean everyoneSleeping;
private int emptyTime;
-@@ -67,8 +79,23 @@
+@@ -173,8 +188,23 @@
private final StructureManager structureManager;
private final boolean Q;
@@ -54,7 +57,7 @@
this.nextTickListBlock = new TickListServer<>(this, (block) -> {
return block == null || block.getBlockData().isAir();
}, IRegistry.BLOCK::getKey, this::b);
-@@ -80,10 +107,17 @@
+@@ -186,10 +216,17 @@
this.Q = flag1;
this.server = minecraftserver;
this.mobSpawners = list;
@@ -73,7 +76,7 @@
this.portalTravelAgent = new PortalTravelAgent(this);
this.Q();
this.R();
-@@ -95,14 +129,48 @@
+@@ -201,14 +238,48 @@
iworlddataserver.setGameType(minecraftserver.getGamemode());
}
@@ -90,7 +93,7 @@
+
+ // CraftBukkit start
+ @Override
-+ protected TileEntity getTileEntity(BlockPosition pos, boolean validate) {
++ public TileEntity getTileEntity(BlockPosition pos, boolean validate) {
+ TileEntity result = super.getTileEntity(pos, validate);
+ if (!validate || Thread.currentThread() != this.serverThread) {
+ // SPIGOT-5378: avoid deadlock, this can be called in loading logic (i.e lighting) but getType() will block on chunk load
@@ -113,7 +116,7 @@
+
+ if (type instanceof ITileEntity) {
+ TileEntity replacement = ((ITileEntity) type).createTile(this);
-+ replacement.world = this;
++ replacement.setLocation(this, pos);
+ this.setTileEntity(pos, replacement);
+ return replacement;
+ } else {
@@ -124,7 +127,7 @@
public void a(int i, int j, boolean flag, boolean flag1) {
this.worldDataServer.setClearWeatherTime(i);
-@@ -193,6 +261,7 @@
+@@ -299,6 +370,7 @@
this.rainLevel = MathHelper.a(this.rainLevel, 0.0F, 1.0F);
}
@@ -132,7 +135,7 @@
if (this.lastRainLevel != this.rainLevel) {
this.server.getPlayerList().a((Packet) (new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.h, this.rainLevel)), this.getDimensionKey());
}
-@@ -211,18 +280,47 @@
+@@ -317,18 +389,47 @@
this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.h, this.rainLevel));
this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.i, this.thunderLevel));
}
@@ -185,7 +188,7 @@
if (this.getGameRules().getBoolean(GameRules.DO_WEATHER_CYCLE)) {
this.clearWeather();
}
-@@ -244,7 +342,7 @@
+@@ -350,7 +451,7 @@
this.ak();
this.ticking = false;
gameprofilerfiller.exitEnter("entities");
@@ -194,7 +197,7 @@
if (flag3) {
this.resetEmptyTime();
-@@ -263,6 +361,7 @@
+@@ -369,6 +470,7 @@
Entity entity = (Entity) entry.getValue();
Entity entity1 = entity.getVehicle();
@@ -202,7 +205,7 @@
if (!this.server.getSpawnAnimals() && (entity instanceof EntityAnimal || entity instanceof EntityWaterAnimal)) {
entity.die();
}
-@@ -270,6 +369,7 @@
+@@ -376,6 +478,7 @@
if (!this.server.getSpawnNPCs() && entity instanceof NPC) {
entity.die();
}
@@ -210,7 +213,7 @@
gameprofilerfiller.enter("checkDespawn");
if (!entity.dead) {
-@@ -344,7 +444,7 @@
+@@ -450,7 +553,7 @@
}
private void wakeupPlayers() {
@@ -219,7 +222,7 @@
entityplayer.wakeup(false, false);
});
}
-@@ -371,14 +471,14 @@
+@@ -477,14 +580,14 @@
entityhorseskeleton.t(true);
entityhorseskeleton.setAgeRaw(0);
entityhorseskeleton.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
@@ -236,7 +239,7 @@
}
}
-@@ -389,11 +489,11 @@
+@@ -495,11 +598,11 @@
BiomeBase biomebase = this.getBiome(blockposition);
if (biomebase.a(this, blockposition1)) {
@@ -250,7 +253,7 @@
}
if (flag && this.getBiome(blockposition1).c() == BiomeBase.Precipitation.RAIN) {
-@@ -440,7 +540,7 @@
+@@ -546,7 +649,7 @@
protected BlockPosition a(BlockPosition blockposition) {
BlockPosition blockposition1 = this.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, blockposition);
AxisAlignedBB axisalignedbb = (new AxisAlignedBB(blockposition1, new BlockPosition(blockposition1.getX(), this.getBuildHeight(), blockposition1.getZ()))).g(3.0D);
@@ -259,7 +262,7 @@
return entityliving != null && entityliving.isAlive() && this.e(entityliving.getChunkCoordinates());
});
-@@ -469,7 +569,7 @@
+@@ -575,7 +678,7 @@
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
@@ -268,7 +271,7 @@
++i;
} else if (entityplayer.isSleeping()) {
++j;
-@@ -487,10 +587,22 @@
+@@ -593,10 +696,22 @@
}
private void clearWeather() {
@@ -293,7 +296,7 @@
}
public void resetEmptyTime() {
-@@ -531,6 +643,7 @@
+@@ -637,6 +752,7 @@
});
gameprofilerfiller.c("tickNonPassenger");
entity.tick();
@@ -301,7 +304,7 @@
gameprofilerfiller.exit();
}
-@@ -563,6 +676,7 @@
+@@ -669,6 +785,7 @@
});
gameprofilerfiller.c("tickPassenger");
entity1.passengerTick();
@@ -309,7 +312,7 @@
gameprofilerfiller.exit();
}
-@@ -619,6 +733,7 @@
+@@ -725,6 +842,7 @@
ChunkProviderServer chunkproviderserver = this.getChunkProvider();
if (!flag1) {
@@ -317,7 +320,7 @@
if (iprogressupdate != null) {
iprogressupdate.a(new ChatMessage("menu.savingLevel"));
}
-@@ -630,11 +745,19 @@
+@@ -736,11 +854,19 @@
chunkproviderserver.save(flag);
}
@@ -338,7 +341,7 @@
}
this.getChunkProvider().getWorldPersistentData().a();
-@@ -695,11 +818,24 @@
+@@ -801,11 +927,24 @@
@Override
public boolean addEntity(Entity entity) {
@@ -365,7 +368,7 @@
}
public void addEntityTeleport(Entity entity) {
-@@ -749,13 +885,18 @@
+@@ -855,13 +994,18 @@
this.registerEntity(entityplayer);
}
@@ -386,7 +389,7 @@
IChunkAccess ichunkaccess = this.getChunkAt(MathHelper.floor(entity.locX() / 16.0D), MathHelper.floor(entity.locZ() / 16.0D), ChunkStatus.FULL, entity.attachedToPlayer);
if (!(ichunkaccess instanceof Chunk)) {
-@@ -784,7 +925,7 @@
+@@ -890,7 +1034,7 @@
if (entity1 == null) {
return false;
} else {
@@ -395,7 +398,7 @@
return true;
}
}
-@@ -813,10 +954,16 @@
+@@ -919,10 +1063,16 @@
}
public boolean addAllEntitiesSafely(Entity entity) {
@@ -413,7 +416,7 @@
return true;
}
}
-@@ -867,10 +1014,17 @@
+@@ -973,10 +1123,17 @@
}
this.getScoreboard().a(entity);
@@ -431,7 +434,7 @@
}
private void registerEntity(Entity entity) {
-@@ -891,9 +1045,16 @@
+@@ -997,9 +1154,16 @@
this.entitiesByUUID.put(entity.getUniqueID(), entity);
this.getChunkProvider().addEntity(entity);
@@ -448,7 +451,7 @@
}
}
-@@ -909,7 +1070,7 @@
+@@ -1015,7 +1179,7 @@
}
private void removeEntityFromChunk(Entity entity) {
@@ -457,7 +460,7 @@
if (ichunkaccess instanceof Chunk) {
((Chunk) ichunkaccess).b(entity);
-@@ -923,10 +1084,33 @@
+@@ -1029,10 +1193,33 @@
this.everyoneSleeping();
}
@@ -491,7 +494,7 @@
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
-@@ -935,6 +1119,12 @@
+@@ -1041,6 +1228,12 @@
double d1 = (double) blockposition.getY() - entityplayer.locY();
double d2 = (double) blockposition.getZ() - entityplayer.locZ();
@@ -504,7 +507,7 @@
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {
entityplayer.playerConnection.sendPacket(new PacketPlayOutBlockBreakAnimation(i, blockposition, j));
}
-@@ -973,7 +1163,18 @@
+@@ -1079,7 +1272,18 @@
Iterator iterator = this.navigators.iterator();
while (iterator.hasNext()) {
@@ -524,7 +527,7 @@
if (!navigationabstract.i()) {
navigationabstract.b(blockposition);
-@@ -995,10 +1196,20 @@
+@@ -1101,10 +1305,20 @@
@Override
public Explosion createExplosion(@Nullable Entity entity, @Nullable DamageSource damagesource, @Nullable ExplosionDamageCalculator explosiondamagecalculator, double d0, double d1, double d2, float f, boolean flag, Explosion.Effect explosion_effect) {
@@ -545,7 +548,7 @@
if (explosion_effect == Explosion.Effect.NONE) {
explosion.clearBlocks();
}
-@@ -1063,13 +1274,20 @@
+@@ -1169,13 +1383,20 @@
}
public int a(T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) {
@@ -568,7 +571,7 @@
++j;
}
}
-@@ -1111,7 +1329,7 @@
+@@ -1217,7 +1438,7 @@
@Nullable
public BlockPosition a(StructureGenerator> structuregenerator, BlockPosition blockposition, int i, boolean flag) {
@@ -577,7 +580,7 @@
}
@Nullable
-@@ -1149,7 +1367,13 @@
+@@ -1255,7 +1476,13 @@
@Override
public WorldMap a(String s) {
return (WorldMap) this.getMinecraftServer().E().getWorldPersistentData().b(() -> {
@@ -592,7 +595,61 @@
}, s);
}
-@@ -1460,6 +1684,11 @@
+@@ -1386,9 +1613,9 @@
+ reputationhandler.a(reputationevent, entity);
+ }
+
+- public void a(Path path) throws IOException {
++ public void a(java.nio.file.Path java_nio_file_path) throws IOException {
+ PlayerChunkMap playerchunkmap = this.getChunkProvider().playerChunkMap;
+- BufferedWriter bufferedwriter = Files.newBufferedWriter(path.resolve("stats.txt"));
++ BufferedWriter bufferedwriter = Files.newBufferedWriter(java_nio_file_path.resolve("stats.txt"));
+ Throwable throwable = null;
+
+ try {
+@@ -1432,7 +1659,7 @@
+ CrashReport crashreport = new CrashReport("Level dump", new Exception("dummy"));
+
+ this.a(crashreport);
+- BufferedWriter bufferedwriter1 = Files.newBufferedWriter(path.resolve("example_crash.txt"));
++ BufferedWriter bufferedwriter1 = Files.newBufferedWriter(java_nio_file_path.resolve("example_crash.txt"));
+ Throwable throwable3 = null;
+
+ try {
+@@ -1455,8 +1682,8 @@
+
+ }
+
+- Path path1 = path.resolve("chunks.csv");
+- BufferedWriter bufferedwriter2 = Files.newBufferedWriter(path1);
++ java.nio.file.Path java_nio_file_path1 = java_nio_file_path.resolve("chunks.csv");
++ BufferedWriter bufferedwriter2 = Files.newBufferedWriter(java_nio_file_path1);
+ Throwable throwable6 = null;
+
+ try {
+@@ -1479,8 +1706,8 @@
+
+ }
+
+- Path path2 = path.resolve("entities.csv");
+- BufferedWriter bufferedwriter3 = Files.newBufferedWriter(path2);
++ java.nio.file.Path java_nio_file_path2 = java_nio_file_path.resolve("entities.csv");
++ BufferedWriter bufferedwriter3 = Files.newBufferedWriter(java_nio_file_path2);
+ Throwable throwable9 = null;
+
+ try {
+@@ -1503,8 +1730,8 @@
+
+ }
+
+- Path path3 = path.resolve("block_entities.csv");
+- BufferedWriter bufferedwriter4 = Files.newBufferedWriter(path3);
++ java.nio.file.Path java_nio_file_path3 = java_nio_file_path.resolve("block_entities.csv");
++ BufferedWriter bufferedwriter4 = Files.newBufferedWriter(java_nio_file_path3);
+ Throwable throwable12 = null;
+
+ try {
+@@ -1566,6 +1793,11 @@
@Override
public void update(BlockPosition blockposition, Block block) {
if (!this.isDebugWorld()) {
@@ -604,7 +661,7 @@
this.applyPhysics(blockposition, block);
}
-@@ -1474,12 +1703,12 @@
+@@ -1580,12 +1812,12 @@
}
public boolean isFlatWorld() {
@@ -619,7 +676,7 @@
}
@Nullable
-@@ -1499,9 +1728,9 @@
+@@ -1605,9 +1837,9 @@
@VisibleForTesting
public String F() {
@@ -631,7 +688,7 @@
return IRegistry.BLOCK_ENTITY_TYPE.getKey(tileentity.getTileType());
}), this.getBlockTickList().a(), this.getFluidTickList().a(), this.P());
}
-@@ -1509,7 +1738,7 @@
+@@ -1615,7 +1847,7 @@
private static String a(Collection collection, Function function) {
try {
Object2IntOpenHashMap object2intopenhashmap = new Object2IntOpenHashMap();
@@ -640,7 +697,7 @@
while (iterator.hasNext()) {
T t0 = iterator.next();
-@@ -1518,7 +1747,8 @@
+@@ -1624,7 +1856,8 @@
object2intopenhashmap.addTo(minecraftkey, 1);
}
@@ -650,7 +707,7 @@
return it_unimi_dsi_fastutil_objects_object2intmap_entry.getKey() + ":" + it_unimi_dsi_fastutil_objects_object2intmap_entry.getIntValue();
}).collect(Collectors.joining(","));
} catch (Exception exception) {
-@@ -1527,16 +1757,32 @@
+@@ -1633,16 +1866,32 @@
}
public static void a(WorldServer worldserver) {
diff --git a/nms-patches/net/minecraft/server/network/HandshakeListener.patch b/nms-patches/net/minecraft/server/network/HandshakeListener.patch
index f05d80a5a..4aa5a4bf7 100644
--- a/nms-patches/net/minecraft/server/network/HandshakeListener.patch
+++ b/nms-patches/net/minecraft/server/network/HandshakeListener.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/HandshakeListener.java
-+++ b/net/minecraft/server/HandshakeListener.java
-@@ -1,7 +1,16 @@
- package net.minecraft.server;
+--- a/net/minecraft/server/network/HandshakeListener.java
++++ b/net/minecraft/server/network/HandshakeListener.java
+@@ -11,8 +11,17 @@
+ import net.minecraft.network.protocol.login.PacketLoginOutDisconnect;
+ import net.minecraft.server.MinecraftServer;
+// CraftBukkit start
+import java.net.InetAddress;
@@ -17,7 +18,7 @@
private static final IChatBaseComponent a = new ChatComponentText("Ignoring status request");
private final MinecraftServer b;
private final NetworkManager c;
-@@ -16,6 +25,40 @@
+@@ -27,6 +36,40 @@
switch (packethandshakinginsetprotocol.b()) {
case LOGIN:
this.c.setProtocol(EnumProtocol.LOGIN);
@@ -58,7 +59,7 @@
if (packethandshakinginsetprotocol.c() != SharedConstants.getGameVersion().getProtocolVersion()) {
ChatMessage chatmessage;
-@@ -29,6 +72,7 @@
+@@ -40,6 +83,7 @@
this.c.close(chatmessage);
} else {
this.c.setPacketListener(new LoginListener(this.b, this.c));
diff --git a/nms-patches/net/minecraft/server/network/LegacyPingHandler.patch b/nms-patches/net/minecraft/server/network/LegacyPingHandler.patch
index b56969813..e611d0c98 100644
--- a/nms-patches/net/minecraft/server/network/LegacyPingHandler.patch
+++ b/nms-patches/net/minecraft/server/network/LegacyPingHandler.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/LegacyPingHandler.java
-+++ b/net/minecraft/server/LegacyPingHandler.java
-@@ -34,11 +34,12 @@
+--- a/net/minecraft/server/network/LegacyPingHandler.java
++++ b/net/minecraft/server/network/LegacyPingHandler.java
+@@ -35,11 +35,12 @@
MinecraftServer minecraftserver = this.b.d();
int i = bytebuf.readableBytes();
String s;
@@ -14,7 +14,7 @@
this.a(channelhandlercontext, this.a(s));
break;
case 1:
-@@ -47,7 +48,7 @@
+@@ -48,7 +49,7 @@
}
LegacyPingHandler.LOGGER.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort());
@@ -23,7 +23,7 @@
this.a(channelhandlercontext, this.a(s));
break;
default:
-@@ -66,7 +67,7 @@
+@@ -67,7 +68,7 @@
}
LegacyPingHandler.LOGGER.debug("Ping: (1.6) from {}:{}", inetsocketaddress.getAddress(), inetsocketaddress.getPort());
diff --git a/nms-patches/net/minecraft/server/network/LoginListener.patch b/nms-patches/net/minecraft/server/network/LoginListener.patch
index 5fa8454f9..ee14ed5ea 100644
--- a/nms-patches/net/minecraft/server/network/LoginListener.patch
+++ b/nms-patches/net/minecraft/server/network/LoginListener.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/LoginListener.java
-+++ b/net/minecraft/server/LoginListener.java
-@@ -18,6 +18,12 @@
+--- a/net/minecraft/server/network/LoginListener.java
++++ b/net/minecraft/server/network/LoginListener.java
+@@ -35,6 +35,13 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
++import net.minecraft.network.chat.ChatComponentText;
+import org.bukkit.craftbukkit.util.Waitable;
+import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
+import org.bukkit.event.player.PlayerPreLoginEvent;
@@ -13,7 +14,7 @@
public class LoginListener implements PacketLoginInListener {
private static final AtomicInteger b = new AtomicInteger(0);
-@@ -32,6 +38,7 @@
+@@ -49,6 +56,7 @@
private final String j;
private SecretKey loginKey;
private EntityPlayer l;
@@ -21,7 +22,7 @@
public LoginListener(MinecraftServer minecraftserver, NetworkManager networkmanager) {
this.g = LoginListener.EnumProtocolState.HELLO;
-@@ -60,6 +67,20 @@
+@@ -77,6 +85,20 @@
}
@@ -42,7 +43,7 @@
@Override
public NetworkManager a() {
return this.networkManager;
-@@ -81,10 +102,12 @@
+@@ -98,10 +120,12 @@
this.i = this.a(this.i);
}
@@ -58,7 +59,7 @@
} else {
this.g = LoginListener.EnumProtocolState.ACCEPTED;
if (this.server.ax() >= 0 && !this.networkManager.isLocal()) {
-@@ -98,9 +121,9 @@
+@@ -115,9 +139,9 @@
if (entityplayer != null) {
this.g = LoginListener.EnumProtocolState.DELAY_ACCEPT;
@@ -70,7 +71,7 @@
}
}
-@@ -158,6 +181,43 @@
+@@ -175,6 +199,43 @@
try {
LoginListener.this.i = LoginListener.this.server.getMinecraftSessionService().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s, this.a());
if (LoginListener.this.i != null) {
@@ -114,7 +115,7 @@
LoginListener.LOGGER.info("UUID of player {} is {}", LoginListener.this.i.getName(), LoginListener.this.i.getId());
LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
} else if (LoginListener.this.server.isEmbeddedServer()) {
-@@ -177,6 +237,11 @@
+@@ -194,6 +255,11 @@
LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down"));
LoginListener.LOGGER.error("Couldn't verify username because servers are unavailable");
}
diff --git a/nms-patches/net/minecraft/server/network/PacketStatusListener.patch b/nms-patches/net/minecraft/server/network/PacketStatusListener.patch
index d93eee81f..eee161284 100644
--- a/nms-patches/net/minecraft/server/network/PacketStatusListener.patch
+++ b/nms-patches/net/minecraft/server/network/PacketStatusListener.patch
@@ -1,12 +1,16 @@
---- a/net/minecraft/server/PacketStatusListener.java
-+++ b/net/minecraft/server/PacketStatusListener.java
-@@ -1,5 +1,14 @@
- package net.minecraft.server;
+--- a/net/minecraft/server/network/PacketStatusListener.java
++++ b/net/minecraft/server/network/PacketStatusListener.java
+@@ -10,6 +10,18 @@
+ import net.minecraft.network.protocol.status.PacketStatusOutServerInfo;
+ import net.minecraft.server.MinecraftServer;
+// CraftBukkit start
+import com.mojang.authlib.GameProfile;
+import java.net.InetSocketAddress;
+import java.util.Iterator;
++import net.minecraft.SharedConstants;
++import net.minecraft.network.protocol.status.ServerPing;
++import net.minecraft.server.level.EntityPlayer;
+import org.bukkit.craftbukkit.util.CraftChatMessage;
+import org.bukkit.craftbukkit.util.CraftIconCache;
+import org.bukkit.entity.Player;
@@ -15,7 +19,7 @@
public class PacketStatusListener implements PacketStatusInListener {
private static final IChatBaseComponent a = new ChatMessage("multiplayer.status.request_handled");
-@@ -26,8 +35,96 @@
+@@ -36,8 +48,96 @@
this.networkManager.close(PacketStatusListener.a);
} else {
this.d = true;
diff --git a/nms-patches/net/minecraft/server/network/PlayerConnection.patch b/nms-patches/net/minecraft/server/network/PlayerConnection.patch
index 3a27fa503..51cfdc427 100644
--- a/nms-patches/net/minecraft/server/network/PlayerConnection.patch
+++ b/nms-patches/net/minecraft/server/network/PlayerConnection.patch
@@ -1,12 +1,23 @@
---- a/net/minecraft/server/PlayerConnection.java
-+++ b/net/minecraft/server/PlayerConnection.java
-@@ -24,6 +24,48 @@
+--- a/net/minecraft/server/network/PlayerConnection.java
++++ b/net/minecraft/server/network/PlayerConnection.java
+@@ -158,6 +158,59 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
++import net.minecraft.network.protocol.game.PacketPlayOutAttachEntity;
++import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
++import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntityLiving;
++import net.minecraft.network.protocol.game.PacketPlayOutSpawnPosition;
++import net.minecraft.util.MathHelper;
++import net.minecraft.world.entity.EntityInsentient;
++import net.minecraft.world.entity.animal.EntityFish;
++import net.minecraft.world.inventory.InventoryClickType;
++import net.minecraft.world.item.crafting.IRecipe;
++import net.minecraft.world.level.RayTrace;
++import net.minecraft.world.phys.MovingObjectPosition;
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.entity.CraftPlayer;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -49,7 +60,7 @@
public class PlayerConnection implements PacketListenerPlayIn {
private static final Logger LOGGER = LogManager.getLogger();
-@@ -34,7 +76,10 @@
+@@ -168,7 +221,10 @@
private long lastKeepAlive;
private boolean awaitingKeepAlive;
private long h;
@@ -61,7 +72,7 @@
private int j;
private final Int2ShortMap k = new Int2ShortOpenHashMap();
private double l;
-@@ -72,8 +117,33 @@
+@@ -206,8 +262,33 @@
itextfilter.a();
}
@@ -95,7 +106,7 @@
public void tick() {
this.syncPosition();
this.player.lastX = this.player.locX();
-@@ -121,7 +191,7 @@
+@@ -255,7 +336,7 @@
this.minecraftServer.getMethodProfiler().enter("keepAlive");
long i = SystemUtils.getMonotonicMillis();
@@ -104,7 +115,7 @@
if (this.awaitingKeepAlive) {
this.disconnect(new ChatMessage("disconnect.timeout"));
} else {
-@@ -133,15 +203,21 @@
+@@ -267,15 +348,21 @@
}
this.minecraftServer.getMethodProfiler().exit();
@@ -126,7 +137,7 @@
this.disconnect(new ChatMessage("multiplayer.disconnect.idling"));
}
-@@ -165,16 +241,46 @@
+@@ -299,16 +386,46 @@
return this.minecraftServer.a(this.player.getProfile());
}
@@ -174,7 +185,7 @@
}
private void a(T t0, Consumer consumer, BiFunction>> bifunction) {
-@@ -190,7 +296,7 @@
+@@ -324,7 +441,7 @@
ITextFilter itextfilter = this.player.Q();
if (itextfilter != null) {
@@ -183,7 +194,7 @@
optional.ifPresent(consumer1);
}, iasynctaskhandler);
} else {
-@@ -247,7 +353,34 @@
+@@ -381,7 +498,34 @@
double d9 = entity.getMot().g();
double d10 = d6 * d6 + d7 * d7 + d8 * d8;
@@ -219,7 +230,7 @@
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), d6, d7, d8);
this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity));
return;
-@@ -277,14 +410,72 @@
+@@ -411,14 +555,72 @@
}
entity.setLocation(d3, d4, d5, f, f1);
@@ -292,7 +303,7 @@
this.player.getWorldServer().getChunkProvider().movePlayer(this.player);
this.player.checkMovement(this.player.locX() - d0, this.player.locY() - d1, this.player.locZ() - d2);
this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && this.a(entity);
-@@ -303,7 +494,7 @@
+@@ -437,7 +639,7 @@
@Override
public void a(PacketPlayInTeleportAccept packetplayinteleportaccept) {
PlayerConnectionUtils.ensureMainThread(packetplayinteleportaccept, this, this.player.getWorldServer());
@@ -301,7 +312,7 @@
this.player.setLocation(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
this.o = this.teleportPos.x;
this.p = this.teleportPos.y;
-@@ -313,6 +504,7 @@
+@@ -447,6 +649,7 @@
}
this.teleportPos = null;
@@ -309,7 +320,7 @@
}
}
-@@ -320,7 +512,7 @@
+@@ -454,7 +657,7 @@
@Override
public void a(PacketPlayInRecipeDisplayed packetplayinrecipedisplayed) {
PlayerConnectionUtils.ensureMainThread(packetplayinrecipedisplayed, this, this.player.getWorldServer());
@@ -318,7 +329,7 @@
RecipeBookServer recipebookserver = this.player.getRecipeBook();
optional.ifPresent(recipebookserver::e);
-@@ -349,6 +541,12 @@
+@@ -483,6 +686,12 @@
@Override
public void a(PacketPlayInTabComplete packetplayintabcomplete) {
PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer());
@@ -331,7 +342,7 @@
StringReader stringreader = new StringReader(packetplayintabcomplete.c());
if (stringreader.canRead() && stringreader.peek() == '/') {
-@@ -358,6 +556,7 @@
+@@ -492,6 +701,7 @@
ParseResults parseresults = this.minecraftServer.getCommandDispatcher().a().parse(stringreader, this.player.getCommandListener());
this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
@@ -339,7 +350,7 @@
this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), suggestions));
});
}
-@@ -586,6 +785,7 @@
+@@ -720,6 +930,7 @@
if (container instanceof ContainerMerchant) {
ContainerMerchant containermerchant = (ContainerMerchant) container;
@@ -347,7 +358,7 @@
containermerchant.d(i);
containermerchant.g(i);
-@@ -595,6 +795,13 @@
+@@ -729,6 +940,13 @@
@Override
public void a(PacketPlayInBEdit packetplayinbedit) {
@@ -361,7 +372,7 @@
ItemStack itemstack = packetplayinbedit.b();
if (itemstack.getItem() == Items.WRITABLE_BOOK) {
-@@ -610,13 +817,15 @@
+@@ -744,13 +962,15 @@
NBTTagList nbttaglist = nbttagcompound.getList("pages", 8);
@@ -380,7 +391,7 @@
if (PlayerInventory.d(i) || i == 40) {
this.a((List) list, flag ? (list1) -> {
this.a((String) list1.get(0), list1.subList(1, list1.size()), i);
-@@ -635,7 +844,9 @@
+@@ -769,7 +989,9 @@
NBTTagList nbttaglist = new NBTTagList();
list.stream().map(NBTTagString::a).forEach(nbttaglist::add);
@@ -390,7 +401,7 @@
}
}
-@@ -664,7 +875,7 @@
+@@ -798,7 +1020,7 @@
}
itemstack1.a("pages", (NBTBase) nbttaglist);
@@ -399,7 +410,7 @@
}
}
-@@ -702,7 +913,7 @@
+@@ -836,7 +1058,7 @@
} else {
WorldServer worldserver = this.player.getWorldServer();
@@ -408,7 +419,7 @@
if (this.e == 0) {
this.syncPosition();
}
-@@ -712,13 +923,21 @@
+@@ -846,13 +1068,21 @@
this.A = this.e;
this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch);
}
@@ -431,7 +442,7 @@
double d0 = this.player.locX();
double d1 = this.player.locY();
double d2 = this.player.locZ();
-@@ -743,15 +962,33 @@
+@@ -877,15 +1107,33 @@
++this.receivedMovePackets;
int i = this.receivedMovePackets - this.processedMovePackets;
@@ -467,7 +478,7 @@
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getDisplayName().getString(), d7, d8, d9);
this.a(this.player.locX(), this.player.locY(), this.player.locZ(), this.player.yaw, this.player.pitch);
return;
-@@ -770,6 +1007,7 @@
+@@ -904,6 +1152,7 @@
}
this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9));
@@ -475,7 +486,7 @@
double d12 = d8;
d7 = d4 - this.player.locX();
-@@ -791,10 +1029,74 @@
+@@ -925,10 +1174,74 @@
if (!this.player.noclip && !this.player.isSleeping() && (flag1 && worldserver.getCubes(this.player, axisalignedbb) || this.a((IWorldReader) worldserver, axisalignedbb))) {
this.a(d0, d1, d2, f, f1);
} else {
@@ -552,7 +563,7 @@
if (flag) {
this.player.fallDistance = 0.0F;
}
-@@ -823,10 +1125,66 @@
+@@ -957,10 +1270,66 @@
}
public void a(double d0, double d1, double d2, float f, float f1) {
@@ -620,7 +631,7 @@
double d3 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.X) ? this.player.locX() : 0.0D;
double d4 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Y) ? this.player.locY() : 0.0D;
double d5 = set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z) ? this.player.locZ() : 0.0D;
-@@ -838,6 +1196,14 @@
+@@ -972,6 +1341,14 @@
this.teleportAwait = 0;
}
@@ -635,7 +646,7 @@
this.A = this.e;
this.player.setLocation(d0, d1, d2, f, f1);
this.player.playerConnection.sendPacket(new PacketPlayOutPosition(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.teleportAwait));
-@@ -846,6 +1212,7 @@
+@@ -980,6 +1357,7 @@
@Override
public void a(PacketPlayInBlockDig packetplayinblockdig) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.getWorldServer());
@@ -643,7 +654,7 @@
BlockPosition blockposition = packetplayinblockdig.b();
this.player.resetIdleTimer();
-@@ -856,14 +1223,46 @@
+@@ -990,14 +1368,46 @@
if (!this.player.isSpectator()) {
ItemStack itemstack = this.player.b(EnumHand.OFF_HAND);
@@ -692,7 +703,7 @@
this.player.dropItem(false);
}
-@@ -900,6 +1299,7 @@
+@@ -1034,6 +1444,7 @@
@Override
public void a(PacketPlayInUseItem packetplayinuseitem) {
PlayerConnectionUtils.ensureMainThread(packetplayinuseitem, this, this.player.getWorldServer());
@@ -700,7 +711,7 @@
WorldServer worldserver = this.player.getWorldServer();
EnumHand enumhand = packetplayinuseitem.b();
ItemStack itemstack = this.player.b(enumhand);
-@@ -910,6 +1310,14 @@
+@@ -1044,6 +1455,14 @@
this.player.resetIdleTimer();
if (blockposition.getY() < this.minecraftServer.getMaxBuildHeight()) {
if (this.teleportPos == null && this.player.h((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.a((EntityHuman) this.player, blockposition)) {
@@ -715,7 +726,7 @@
EnumInteractionResult enuminteractionresult = this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);
if (enumdirection == EnumDirection.UP && !enuminteractionresult.a() && blockposition.getY() >= this.minecraftServer.getMaxBuildHeight() - 1 && a(this.player, itemstack)) {
-@@ -933,12 +1341,51 @@
+@@ -1067,12 +1486,51 @@
@Override
public void a(PacketPlayInBlockPlace packetplayinblockplace) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockplace, this, this.player.getWorldServer());
@@ -767,7 +778,7 @@
EnumInteractionResult enuminteractionresult = this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand);
if (enuminteractionresult.b()) {
-@@ -959,7 +1406,7 @@
+@@ -1093,7 +1551,7 @@
Entity entity = packetplayinspectate.a(worldserver);
if (entity != null) {
@@ -776,7 +787,7 @@
return;
}
}
-@@ -968,7 +1415,12 @@
+@@ -1102,7 +1560,12 @@
}
@Override
@@ -790,7 +801,7 @@
@Override
public void a(PacketPlayInBoatMove packetplayinboatmove) {
-@@ -983,11 +1435,26 @@
+@@ -1117,11 +1580,26 @@
@Override
public void a(IChatBaseComponent ichatbasecomponent) {
@@ -818,7 +829,7 @@
ITextFilter itextfilter = this.player.Q();
if (itextfilter != null) {
-@@ -1019,6 +1486,15 @@
+@@ -1153,6 +1631,15 @@
}
}
@@ -834,7 +845,7 @@
try {
this.networkManager.sendPacket(packet, genericfuturelistener);
} catch (Throwable throwable) {
-@@ -1035,7 +1511,16 @@
+@@ -1169,7 +1656,16 @@
@Override
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
PlayerConnectionUtils.ensureMainThread(packetplayinhelditemslot, this, this.player.getWorldServer());
@@ -851,7 +862,7 @@
if (this.player.inventory.itemInHandIndex != packetplayinhelditemslot.b() && this.player.getRaisedHand() == EnumHand.MAIN_HAND) {
this.player.clearActiveItem();
}
-@@ -1044,65 +1529,286 @@
+@@ -1178,65 +1674,286 @@
this.player.resetIdleTimer();
} else {
PlayerConnection.LOGGER.warn("{} tried to set an invalid carried item", this.player.getDisplayName().getString());
@@ -1147,7 +1158,7 @@
this.player.resetIdleTimer();
IJumpable ijumpable;
-@@ -1160,6 +1866,7 @@
+@@ -1294,6 +2011,7 @@
@Override
public void a(PacketPlayInUseEntity packetplayinuseentity) {
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.getWorldServer());
@@ -1155,7 +1166,7 @@
WorldServer worldserver = this.player.getWorldServer();
Entity entity = packetplayinuseentity.a((World) worldserver);
-@@ -1173,18 +1880,72 @@
+@@ -1307,18 +2025,72 @@
ItemStack itemstack = enumhand != null ? this.player.b(enumhand).cloneItemStack() : ItemStack.b;
Optional optional = Optional.empty();
@@ -1188,7 +1199,7 @@
+
+ if (event.isCancelled() || this.player.inventory.getItemInHand() == null || this.player.inventory.getItemInHand().getItem() != origItem) {
+ // Refresh the current entity metadata
-+ this.sendPacket(new PacketPlayOutEntityMetadata(entity.getId(), entity.datawatcher, true));
++ this.sendPacket(new PacketPlayOutEntityMetadata(entity.getId(), entity.getDataWatcher(), true));
+ }
+
+ if (event.isCancelled()) {
@@ -1229,7 +1240,7 @@
}
if (optional.isPresent() && ((EnumInteractionResult) optional.get()).a()) {
-@@ -1231,15 +1992,21 @@
+@@ -1365,15 +2137,21 @@
@Override
public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.getWorldServer());
@@ -1253,7 +1264,7 @@
NonNullList nonnulllist = NonNullList.a();
for (int i = 0; i < this.player.activeContainer.slots.size(); ++i) {
-@@ -1248,8 +2015,274 @@
+@@ -1382,8 +2160,274 @@
this.player.a(this.player.activeContainer, nonnulllist);
} else {
@@ -1529,7 +1540,7 @@
if (ItemStack.matches(packetplayinwindowclick.f(), itemstack)) {
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.b(), packetplayinwindowclick.e(), true));
this.player.e = true;
-@@ -1289,6 +2322,7 @@
+@@ -1423,6 +2467,7 @@
@Override
public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.getWorldServer());
@@ -1537,7 +1548,7 @@
this.player.resetIdleTimer();
if (this.player.activeContainer.windowId == packetplayinenchantitem.b() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
this.player.activeContainer.a((EntityHuman) this.player, packetplayinenchantitem.c());
-@@ -1321,6 +2355,43 @@
+@@ -1455,6 +2500,43 @@
boolean flag1 = packetplayinsetcreativeslot.b() >= 1 && packetplayinsetcreativeslot.b() <= 45;
boolean flag2 = itemstack.isEmpty() || itemstack.getDamage() >= 0 && itemstack.getCount() <= 64 && !itemstack.isEmpty();
@@ -1581,7 +1592,7 @@
if (flag1 && flag2) {
if (itemstack.isEmpty()) {
-@@ -1342,6 +2413,7 @@
+@@ -1476,6 +2558,7 @@
@Override
public void a(PacketPlayInTransaction packetplayintransaction) {
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.getWorldServer());
@@ -1589,7 +1600,7 @@
int i = this.player.activeContainer.windowId;
if (i == packetplayintransaction.b() && this.k.getOrDefault(i, (short) (packetplayintransaction.c() + 1)) == packetplayintransaction.c() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
-@@ -1360,6 +2432,7 @@
+@@ -1494,6 +2577,7 @@
}
private void a(PacketPlayInUpdateSign packetplayinupdatesign, List list) {
@@ -1597,7 +1608,7 @@
this.player.resetIdleTimer();
WorldServer worldserver = this.player.getWorldServer();
BlockPosition blockposition = packetplayinupdatesign.b();
-@@ -1376,12 +2449,28 @@
+@@ -1510,12 +2594,28 @@
if (!tileentitysign.d() || tileentitysign.f() != this.player) {
PlayerConnection.LOGGER.warn("Player {} just tried to change non-editable sign", this.player.getDisplayName().getString());
@@ -1627,7 +1638,7 @@
tileentitysign.update();
worldserver.notify(blockposition, iblockdata, iblockdata, 3);
-@@ -1391,6 +2480,7 @@
+@@ -1525,6 +2625,7 @@
@Override
public void a(PacketPlayInKeepAlive packetplayinkeepalive) {
@@ -1635,7 +1646,7 @@
if (this.awaitingKeepAlive && packetplayinkeepalive.b() == this.h) {
int i = (int) (SystemUtils.getMonotonicMillis() - this.lastKeepAlive);
-@@ -1405,7 +2495,17 @@
+@@ -1539,7 +2640,17 @@
@Override
public void a(PacketPlayInAbilities packetplayinabilities) {
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.getWorldServer());
@@ -1654,7 +1665,7 @@
}
@Override
-@@ -1414,8 +2514,50 @@
+@@ -1548,8 +2659,50 @@
this.player.a(packetplayinsettings);
}
diff --git a/nms-patches/net/minecraft/server/network/ServerConnection.patch b/nms-patches/net/minecraft/server/network/ServerConnection.patch
index 5d6f91bea..0aeabee45 100644
--- a/nms-patches/net/minecraft/server/network/ServerConnection.patch
+++ b/nms-patches/net/minecraft/server/network/ServerConnection.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ServerConnection.java
-+++ b/net/minecraft/server/ServerConnection.java
-@@ -74,14 +74,24 @@
+--- a/net/minecraft/server/network/ServerConnection.java
++++ b/net/minecraft/server/network/ServerConnection.java
+@@ -87,14 +87,24 @@
int j = ServerConnection.this.e.k();
Object object = j > 0 ? new NetworkManagerServer(j) : new NetworkManager(EnumProtocolDirection.SERVERBOUND);
diff --git a/nms-patches/net/minecraft/server/players/ExpirableListEntry.patch b/nms-patches/net/minecraft/server/players/ExpirableListEntry.patch
index 55b535098..49d534a97 100644
--- a/nms-patches/net/minecraft/server/players/ExpirableListEntry.patch
+++ b/nms-patches/net/minecraft/server/players/ExpirableListEntry.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ExpirableListEntry.java
-+++ b/net/minecraft/server/ExpirableListEntry.java
-@@ -23,7 +23,7 @@
+--- a/net/minecraft/server/players/ExpirableListEntry.java
++++ b/net/minecraft/server/players/ExpirableListEntry.java
+@@ -24,7 +24,7 @@
}
protected ExpirableListEntry(T t0, JsonObject jsonobject) {
@@ -9,7 +9,7 @@
Date date;
-@@ -74,4 +74,26 @@
+@@ -75,4 +75,26 @@
jsonobject.addProperty("expires", this.d == null ? "forever" : ExpirableListEntry.a.format(this.d));
jsonobject.addProperty("reason", this.e);
}
diff --git a/nms-patches/net/minecraft/server/players/JsonList.patch b/nms-patches/net/minecraft/server/players/JsonList.patch
index 03e2c1e44..410490c85 100644
--- a/nms-patches/net/minecraft/server/players/JsonList.patch
+++ b/nms-patches/net/minecraft/server/players/JsonList.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/JsonList.java
-+++ b/net/minecraft/server/JsonList.java
-@@ -50,7 +50,7 @@
+--- a/net/minecraft/server/players/JsonList.java
++++ b/net/minecraft/server/players/JsonList.java
+@@ -52,7 +52,7 @@
@Nullable
public V get(K k0) {
this.g();
@@ -9,7 +9,7 @@
}
public void remove(K k0) {
-@@ -72,6 +72,12 @@
+@@ -74,6 +74,12 @@
return (String[]) this.d.keySet().toArray(new String[this.d.size()]);
}
@@ -22,7 +22,7 @@
public boolean isEmpty() {
return this.d.size() < 1;
}
-@@ -89,7 +95,7 @@
+@@ -91,7 +97,7 @@
Iterator iterator = this.d.values().iterator();
while (iterator.hasNext()) {
@@ -31,7 +31,7 @@
if (v0.hasExpired()) {
list.add(v0.getKey());
-@@ -99,7 +105,7 @@
+@@ -101,7 +107,7 @@
iterator = list.iterator();
while (iterator.hasNext()) {
@@ -40,7 +40,7 @@
this.d.remove(this.a(k0));
}
-@@ -119,7 +125,7 @@
+@@ -121,7 +127,7 @@
JsonObject jsonobject = new JsonObject();
jsonlistentry.getClass();
@@ -49,7 +49,7 @@
}).forEach(jsonarray::add);
BufferedWriter bufferedwriter = Files.newWriter(this.c, StandardCharsets.UTF_8);
Throwable throwable = null;
-@@ -163,7 +169,7 @@
+@@ -165,7 +171,7 @@
JsonListEntry jsonlistentry = this.a(jsonobject);
if (jsonlistentry.getKey() != null) {
diff --git a/nms-patches/net/minecraft/server/players/NameReferencingFileConverter.patch b/nms-patches/net/minecraft/server/players/NameReferencingFileConverter.patch
index 4778daf1b..2455a849b 100644
--- a/nms-patches/net/minecraft/server/players/NameReferencingFileConverter.patch
+++ b/nms-patches/net/minecraft/server/players/NameReferencingFileConverter.patch
@@ -1,6 +1,18 @@
---- a/net/minecraft/server/NameReferencingFileConverter.java
-+++ b/net/minecraft/server/NameReferencingFileConverter.java
-@@ -80,7 +80,7 @@
+--- a/net/minecraft/server/players/NameReferencingFileConverter.java
++++ b/net/minecraft/server/players/NameReferencingFileConverter.java
+@@ -27,6 +27,11 @@
+ import org.apache.logging.log4j.LogManager;
+ import org.apache.logging.log4j.Logger;
+
++// CraftBukkit start
++import net.minecraft.nbt.NBTCompressedStreamTools;
++import net.minecraft.nbt.NBTTagCompound;
++// CraftBukkit end
++
+ public class NameReferencingFileConverter {
+
+ private static final Logger LOGGER = LogManager.getLogger();
+@@ -85,7 +90,7 @@
try {
gameprofilebanlist.load();
} catch (IOException ioexception) {
@@ -9,7 +21,7 @@
}
}
-@@ -138,7 +138,7 @@
+@@ -143,7 +148,7 @@
try {
ipbanlist.load();
} catch (IOException ioexception) {
@@ -18,7 +30,7 @@
}
}
-@@ -179,7 +179,7 @@
+@@ -184,7 +189,7 @@
try {
oplist.load();
} catch (IOException ioexception) {
@@ -27,7 +39,7 @@
}
}
-@@ -223,7 +223,7 @@
+@@ -228,7 +233,7 @@
try {
whitelist.load();
} catch (IOException ioexception) {
@@ -36,7 +48,7 @@
}
}
-@@ -346,6 +346,30 @@
+@@ -351,6 +356,30 @@
File file5 = new File(file, s2 + ".dat");
File file6 = new File(file4, s3 + ".dat");
diff --git a/nms-patches/net/minecraft/server/players/PlayerList.patch b/nms-patches/net/minecraft/server/players/PlayerList.patch
index f0d4dc5e4..123b47d15 100644
--- a/nms-patches/net/minecraft/server/players/PlayerList.patch
+++ b/nms-patches/net/minecraft/server/players/PlayerList.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PlayerList.java
-+++ b/net/minecraft/server/PlayerList.java
-@@ -21,6 +21,23 @@
+--- a/net/minecraft/server/players/PlayerList.java
++++ b/net/minecraft/server/players/PlayerList.java
+@@ -90,6 +90,27 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -8,6 +8,10 @@
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+
++import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
++import net.minecraft.server.dedicated.DedicatedServer;
++import net.minecraft.server.network.LoginListener;
++
+import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.craftbukkit.CraftWorld;
+
@@ -24,7 +28,7 @@
public abstract class PlayerList {
public static final File b = new File("banned-players.json");
-@@ -30,14 +47,16 @@
+@@ -99,14 +120,16 @@
private static final Logger LOGGER = LogManager.getLogger();
private static final SimpleDateFormat g = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
private final MinecraftServer server;
@@ -44,7 +48,7 @@
public final WorldNBTStorage playerFileData;
private boolean hasWhitelist;
private final IRegistryCustom.Dimension s;
-@@ -47,13 +66,23 @@
+@@ -116,13 +139,23 @@
private boolean v;
private int w;
@@ -70,7 +74,7 @@
this.server = minecraftserver;
this.s = iregistrycustom_dimension;
this.maxPlayers = i;
-@@ -69,6 +98,12 @@
+@@ -138,6 +171,12 @@
usercache.a(gameprofile);
NBTTagCompound nbttagcompound = this.a(entityplayer);
ResourceKey resourcekey;
@@ -83,7 +87,7 @@
if (nbttagcompound != null) {
DataResult dataresult = DimensionManager.a(new Dynamic(DynamicOpsNBT.a, nbttagcompound.get("Dimension")));
-@@ -99,7 +134,8 @@
+@@ -168,7 +207,8 @@
s1 = networkmanager.getSocketAddress().toString();
}
@@ -93,7 +97,7 @@
WorldData worlddata = worldserver1.getWorldData();
this.a(entityplayer, (EntityPlayer) null, worldserver1);
-@@ -109,6 +145,7 @@
+@@ -178,6 +218,7 @@
boolean flag1 = gamerules.getBoolean(GameRules.REDUCED_DEBUG_INFO);
playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), entityplayer.playerInteractManager.c(), BiomeManager.a(worldserver1.getSeed()), worlddata.isHardcore(), this.server.F(), this.s, worldserver1.getDimensionManager(), worldserver1.getDimensionKey(), this.getMaxPlayers(), this.viewDistance, flag1, !flag, worldserver1.isDebugWorld(), worldserver1.isFlatWorld()));
@@ -101,7 +105,7 @@
playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.a, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName())));
playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.abilities));
-@@ -127,19 +164,61 @@
+@@ -196,19 +237,61 @@
} else {
chatmessage = new ChatMessage("multiplayer.player.joined.renamed", new Object[]{entityplayer.getScoreboardDisplayName(), s});
}
@@ -153,7 +157,7 @@
+ entityplayer.sentListPacket = true;
+ // CraftBukkit end
+
-+ entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityMetadata(entityplayer.getId(), entityplayer.datawatcher, true)); // CraftBukkit - BungeeCord#2321, send complete data to self on spawn
++ entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityMetadata(entityplayer.getId(), entityplayer.getDataWatcher(), true)); // CraftBukkit - BungeeCord#2321, send complete data to self on spawn
+
+ // CraftBukkit start - Only add if the player wasn't moved in the event
+ if (entityplayer.world == worldserver1 && !worldserver1.getPlayers().contains(entityplayer)) {
@@ -168,7 +172,7 @@
this.a(entityplayer, worldserver1);
if (!this.server.getResourcePack().isEmpty()) {
entityplayer.setResourcePack(this.server.getResourcePack(), this.server.getResourcePackHash());
-@@ -155,8 +234,11 @@
+@@ -224,8 +307,11 @@
if (nbttagcompound != null && nbttagcompound.hasKeyOfType("RootVehicle", 10)) {
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("RootVehicle");
@@ -182,7 +186,7 @@
});
if (entity != null) {
-@@ -199,6 +281,8 @@
+@@ -268,6 +354,8 @@
}
entityplayer.syncInventory();
@@ -191,7 +195,7 @@
}
public void sendScoreboard(ScoreboardServer scoreboardserver, EntityPlayer entityplayer) {
-@@ -231,30 +315,31 @@
+@@ -300,30 +388,31 @@
}
public void setPlayerFileData(WorldServer worldserver) {
@@ -228,7 +232,7 @@
}
@Override
-@@ -282,14 +367,15 @@
+@@ -351,14 +440,15 @@
}
protected void savePlayerFile(EntityPlayer entityplayer) {
@@ -246,7 +250,7 @@
if (advancementdataplayer != null) {
advancementdataplayer.b();
-@@ -297,10 +383,24 @@
+@@ -366,10 +456,24 @@
}
@@ -272,7 +276,7 @@
this.savePlayerFile(entityplayer);
if (entityplayer.isPassenger()) {
Entity entity = entityplayer.getRootVehicle();
-@@ -332,18 +432,66 @@
+@@ -401,18 +505,66 @@
if (entityplayer1 == entityplayer) {
this.j.remove(uuid);
@@ -345,7 +349,7 @@
GameProfileBanEntry gameprofilebanentry = (GameProfileBanEntry) this.k.get(gameprofile);
chatmessage = new ChatMessage("multiplayer.disconnect.banned.reason", new Object[]{gameprofilebanentry.getReason()});
-@@ -351,10 +499,12 @@
+@@ -420,10 +572,12 @@
chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned.expiration", new Object[]{PlayerList.g.format(gameprofilebanentry.getExpires())}));
}
@@ -361,7 +365,7 @@
IpBanEntry ipbanentry = this.l.get(socketaddress);
chatmessage = new ChatMessage("multiplayer.disconnect.banned_ip.reason", new Object[]{ipbanentry.getReason()});
-@@ -362,13 +512,25 @@
+@@ -431,13 +585,25 @@
chatmessage.addSibling(new ChatMessage("multiplayer.disconnect.banned_ip.expiration", new Object[]{PlayerList.g.format(ipbanentry.getExpires())}));
}
@@ -390,7 +394,7 @@
UUID uuid = EntityHuman.a(gameprofile);
List list = Lists.newArrayList();
-@@ -404,14 +566,24 @@
+@@ -473,14 +639,24 @@
}
return new EntityPlayer(this.server, worldserver, gameprofile, (PlayerInteractManager) object);
@@ -415,7 +419,7 @@
WorldServer worldserver = this.server.getWorldServer(entityplayer.getSpawnDimension());
Optional optional;
-@@ -431,6 +603,11 @@
+@@ -500,6 +676,11 @@
}
EntityPlayer entityplayer1 = new EntityPlayer(this.server, worldserver1, entityplayer.getProfile(), (PlayerInteractManager) object);
@@ -427,7 +431,7 @@
entityplayer1.playerConnection = entityplayer.playerConnection;
entityplayer1.copyFrom(entityplayer, flag);
-@@ -444,52 +621,113 @@
+@@ -513,52 +694,113 @@
entityplayer1.addScoreboardTag(s);
}
@@ -566,7 +570,7 @@
return entityplayer1;
}
-@@ -502,7 +740,18 @@
+@@ -571,7 +813,18 @@
public void tick() {
if (++this.w > 600) {
@@ -586,7 +590,7 @@
this.w = 0;
}
-@@ -515,6 +764,25 @@
+@@ -584,6 +837,25 @@
}
@@ -612,7 +616,7 @@
public void a(Packet> packet, ResourceKey resourcekey) {
for (int i = 0; i < this.players.size(); ++i) {
EntityPlayer entityplayer = (EntityPlayer) this.players.get(i);
-@@ -615,6 +883,7 @@
+@@ -684,6 +956,7 @@
entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, b0));
}
@@ -620,7 +624,7 @@
this.server.getCommandDispatcher().a(entityplayer);
}
-@@ -647,6 +916,12 @@
+@@ -716,6 +989,12 @@
for (int i = 0; i < this.players.size(); ++i) {
EntityPlayer entityplayer = (EntityPlayer) this.players.get(i);
@@ -633,7 +637,7 @@
if (entityplayer != entityhuman && entityplayer.world.getDimensionKey() == resourcekey) {
double d4 = d0 - entityplayer.locX();
double d5 = d1 - entityplayer.locY();
-@@ -686,23 +961,34 @@
+@@ -755,23 +1034,34 @@
public void reloadWhitelist() {}
public void a(EntityPlayer entityplayer, WorldServer worldserver) {
@@ -673,7 +677,7 @@
}
public int getPlayerCount() {
-@@ -755,31 +1041,54 @@
+@@ -824,31 +1114,54 @@
entityplayer.playerInteractManager.a(this.u, EnumGamemode.NOT_SET);
}
@@ -736,7 +740,7 @@
if (file2.exists() && file2.isFile()) {
file2.renameTo(file1);
-@@ -787,7 +1096,7 @@
+@@ -856,7 +1169,7 @@
}
serverstatisticmanager = new ServerStatisticManager(this.server, file1);
@@ -745,7 +749,7 @@
}
return serverstatisticmanager;
-@@ -795,14 +1104,14 @@
+@@ -864,14 +1177,14 @@
public AdvancementDataPlayer f(EntityPlayer entityplayer) {
UUID uuid = entityplayer.getUniqueID();
@@ -762,7 +766,7 @@
}
advancementdataplayer.a(entityplayer);
-@@ -838,13 +1147,20 @@
+@@ -907,13 +1220,20 @@
}
public void reload() {
diff --git a/nms-patches/net/minecraft/server/rcon/RemoteControlCommandListener.patch b/nms-patches/net/minecraft/server/rcon/RemoteControlCommandListener.patch
index d5188f568..9b6277bfd 100644
--- a/nms-patches/net/minecraft/server/rcon/RemoteControlCommandListener.patch
+++ b/nms-patches/net/minecraft/server/rcon/RemoteControlCommandListener.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/RemoteControlCommandListener.java
-+++ b/net/minecraft/server/RemoteControlCommandListener.java
-@@ -26,6 +26,17 @@
+--- a/net/minecraft/server/rcon/RemoteControlCommandListener.java
++++ b/net/minecraft/server/rcon/RemoteControlCommandListener.java
+@@ -36,6 +36,17 @@
return new CommandListenerWrapper(this, Vec3D.b((BaseBlockPosition) worldserver.getSpawn()), Vec2F.a, worldserver, 4, "Rcon", RemoteControlCommandListener.b, this.server, (Entity) null);
}
diff --git a/nms-patches/net/minecraft/stats/RecipeBookServer.patch b/nms-patches/net/minecraft/stats/RecipeBookServer.patch
index 1f5cd10e3..15ef87acf 100644
--- a/nms-patches/net/minecraft/stats/RecipeBookServer.patch
+++ b/nms-patches/net/minecraft/stats/RecipeBookServer.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/RecipeBookServer.java
-+++ b/net/minecraft/server/RecipeBookServer.java
-@@ -10,6 +10,8 @@
+--- a/net/minecraft/stats/RecipeBookServer.java
++++ b/net/minecraft/stats/RecipeBookServer.java
+@@ -20,6 +20,8 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -9,7 +9,7 @@
public class RecipeBookServer extends RecipeBook {
private static final Logger LOGGER = LogManager.getLogger();
-@@ -25,7 +27,7 @@
+@@ -35,7 +37,7 @@
IRecipe> irecipe = (IRecipe) iterator.next();
MinecraftKey minecraftkey = irecipe.getKey();
@@ -18,7 +18,7 @@
this.a(minecraftkey);
this.d(minecraftkey);
list.add(minecraftkey);
-@@ -59,6 +61,7 @@
+@@ -69,6 +71,7 @@
}
private void a(PacketPlayOutRecipes.Action packetplayoutrecipes_action, EntityPlayer entityplayer, List list) {
diff --git a/nms-patches/net/minecraft/stats/StatisticManager.patch b/nms-patches/net/minecraft/stats/StatisticManager.patch
index 3666efb64..e2ba82193 100644
--- a/nms-patches/net/minecraft/stats/StatisticManager.patch
+++ b/nms-patches/net/minecraft/stats/StatisticManager.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/StatisticManager.java
-+++ b/net/minecraft/server/StatisticManager.java
-@@ -15,6 +15,12 @@
+--- a/net/minecraft/stats/StatisticManager.java
++++ b/net/minecraft/stats/StatisticManager.java
+@@ -16,6 +16,12 @@
public void b(EntityHuman entityhuman, Statistic> statistic, int i) {
int j = (int) Math.min((long) this.getStatisticValue(statistic) + (long) i, 2147483647L);
diff --git a/nms-patches/net/minecraft/util/datafix/DataConverterRegistry.patch b/nms-patches/net/minecraft/util/datafix/DataConverterRegistry.patch
index 69813c026..9b839bf65 100644
--- a/nms-patches/net/minecraft/util/datafix/DataConverterRegistry.patch
+++ b/nms-patches/net/minecraft/util/datafix/DataConverterRegistry.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/DataConverterRegistry.java
-+++ b/net/minecraft/server/DataConverterRegistry.java
-@@ -183,6 +183,18 @@
+--- a/net/minecraft/util/datafix/DataConverterRegistry.java
++++ b/net/minecraft/util/datafix/DataConverterRegistry.java
+@@ -367,6 +367,18 @@
datafixerbuilder.addFixer(new DataConverterItemFrame(schema46, false));
Schema schema47 = datafixerbuilder.addSchema(1458, DataConverterRegistry.b);
diff --git a/nms-patches/net/minecraft/util/datafix/fixes/DataConverterFlatten.patch b/nms-patches/net/minecraft/util/datafix/fixes/DataConverterFlatten.patch
index 44d8f67ef..6916dff54 100644
--- a/nms-patches/net/minecraft/util/datafix/fixes/DataConverterFlatten.patch
+++ b/nms-patches/net/minecraft/util/datafix/fixes/DataConverterFlatten.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/DataConverterFlatten.java
-+++ b/net/minecraft/server/DataConverterFlatten.java
-@@ -375,7 +375,7 @@
+--- a/net/minecraft/util/datafix/fixes/DataConverterFlatten.java
++++ b/net/minecraft/util/datafix/fixes/DataConverterFlatten.java
+@@ -376,7 +376,7 @@
Typed> typed2 = typed.getOrCreateTyped(opticfinder1);
Dynamic> dynamic1 = (Dynamic) typed2.get(DSL.remainderFinder());
diff --git a/nms-patches/net/minecraft/util/datafix/fixes/DataConverterMap.patch b/nms-patches/net/minecraft/util/datafix/fixes/DataConverterMap.patch
index 8b09d7540..41b8ab111 100644
--- a/nms-patches/net/minecraft/util/datafix/fixes/DataConverterMap.patch
+++ b/nms-patches/net/minecraft/util/datafix/fixes/DataConverterMap.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/DataConverterMap.java
-+++ b/net/minecraft/server/DataConverterMap.java
-@@ -31,7 +31,7 @@
+--- a/net/minecraft/util/datafix/fixes/DataConverterMap.java
++++ b/net/minecraft/util/datafix/fixes/DataConverterMap.java
+@@ -32,7 +32,7 @@
Typed> typed1 = typed.getOrCreateTyped(opticfinder1);
Dynamic> dynamic1 = (Dynamic) typed1.get(DSL.remainderFinder());
diff --git a/nms-patches/net/minecraft/util/worldupdate/WorldUpgrader.patch b/nms-patches/net/minecraft/util/worldupdate/WorldUpgrader.patch
index 6094c2487..bfa4037d4 100644
--- a/nms-patches/net/minecraft/util/worldupdate/WorldUpgrader.patch
+++ b/nms-patches/net/minecraft/util/worldupdate/WorldUpgrader.patch
@@ -1,6 +1,14 @@
---- a/net/minecraft/server/WorldUpgrader.java
-+++ b/net/minecraft/server/WorldUpgrader.java
-@@ -25,7 +25,7 @@
+--- a/net/minecraft/util/worldupdate/WorldUpgrader.java
++++ b/net/minecraft/util/worldupdate/WorldUpgrader.java
+@@ -34,11 +34,15 @@
+ import org.apache.logging.log4j.LogManager;
+ import org.apache.logging.log4j.Logger;
+
++// CraftBukkit start
++import net.minecraft.world.level.dimension.DimensionManager;
++// CraftBukkit end
++
+ public class WorldUpgrader {
private static final Logger LOGGER = LogManager.getLogger();
private static final ThreadFactory b = (new ThreadFactoryBuilder()).setDaemon(true).build();
@@ -9,7 +17,7 @@
private final boolean d;
private final Convertable.ConversionSession e;
private final Thread f;
-@@ -36,12 +36,12 @@
+@@ -49,12 +53,12 @@
private volatile int k;
private volatile int l;
private volatile int m;
@@ -24,7 +32,7 @@
this.c = immutableset;
this.d = flag;
this.g = datafixer;
-@@ -69,12 +69,12 @@
+@@ -82,12 +86,12 @@
private void i() {
this.k = 0;
@@ -39,7 +47,7 @@
list = this.b(resourcekey);
builder.put(resourcekey, list.listIterator());
-@@ -84,18 +84,18 @@
+@@ -97,18 +101,18 @@
this.i = true;
} else {
float f = (float) this.k;
@@ -63,7 +71,7 @@
long i = SystemUtils.getMonotonicMillis();
this.o = new ChatMessage("optimizeWorld.stage.upgrading");
-@@ -107,7 +107,7 @@
+@@ -120,7 +124,7 @@
float f2;
for (UnmodifiableIterator unmodifiableiterator2 = this.c.iterator(); unmodifiableiterator2.hasNext(); f1 += f2) {
@@ -72,7 +80,7 @@
ListIterator listiterator = (ListIterator) immutablemap.get(resourcekey2);
IChunkLoader ichunkloader = (IChunkLoader) immutablemap1.get(resourcekey2);
-@@ -122,7 +122,7 @@
+@@ -135,7 +139,7 @@
int j = IChunkLoader.a(nbttagcompound);
NBTTagCompound nbttagcompound1 = ichunkloader.getChunkData(resourcekey2, () -> {
return this.q;
@@ -81,7 +89,7 @@
NBTTagCompound nbttagcompound2 = nbttagcompound1.getCompound("Level");
ChunkCoordIntPair chunkcoordintpair1 = new ChunkCoordIntPair(nbttagcompound2.getInt("xPos"), nbttagcompound2.getInt("zPos"));
-@@ -195,8 +195,8 @@
+@@ -208,8 +212,8 @@
}
}
diff --git a/nms-patches/net/minecraft/world/ChestLock.patch b/nms-patches/net/minecraft/world/ChestLock.patch
index cbb12f07c..dd59b51d8 100644
--- a/nms-patches/net/minecraft/world/ChestLock.patch
+++ b/nms-patches/net/minecraft/world/ChestLock.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/ChestLock.java
-+++ b/net/minecraft/server/ChestLock.java
-@@ -2,6 +2,11 @@
-
- import javax.annotation.concurrent.Immutable;
+--- a/net/minecraft/world/ChestLock.java
++++ b/net/minecraft/world/ChestLock.java
+@@ -4,6 +4,11 @@
+ import net.minecraft.nbt.NBTTagCompound;
+ import net.minecraft.world.item.ItemStack;
+// CraftBukkit start
+import org.bukkit.ChatColor;
@@ -12,7 +12,7 @@
@Immutable
public class ChestLock {
-@@ -13,7 +18,19 @@
+@@ -15,7 +20,19 @@
}
public boolean a(ItemStack itemstack) {
diff --git a/nms-patches/net/minecraft/world/IInventory.patch b/nms-patches/net/minecraft/world/IInventory.patch
index b4afe81b8..f5dca44e3 100644
--- a/nms-patches/net/minecraft/world/IInventory.patch
+++ b/nms-patches/net/minecraft/world/IInventory.patch
@@ -1,15 +1,18 @@
---- a/net/minecraft/server/IInventory.java
-+++ b/net/minecraft/server/IInventory.java
-@@ -2,6 +2,8 @@
+--- a/net/minecraft/world/IInventory.java
++++ b/net/minecraft/world/IInventory.java
+@@ -5,6 +5,11 @@
+ import net.minecraft.world.item.Item;
+ import net.minecraft.world.item.ItemStack;
- import java.util.Set;
-
-+import org.bukkit.craftbukkit.entity.CraftHumanEntity; // CraftBukkit
++// CraftBukkit start
++import net.minecraft.world.item.crafting.IRecipe;
++import org.bukkit.craftbukkit.entity.CraftHumanEntity;
++// CraftBukkit end
+
public interface IInventory extends Clearable {
int getSize();
-@@ -16,9 +18,7 @@
+@@ -19,9 +24,7 @@
void setItem(int i, ItemStack itemstack);
@@ -20,7 +23,7 @@
void update();
-@@ -57,4 +57,29 @@
+@@ -60,4 +63,29 @@
return false;
}
diff --git a/nms-patches/net/minecraft/world/InventoryLargeChest.patch b/nms-patches/net/minecraft/world/InventoryLargeChest.patch
index 4422854d3..4ac952fe1 100644
--- a/nms-patches/net/minecraft/world/InventoryLargeChest.patch
+++ b/nms-patches/net/minecraft/world/InventoryLargeChest.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/InventoryLargeChest.java
-+++ b/net/minecraft/server/InventoryLargeChest.java
-@@ -1,10 +1,61 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/InventoryLargeChest.java
++++ b/net/minecraft/world/InventoryLargeChest.java
+@@ -3,11 +3,62 @@
+ import net.minecraft.world.entity.player.EntityHuman;
+ import net.minecraft.world.item.ItemStack;
+// CraftBukkit start
+import java.util.ArrayList;
@@ -62,7 +63,7 @@
public InventoryLargeChest(IInventory iinventory, IInventory iinventory1) {
if (iinventory == null) {
iinventory = iinventory1;
-@@ -59,7 +110,7 @@
+@@ -62,7 +113,7 @@
@Override
public int getMaxStackSize() {
diff --git a/nms-patches/net/minecraft/world/InventorySubcontainer.patch b/nms-patches/net/minecraft/world/InventorySubcontainer.patch
index 2f197fe4a..12d058b04 100644
--- a/nms-patches/net/minecraft/world/InventorySubcontainer.patch
+++ b/nms-patches/net/minecraft/world/InventorySubcontainer.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/InventorySubcontainer.java
-+++ b/net/minecraft/server/InventorySubcontainer.java
-@@ -5,13 +5,64 @@
- import java.util.List;
- import java.util.stream.Collectors;
+--- a/net/minecraft/world/InventorySubcontainer.java
++++ b/net/minecraft/world/InventorySubcontainer.java
+@@ -13,13 +13,64 @@
+ import net.minecraft.world.item.Item;
+ import net.minecraft.world.item.ItemStack;
+// CraftBukkit start
+import org.bukkit.Location;
diff --git a/nms-patches/net/minecraft/world/damagesource/DamageSource.patch b/nms-patches/net/minecraft/world/damagesource/DamageSource.patch
index aff8bdec0..3e2879a3f 100644
--- a/nms-patches/net/minecraft/world/damagesource/DamageSource.patch
+++ b/nms-patches/net/minecraft/world/damagesource/DamageSource.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/DamageSource.java
-+++ b/net/minecraft/server/DamageSource.java
-@@ -35,6 +35,18 @@
+--- a/net/minecraft/world/damagesource/DamageSource.java
++++ b/net/minecraft/world/damagesource/DamageSource.java
+@@ -46,6 +46,18 @@
private boolean D;
private boolean E;
public final String translationIndex;
diff --git a/nms-patches/net/minecraft/world/damagesource/EntityDamageSourceIndirect.patch b/nms-patches/net/minecraft/world/damagesource/EntityDamageSourceIndirect.patch
index 7fd01bf44..57169c2a4 100644
--- a/nms-patches/net/minecraft/world/damagesource/EntityDamageSourceIndirect.patch
+++ b/nms-patches/net/minecraft/world/damagesource/EntityDamageSourceIndirect.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityDamageSourceIndirect.java
-+++ b/net/minecraft/server/EntityDamageSourceIndirect.java
-@@ -32,4 +32,10 @@
+--- a/net/minecraft/world/damagesource/EntityDamageSourceIndirect.java
++++ b/net/minecraft/world/damagesource/EntityDamageSourceIndirect.java
+@@ -37,4 +37,10 @@
return !itemstack.isEmpty() && itemstack.hasName() ? new ChatMessage(s1, new Object[]{entityliving.getScoreboardDisplayName(), ichatbasecomponent, itemstack.C()}) : new ChatMessage(s, new Object[]{entityliving.getScoreboardDisplayName(), ichatbasecomponent});
}
diff --git a/nms-patches/net/minecraft/world/effect/MobEffectList.patch b/nms-patches/net/minecraft/world/effect/MobEffectList.patch
index 463f69834..3cd7a6f46 100644
--- a/nms-patches/net/minecraft/world/effect/MobEffectList.patch
+++ b/nms-patches/net/minecraft/world/effect/MobEffectList.patch
@@ -1,10 +1,12 @@
---- a/net/minecraft/server/MobEffectList.java
-+++ b/net/minecraft/server/MobEffectList.java
-@@ -7,6 +7,11 @@
- import java.util.UUID;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/effect/MobEffectList.java
++++ b/net/minecraft/world/effect/MobEffectList.java
+@@ -19,6 +19,13 @@
+ import net.minecraft.world.entity.ai.attributes.AttributeModifier;
+ import net.minecraft.world.entity.player.EntityHuman;
+// CraftBukkit start
++import net.minecraft.network.protocol.game.PacketPlayOutUpdateHealth;
++import net.minecraft.server.level.EntityPlayer;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
+// CraftBukkit end
@@ -12,7 +14,7 @@
public class MobEffectList {
private final Map a = Maps.newHashMap();
-@@ -21,7 +26,7 @@
+@@ -33,7 +40,7 @@
}
public static int getId(MobEffectList mobeffectlist) {
@@ -21,7 +23,7 @@
}
protected MobEffectList(MobEffectInfo mobeffectinfo, int i) {
-@@ -32,26 +37,37 @@
+@@ -44,26 +51,37 @@
public void tick(EntityLiving entityliving, int i) {
if (this == MobEffects.REGENERATION) {
if (entityliving.getHealth() < entityliving.getMaxHealth()) {
@@ -64,7 +66,7 @@
}
}
-@@ -72,7 +88,7 @@
+@@ -84,7 +102,7 @@
}
} else {
j = (int) (d0 * (double) (4 << i) + 0.5D);
diff --git a/nms-patches/net/minecraft/world/effect/MobEffects.patch b/nms-patches/net/minecraft/world/effect/MobEffects.patch
index 07c74ad01..5b4ce3a14 100644
--- a/nms-patches/net/minecraft/world/effect/MobEffects.patch
+++ b/nms-patches/net/minecraft/world/effect/MobEffects.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/MobEffects.java
-+++ b/net/minecraft/server/MobEffects.java
-@@ -57,6 +57,14 @@
+--- a/net/minecraft/world/effect/MobEffects.java
++++ b/net/minecraft/world/effect/MobEffects.java
+@@ -65,6 +65,14 @@
});
public static final MobEffectList HERO_OF_THE_VILLAGE = a(32, "hero_of_the_village", new MobEffectList(MobEffectInfo.BENEFICIAL, 4521796));
diff --git a/nms-patches/net/minecraft/world/entity/Entity.patch b/nms-patches/net/minecraft/world/entity/Entity.patch
index 5619bd4aa..3b20012ef 100644
--- a/nms-patches/net/minecraft/world/entity/Entity.patch
+++ b/nms-patches/net/minecraft/world/entity/Entity.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/Entity.java
-+++ b/net/minecraft/server/Entity.java
-@@ -21,8 +21,58 @@
+--- a/net/minecraft/world/entity/Entity.java
++++ b/net/minecraft/world/entity/Entity.java
+@@ -106,8 +106,58 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -59,7 +59,7 @@
protected static final Logger LOGGER = LogManager.getLogger();
private static final AtomicInteger entityCount = new AtomicInteger();
private static final List c = Collections.emptyList();
-@@ -106,6 +156,21 @@
+@@ -191,6 +241,21 @@
private long aB;
private EntitySize size;
private float headHeight;
@@ -81,7 +81,7 @@
public Entity(EntityTypes> entitytypes, World world) {
this.id = Entity.entityCount.incrementAndGet();
-@@ -212,6 +277,12 @@
+@@ -297,6 +362,12 @@
}
public void setPose(EntityPose entitypose) {
@@ -94,7 +94,7 @@
this.datawatcher.set(Entity.POSE, entitypose);
}
-@@ -228,6 +299,33 @@
+@@ -313,6 +384,33 @@
}
protected void setYawPitch(float f, float f1) {
@@ -128,7 +128,7 @@
this.yaw = f % 360.0F;
this.pitch = f1 % 360.0F;
}
-@@ -235,6 +333,7 @@
+@@ -320,6 +418,7 @@
public void setPosition(double d0, double d1, double d2) {
this.setPositionRaw(d0, d1, d2);
this.a(this.size.a(d0, d1, d2));
@@ -136,7 +136,7 @@
}
protected void af() {
-@@ -249,6 +348,15 @@
+@@ -334,6 +433,15 @@
this.entityBaseTick();
}
@@ -152,7 +152,7 @@
public void entityBaseTick() {
this.world.getMethodProfiler().enter("entityBaseTick");
if (this.isPassenger() && this.getVehicle().dead) {
-@@ -262,7 +370,7 @@
+@@ -347,7 +455,7 @@
this.z = this.A;
this.lastPitch = this.pitch;
this.lastYaw = this.yaw;
@@ -161,7 +161,7 @@
if (this.aO()) {
this.aP();
}
-@@ -325,12 +433,44 @@
+@@ -410,12 +518,44 @@
protected void burnFromLava() {
if (!this.isFireProof()) {
@@ -207,7 +207,7 @@
int j = i * 20;
if (this instanceof EntityLiving) {
-@@ -427,6 +567,28 @@
+@@ -512,6 +652,28 @@
block.a((IBlockAccess) this.world, this);
}
@@ -236,7 +236,7 @@
if (this.onGround && !this.bv()) {
block.stepOn(this.world, blockposition, this);
}
-@@ -700,6 +862,7 @@
+@@ -785,6 +947,7 @@
AxisAlignedBB axisalignedbb = this.getBoundingBox();
this.setPositionRaw((axisalignedbb.minX + axisalignedbb.maxX) / 2.0D, axisalignedbb.minY, (axisalignedbb.minZ + axisalignedbb.maxZ) / 2.0D);
@@ -244,7 +244,7 @@
}
protected SoundEffect getSoundSwim() {
-@@ -1025,6 +1188,13 @@
+@@ -1110,6 +1273,13 @@
}
public void spawnIn(World world) {
@@ -258,7 +258,7 @@
this.world = world;
}
-@@ -1044,6 +1214,7 @@
+@@ -1129,6 +1299,7 @@
this.lastY = d1;
this.lastZ = d4;
this.setPosition(d3, d1, d4);
@@ -266,7 +266,7 @@
}
public void d(Vec3D vec3d) {
-@@ -1218,6 +1389,12 @@
+@@ -1303,6 +1474,12 @@
return false;
}
@@ -279,7 +279,7 @@
public void a(Entity entity, int i, DamageSource damagesource) {
if (entity instanceof EntityPlayer) {
CriterionTriggers.c.a((EntityPlayer) entity, this, damagesource);
-@@ -1228,7 +1405,7 @@
+@@ -1313,7 +1490,7 @@
public boolean a_(NBTTagCompound nbttagcompound) {
String s = this.getSaveID();
@@ -288,7 +288,7 @@
nbttagcompound.setString("id", s);
this.save(nbttagcompound);
return true;
-@@ -1252,6 +1429,18 @@
+@@ -1337,6 +1514,18 @@
Vec3D vec3d = this.getMot();
nbttagcompound.set("Motion", this.a(vec3d.x, vec3d.y, vec3d.z));
@@ -307,7 +307,7 @@
nbttagcompound.set("Rotation", this.a(this.yaw, this.pitch));
nbttagcompound.setFloat("FallDistance", this.fallDistance);
nbttagcompound.setShort("Fire", (short) this.fireTicks);
-@@ -1260,6 +1449,18 @@
+@@ -1345,6 +1534,18 @@
nbttagcompound.setBoolean("Invulnerable", this.invulnerable);
nbttagcompound.setInt("PortalCooldown", this.portalCooldown);
nbttagcompound.a("UUID", this.getUniqueID());
@@ -326,7 +326,7 @@
IChatBaseComponent ichatbasecomponent = this.getCustomName();
if (ichatbasecomponent != null) {
-@@ -1317,6 +1518,11 @@
+@@ -1402,6 +1603,11 @@
}
}
@@ -338,7 +338,7 @@
return nbttagcompound;
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Saving entity NBT");
-@@ -1394,6 +1600,49 @@
+@@ -1479,6 +1685,49 @@
} else {
throw new IllegalStateException("Entity has invalid position");
}
@@ -388,7 +388,7 @@
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
-@@ -1469,9 +1718,22 @@
+@@ -1554,9 +1803,22 @@
} else if (this.world.isClientSide) {
return null;
} else {
@@ -411,7 +411,7 @@
this.world.addEntity(entityitem);
return entityitem;
}
-@@ -1555,7 +1817,7 @@
+@@ -1640,7 +1902,7 @@
this.setPose(EntityPose.STANDING);
this.vehicle = entity;
@@ -420,7 +420,7 @@
return true;
}
}
-@@ -1580,7 +1842,7 @@
+@@ -1665,7 +1927,7 @@
Entity entity = this.vehicle;
this.vehicle = null;
@@ -429,7 +429,7 @@
}
}
-@@ -1589,10 +1851,31 @@
+@@ -1674,10 +1936,31 @@
this.bf();
}
@@ -462,7 +462,7 @@
if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.getRidingPassenger() instanceof EntityHuman)) {
this.passengers.add(0, entity);
} else {
-@@ -1600,15 +1883,36 @@
+@@ -1685,15 +1968,36 @@
}
}
@@ -500,7 +500,7 @@
}
protected boolean q(Entity entity) {
-@@ -1646,14 +1950,20 @@
+@@ -1731,14 +2035,20 @@
if (this.inPortal) {
MinecraftServer minecraftserver = worldserver.getMinecraftServer();
@@ -524,7 +524,7 @@
this.world.getMethodProfiler().exit();
}
-@@ -1753,6 +2063,13 @@
+@@ -1838,6 +2148,13 @@
}
public void setSwimming(boolean flag) {
@@ -538,7 +538,7 @@
this.setFlag(4, flag);
}
-@@ -1785,8 +2102,12 @@
+@@ -1870,8 +2187,12 @@
return this.getScoreboardTeam() != null ? this.getScoreboardTeam().isAlly(scoreboardteambase) : false;
}
@@ -552,7 +552,7 @@
}
public boolean getFlag(int i) {
-@@ -1813,16 +2134,56 @@
+@@ -1898,16 +2219,56 @@
}
public void setAirTicks(int i) {
@@ -612,7 +612,7 @@
}
public void k(boolean flag) {
-@@ -1972,15 +2333,32 @@
+@@ -2057,15 +2418,32 @@
@Nullable
public Entity b(WorldServer worldserver) {
@@ -647,7 +647,7 @@
this.world.getMethodProfiler().exitEnter("reloading");
Entity entity = this.getEntityType().a((World) worldserver);
-@@ -1989,9 +2367,17 @@
+@@ -2074,9 +2452,17 @@
entity.setPositionRotation(shapedetectorshape.position.x, shapedetectorshape.position.y, shapedetectorshape.position.z, shapedetectorshape.yaw, entity.pitch);
entity.setMot(shapedetectorshape.velocity);
worldserver.addEntityTeleport(entity);
@@ -667,7 +667,7 @@
}
this.bN();
-@@ -2012,13 +2398,18 @@
+@@ -2097,13 +2483,18 @@
@Nullable
protected ShapeDetectorShape a(WorldServer worldserver) {
@@ -690,7 +690,7 @@
return null;
} else {
WorldBorder worldborder = worldserver.getWorldBorder();
-@@ -2028,8 +2419,16 @@
+@@ -2113,8 +2504,16 @@
double d3 = Math.min(2.9999872E7D, worldborder.h() - 16.0D);
double d4 = DimensionManager.a(this.world.getDimensionManager(), worldserver.getDimensionManager());
BlockPosition blockposition = new BlockPosition(MathHelper.a(this.locX() * d4, d0, d2), this.locY(), MathHelper.a(this.locZ() * d4, d1, d3));
@@ -708,7 +708,7 @@
IBlockData iblockdata = this.world.getType(this.ac);
EnumDirection.EnumAxis enumdirection_enumaxis;
Vec3D vec3d;
-@@ -2046,8 +2445,8 @@
+@@ -2131,8 +2530,8 @@
vec3d = new Vec3D(0.5D, 0.0D, 0.0D);
}
@@ -719,7 +719,7 @@
}
} else {
BlockPosition blockposition1;
-@@ -2057,8 +2456,15 @@
+@@ -2142,8 +2541,15 @@
} else {
blockposition1 = worldserver.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver.getSpawn());
}
@@ -736,7 +736,7 @@
}
}
-@@ -2066,8 +2472,23 @@
+@@ -2151,8 +2557,23 @@
return BlockPortalShape.a(blockutil_rectangle, enumdirection_enumaxis, this.getPositionVector(), this.a(this.getPose()));
}
@@ -762,7 +762,7 @@
}
public boolean canPortal() {
-@@ -2253,7 +2674,26 @@
+@@ -2338,7 +2759,26 @@
}
public void a(AxisAlignedBB axisalignedbb) {
diff --git a/nms-patches/net/minecraft/world/entity/EntityAgeable.patch b/nms-patches/net/minecraft/world/entity/EntityAgeable.patch
index 2c947c9cf..273e44c70 100644
--- a/nms-patches/net/minecraft/world/entity/EntityAgeable.patch
+++ b/nms-patches/net/minecraft/world/entity/EntityAgeable.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityAgeable.java
-+++ b/net/minecraft/server/EntityAgeable.java
-@@ -8,6 +8,7 @@
+--- a/net/minecraft/world/entity/EntityAgeable.java
++++ b/net/minecraft/world/entity/EntityAgeable.java
+@@ -17,6 +17,7 @@
protected int b;
protected int c;
protected int d;
@@ -8,7 +8,7 @@
protected EntityAgeable(EntityTypes extends EntityAgeable> entitytypes, World world) {
super(entitytypes, world);
-@@ -91,6 +92,7 @@
+@@ -100,6 +101,7 @@
super.saveData(nbttagcompound);
nbttagcompound.setInt("Age", this.getAge());
nbttagcompound.setInt("ForcedAge", this.c);
@@ -16,7 +16,7 @@
}
@Override
-@@ -98,6 +100,7 @@
+@@ -107,6 +109,7 @@
super.loadData(nbttagcompound);
this.setAgeRaw(nbttagcompound.getInt("Age"));
this.c = nbttagcompound.getInt("ForcedAge");
@@ -24,7 +24,7 @@
}
@Override
-@@ -112,7 +115,7 @@
+@@ -121,7 +124,7 @@
@Override
public void movementTick() {
super.movementTick();
diff --git a/nms-patches/net/minecraft/world/entity/EntityAreaEffectCloud.patch b/nms-patches/net/minecraft/world/entity/EntityAreaEffectCloud.patch
index 5f08c6c1b..aaf445ea4 100644
--- a/nms-patches/net/minecraft/world/entity/EntityAreaEffectCloud.patch
+++ b/nms-patches/net/minecraft/world/entity/EntityAreaEffectCloud.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/EntityAreaEffectCloud.java
-+++ b/net/minecraft/server/EntityAreaEffectCloud.java
-@@ -14,6 +14,11 @@
+--- a/net/minecraft/world/entity/EntityAreaEffectCloud.java
++++ b/net/minecraft/world/entity/EntityAreaEffectCloud.java
+@@ -33,6 +33,12 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
++import net.minecraft.resources.MinecraftKey;
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
+import org.bukkit.entity.LivingEntity;
+// CraftBukkit end
@@ -12,7 +13,7 @@
public class EntityAreaEffectCloud extends Entity {
private static final Logger LOGGER = LogManager.getLogger();
-@@ -105,6 +110,22 @@
+@@ -124,6 +130,22 @@
}
@@ -35,7 +36,7 @@
public int getColor() {
return (Integer) this.getDataWatcher().get(EntityAreaEffectCloud.COLOR);
}
-@@ -249,6 +270,7 @@
+@@ -268,6 +290,7 @@
if (!list1.isEmpty()) {
Iterator iterator2 = list1.iterator();
@@ -43,7 +44,7 @@
while (iterator2.hasNext()) {
EntityLiving entityliving = (EntityLiving) iterator2.next();
-@@ -258,6 +280,17 @@
+@@ -277,6 +300,17 @@
double d2 = d0 * d0 + d1 * d1;
if (d2 <= (double) (f * f)) {
@@ -61,7 +62,7 @@
this.affectedEntities.put(entityliving, this.ticksLived + this.reapplicationDelay);
Iterator iterator3 = list.iterator();
-@@ -267,7 +300,7 @@
+@@ -286,7 +320,7 @@
if (mobeffect1.getMobEffect().isInstant()) {
mobeffect1.getMobEffect().applyInstantEffect(this, this.getSource(), entityliving, mobeffect1.getAmplifier(), 0.5D);
} else {
diff --git a/nms-patches/net/minecraft/world/entity/EntityCreature.patch b/nms-patches/net/minecraft/world/entity/EntityCreature.patch
index e6700d638..d6d31f295 100644
--- a/nms-patches/net/minecraft/world/entity/EntityCreature.patch
+++ b/nms-patches/net/minecraft/world/entity/EntityCreature.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/EntityCreature.java
-+++ b/net/minecraft/server/EntityCreature.java
-@@ -1,5 +1,9 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/entity/EntityCreature.java
++++ b/net/minecraft/world/entity/EntityCreature.java
+@@ -7,6 +7,10 @@
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.event.entity.EntityUnleashEvent;
@@ -10,7 +11,7 @@
public abstract class EntityCreature extends EntityInsentient {
protected EntityCreature(EntityTypes extends EntityCreature> entitytypes, World world) {
-@@ -34,6 +38,7 @@
+@@ -41,6 +45,7 @@
if (this instanceof EntityTameableAnimal && ((EntityTameableAnimal) this).isSitting()) {
if (f > 10.0F) {
@@ -18,7 +19,7 @@
this.unleash(true, true);
}
-@@ -42,6 +47,7 @@
+@@ -49,6 +54,7 @@
this.x(f);
if (f > 10.0F) {
diff --git a/nms-patches/net/minecraft/world/entity/EntityExperienceOrb.patch b/nms-patches/net/minecraft/world/entity/EntityExperienceOrb.patch
index d6d7153d5..591e7c1d8 100644
--- a/nms-patches/net/minecraft/world/entity/EntityExperienceOrb.patch
+++ b/nms-patches/net/minecraft/world/entity/EntityExperienceOrb.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntityExperienceOrb.java
-+++ b/net/minecraft/server/EntityExperienceOrb.java
-@@ -2,6 +2,12 @@
-
- import java.util.Map.Entry;
+--- a/net/minecraft/world/entity/EntityExperienceOrb.java
++++ b/net/minecraft/world/entity/EntityExperienceOrb.java
+@@ -16,6 +16,12 @@
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -13,7 +13,7 @@
public class EntityExperienceOrb extends Entity {
public int b;
-@@ -36,6 +42,7 @@
+@@ -50,6 +56,7 @@
@Override
public void tick() {
super.tick();
@@ -21,7 +21,7 @@
if (this.d > 0) {
--this.d;
}
-@@ -72,7 +79,22 @@
+@@ -86,7 +93,22 @@
this.targetPlayer = null;
}
@@ -45,7 +45,7 @@
Vec3D vec3d = new Vec3D(this.targetPlayer.locX() - this.locX(), this.targetPlayer.locY() + (double) this.targetPlayer.getHeadHeight() / 2.0D - this.locY(), this.targetPlayer.locZ() - this.locZ());
double d1 = vec3d.g();
-@@ -155,13 +177,19 @@
+@@ -169,13 +191,19 @@
if (!itemstack.isEmpty() && itemstack.f()) {
int i = Math.min(this.c(this.value), itemstack.getDamage());
@@ -68,7 +68,7 @@
}
this.die();
-@@ -183,6 +211,24 @@
+@@ -197,6 +225,24 @@
}
public static int getOrbValue(int i) {
diff --git a/nms-patches/net/minecraft/world/entity/EntityInsentient.patch b/nms-patches/net/minecraft/world/entity/EntityInsentient.patch
index ee6ceedaf..a4e3629e4 100644
--- a/nms-patches/net/minecraft/world/entity/EntityInsentient.patch
+++ b/nms-patches/net/minecraft/world/entity/EntityInsentient.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/EntityInsentient.java
-+++ b/net/minecraft/server/EntityInsentient.java
-@@ -10,6 +10,18 @@
- import java.util.UUID;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/EntityInsentient.java
++++ b/net/minecraft/world/entity/EntityInsentient.java
+@@ -74,6 +74,19 @@
+ import net.minecraft.world.level.pathfinder.PathType;
+ import net.minecraft.world.level.storage.loot.LootTableInfo;
+// CraftBukkit start
++import net.minecraft.server.level.EntityPlayer;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
+import org.bukkit.event.entity.CreatureSpawnEvent;
@@ -19,7 +20,7 @@
public abstract class EntityInsentient extends EntityLiving {
private static final DataWatcherObject b = DataWatcher.a(EntityInsentient.class, DataWatcherRegistry.a);
-@@ -28,7 +40,7 @@
+@@ -92,7 +105,7 @@
public final float[] dropChanceHand;
private final NonNullList bq;
public final float[] dropChanceArmor;
@@ -28,7 +29,7 @@
public boolean persistent;
private final Map bt;
public MinecraftKey lootTableKey;
-@@ -41,6 +53,8 @@
+@@ -105,6 +118,8 @@
private BlockPosition bz;
private float bA;
@@ -37,7 +38,7 @@
protected EntityInsentient(EntityTypes extends EntityInsentient> entitytypes, World world) {
super(entitytypes, world);
this.bp = NonNullList.a(2, ItemStack.b);
-@@ -64,6 +78,9 @@
+@@ -128,6 +143,9 @@
this.initPathfinder();
}
@@ -47,7 +48,7 @@
}
protected void initPathfinder() {}
-@@ -144,7 +161,38 @@
+@@ -208,7 +226,38 @@
}
public void setGoalTarget(@Nullable EntityLiving entityliving) {
@@ -86,7 +87,7 @@
}
@Override
-@@ -361,16 +409,26 @@
+@@ -425,16 +474,26 @@
nbttagcompound.setBoolean("NoAI", this.isNoAI());
}
@@ -115,7 +116,7 @@
NBTTagList nbttaglist;
int i;
-@@ -417,6 +475,11 @@
+@@ -481,6 +540,11 @@
}
this.setNoAI(nbttagcompound.getBoolean("NoAI"));
@@ -127,7 +128,7 @@
}
@Override
-@@ -424,6 +487,11 @@
+@@ -488,6 +552,11 @@
super.a(damagesource, flag);
this.lootTableKey = null;
}
@@ -139,7 +140,7 @@
@Override
protected LootTableInfo.Builder a(boolean flag, DamageSource damagesource) {
-@@ -480,7 +548,7 @@
+@@ -544,7 +613,7 @@
protected void b(EntityItem entityitem) {
ItemStack itemstack = entityitem.getItemStack();
@@ -148,7 +149,7 @@
this.a(entityitem);
this.receive(entityitem, itemstack.getCount());
entityitem.die();
-@@ -489,15 +557,29 @@
+@@ -553,15 +622,29 @@
}
public boolean g(ItemStack itemstack) {
@@ -179,7 +180,7 @@
}
this.b(enumitemslot, itemstack);
-@@ -610,18 +692,18 @@
+@@ -674,18 +757,18 @@
EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
if (entityhuman != null) {
@@ -201,7 +202,7 @@
this.die();
} else if (d0 < (double) l) {
this.ticksFarFromPlayer = 0;
-@@ -636,6 +718,7 @@
+@@ -700,6 +783,7 @@
@Override
protected final void doTick() {
++this.ticksFarFromPlayer;
@@ -209,7 +210,7 @@
this.world.getMethodProfiler().enter("sensing");
this.bo.a();
this.world.getMethodProfiler().exit();
-@@ -1024,6 +1107,12 @@
+@@ -1088,6 +1172,12 @@
if (!this.isAlive()) {
return EnumInteractionResult.PASS;
} else if (this.getLeashHolder() == entityhuman) {
@@ -222,7 +223,7 @@
this.unleash(true, !entityhuman.abilities.canInstantlyBuild);
return EnumInteractionResult.a(this.world.isClientSide);
} else {
-@@ -1042,6 +1131,12 @@
+@@ -1106,6 +1196,12 @@
ItemStack itemstack = entityhuman.b(enumhand);
if (itemstack.getItem() == Items.LEAD && this.a(entityhuman)) {
@@ -235,7 +236,7 @@
this.setLeashHolder(entityhuman, true);
itemstack.subtract(1);
return EnumInteractionResult.a(this.world.isClientSide);
-@@ -1057,7 +1152,7 @@
+@@ -1121,7 +1217,7 @@
if (itemstack.getItem() instanceof ItemMonsterEgg) {
if (this.world instanceof WorldServer) {
ItemMonsterEgg itemmonsteregg = (ItemMonsterEgg) itemstack.getItem();
@@ -244,7 +245,7 @@
optional.ifPresent((entityinsentient) -> {
this.a(entityhuman, entityinsentient);
-@@ -1103,12 +1198,19 @@
+@@ -1167,12 +1263,19 @@
return this.bA != -1.0F;
}
@@ -265,7 +266,7 @@
t0.u(this);
t0.setBaby(this.isBaby());
-@@ -1140,7 +1242,12 @@
+@@ -1204,7 +1307,12 @@
}
}
@@ -279,7 +280,7 @@
if (this.isPassenger()) {
Entity entity = this.getVehicle();
-@@ -1160,6 +1267,7 @@
+@@ -1224,6 +1332,7 @@
if (this.leashHolder != null) {
if (!this.isAlive() || !this.leashHolder.isAlive()) {
@@ -287,7 +288,7 @@
this.unleash(true, true);
}
-@@ -1176,7 +1284,9 @@
+@@ -1240,7 +1349,9 @@
this.leashHolder = null;
this.by = null;
if (!this.world.isClientSide && flag1) {
@@ -297,7 +298,7 @@
}
if (!this.world.isClientSide && flag && this.world instanceof WorldServer) {
-@@ -1226,6 +1336,7 @@
+@@ -1290,6 +1401,7 @@
boolean flag1 = super.a(entity, flag);
if (flag1 && this.isLeashed()) {
@@ -305,7 +306,7 @@
this.unleash(true, true);
}
-@@ -1358,7 +1469,14 @@
+@@ -1422,7 +1534,14 @@
int i = EnchantmentManager.getFireAspectEnchantmentLevel(this);
if (i > 0) {
@@ -321,7 +322,7 @@
}
boolean flag = entity.damageEntity(DamageSource.mobAttack(this), f);
-@@ -1420,6 +1538,7 @@
+@@ -1484,6 +1603,7 @@
@Override
protected void bN() {
super.bN();
diff --git a/nms-patches/net/minecraft/world/entity/EntityLightning.patch b/nms-patches/net/minecraft/world/entity/EntityLightning.patch
index e9e38bbe1..e99c97b8b 100644
--- a/nms-patches/net/minecraft/world/entity/EntityLightning.patch
+++ b/nms-patches/net/minecraft/world/entity/EntityLightning.patch
@@ -1,15 +1,18 @@
---- a/net/minecraft/server/EntityLightning.java
-+++ b/net/minecraft/server/EntityLightning.java
-@@ -5,6 +5,8 @@
- import java.util.List;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/EntityLightning.java
++++ b/net/minecraft/world/entity/EntityLightning.java
+@@ -22,6 +22,11 @@
+ import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.phys.AxisAlignedBB;
-+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
++// CraftBukkit start
++import net.minecraft.network.protocol.game.PacketPlayOutNamedSoundEffect;
++import org.bukkit.craftbukkit.event.CraftEventFactory;
++// CraftBukkit end
+
public class EntityLightning extends Entity {
private int lifeTicks;
-@@ -45,7 +47,24 @@
+@@ -62,7 +67,24 @@
this.a(4);
}
@@ -35,7 +38,7 @@
this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_LIGHTNING_BOLT_IMPACT, SoundCategory.WEATHER, 2.0F, 0.5F + this.random.nextFloat() * 0.2F);
}
-@@ -61,7 +80,7 @@
+@@ -78,7 +100,7 @@
}
}
@@ -44,7 +47,7 @@
if (!(this.world instanceof WorldServer)) {
this.world.c(2);
} else if (!this.isEffect) {
-@@ -89,7 +108,11 @@
+@@ -106,7 +128,11 @@
IBlockData iblockdata = BlockFireAbstract.a((IBlockAccess) this.world, blockposition);
if (this.world.getType(blockposition).isAir() && iblockdata.canPlace(this.world, blockposition)) {
@@ -57,7 +60,7 @@
}
for (int j = 0; j < i; ++j) {
-@@ -97,7 +120,11 @@
+@@ -114,7 +140,11 @@
iblockdata = BlockFireAbstract.a((IBlockAccess) this.world, blockposition1);
if (this.world.getType(blockposition1).isAir() && iblockdata.canPlace(this.world, blockposition1)) {
diff --git a/nms-patches/net/minecraft/world/entity/EntityLiving.patch b/nms-patches/net/minecraft/world/entity/EntityLiving.patch
index a8f6aad8a..7f93c25fb 100644
--- a/nms-patches/net/minecraft/world/entity/EntityLiving.patch
+++ b/nms-patches/net/minecraft/world/entity/EntityLiving.patch
@@ -1,7 +1,7 @@
---- a/net/minecraft/server/EntityLiving.java
-+++ b/net/minecraft/server/EntityLiving.java
-@@ -21,6 +21,27 @@
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/EntityLiving.java
++++ b/net/minecraft/world/entity/EntityLiving.java
+@@ -111,6 +111,30 @@
+ import net.minecraft.world.scores.ScoreboardTeam;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
@@ -9,6 +9,9 @@
+import java.util.HashSet;
+import java.util.Set;
+import com.google.common.base.Function;
++import net.minecraft.nbt.NBTTagFloat;
++import net.minecraft.nbt.NBTTagInt;
++import net.minecraft.world.entity.animal.EntityAnimal;
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.attribute.CraftAttributeMap;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -28,15 +31,15 @@
public abstract class EntityLiving extends Entity {
private static final UUID b = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D");
-@@ -106,6 +127,21 @@
+@@ -196,6 +220,21 @@
private float bB;
private float bC;
protected BehaviorController> bg;
+ // CraftBukkit start
+ public int expToDrop;
+ public int maxAirTicks = 300;
-+ boolean forceDrops;
-+ ArrayList drops = new ArrayList();
++ public boolean forceDrops;
++ public ArrayList drops = new ArrayList();
+ public final org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
+ public boolean collides = true;
+ public Set collidableExemptions = new HashSet<>();
@@ -50,7 +53,7 @@
protected EntityLiving(EntityTypes extends EntityLiving> entitytypes, World world) {
super(entitytypes, world);
-@@ -117,7 +153,9 @@
+@@ -207,7 +246,9 @@
this.activeItem = ItemStack.b;
this.by = Optional.empty();
this.attributeMap = new AttributeMapBase(AttributeDefaults.a(entitytypes));
@@ -61,7 +64,7 @@
this.i = true;
this.az = (float) ((Math.random() + 1.0D) * 0.009999999776482582D);
this.af();
-@@ -184,7 +222,13 @@
+@@ -274,7 +315,13 @@
double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
int i = (int) (150.0D * d1);
@@ -76,7 +79,7 @@
}
}
-@@ -406,7 +450,7 @@
+@@ -496,7 +543,7 @@
protected void cU() {
++this.deathTicks;
@@ -85,7 +88,7 @@
this.die();
for (int i = 0; i < 20; ++i) {
-@@ -497,7 +541,13 @@
+@@ -587,7 +634,13 @@
}
protected void playEquipSound(ItemStack itemstack) {
@@ -100,7 +103,7 @@
SoundEffect soundeffect = SoundEffects.ITEM_ARMOR_EQUIP_GENERIC;
Item item = itemstack.getItem();
-@@ -567,6 +617,17 @@
+@@ -657,6 +710,17 @@
}
}
@@ -118,7 +121,7 @@
if (nbttagcompound.hasKeyOfType("Health", 99)) {
this.setHealth(nbttagcompound.getFloat("Health"));
}
-@@ -604,9 +665,32 @@
+@@ -694,9 +758,32 @@
}
@@ -151,7 +154,7 @@
try {
while (iterator.hasNext()) {
MobEffectList mobeffectlist = (MobEffectList) iterator.next();
-@@ -616,6 +700,12 @@
+@@ -706,6 +793,12 @@
this.a(mobeffect, true);
})) {
if (!this.world.isClientSide) {
@@ -164,7 +167,7 @@
iterator.remove();
this.b(mobeffect);
}
-@@ -626,6 +716,17 @@
+@@ -716,6 +809,17 @@
} catch (ConcurrentModificationException concurrentmodificationexception) {
;
}
@@ -182,7 +185,7 @@
if (this.updateEffects) {
if (!this.world.isClientSide) {
-@@ -735,7 +836,13 @@
+@@ -825,7 +929,13 @@
this.datawatcher.set(EntityLiving.f, 0);
}
@@ -196,7 +199,7 @@
if (this.world.isClientSide) {
return false;
} else {
-@@ -744,7 +851,14 @@
+@@ -834,7 +944,14 @@
boolean flag;
for (flag = false; iterator.hasNext(); flag = true) {
@@ -212,7 +215,7 @@
iterator.remove();
}
-@@ -769,18 +883,44 @@
+@@ -859,18 +976,44 @@
return (MobEffect) this.effects.get(mobeffectlist);
}
@@ -258,7 +261,7 @@
return true;
} else {
return false;
-@@ -804,13 +944,39 @@
+@@ -894,13 +1037,39 @@
return this.getMonsterType() == EnumMonsterType.UNDEAD;
}
@@ -299,7 +302,7 @@
if (mobeffect != null) {
this.b(mobeffect);
-@@ -847,20 +1013,55 @@
+@@ -937,20 +1106,55 @@
}
@@ -356,7 +359,7 @@
this.datawatcher.set(EntityLiving.HEALTH, MathHelper.a(f, 0.0F, this.getMaxHealth()));
}
-@@ -874,7 +1075,7 @@
+@@ -964,7 +1168,7 @@
return false;
} else if (this.world.isClientSide) {
return false;
@@ -365,7 +368,7 @@
return false;
} else if (damagesource.isFire() && this.hasEffect(MobEffects.FIRE_RESISTANCE)) {
return false;
-@@ -886,17 +1087,19 @@
+@@ -976,17 +1180,19 @@
this.ticksFarFromPlayer = 0;
float f1 = f;
@@ -388,7 +391,7 @@
this.damageShield(f);
f2 = f;
f = 0.0F;
-@@ -914,22 +1117,41 @@
+@@ -1004,22 +1210,41 @@
this.av = 1.5F;
boolean flag1 = true;
@@ -434,7 +437,7 @@
this.ap = 0.0F;
Entity entity1 = damagesource.getEntity();
-@@ -1050,19 +1272,29 @@
+@@ -1140,19 +1365,29 @@
EnumHand[] aenumhand = EnumHand.values();
int i = aenumhand.length;
@@ -468,7 +471,7 @@
EntityPlayer entityplayer = (EntityPlayer) this;
entityplayer.b(StatisticList.ITEM_USED.b(Items.TOTEM_OF_UNDYING));
-@@ -1070,14 +1302,16 @@
+@@ -1160,14 +1395,16 @@
}
this.setHealth(1.0F);
@@ -490,7 +493,7 @@
}
}
-@@ -1175,6 +1409,13 @@
+@@ -1265,6 +1502,13 @@
if (!flag) {
EntityItem entityitem = new EntityItem(this.world, this.locX(), this.locY(), this.locZ(), new ItemStack(Items.bt));
@@ -504,7 +507,7 @@
this.world.addEntity(entityitem);
}
}
-@@ -1194,28 +1435,46 @@
+@@ -1284,28 +1528,46 @@
boolean flag = this.lastDamageByPlayerTime > 0;
@@ -553,7 +556,7 @@
}
-@@ -1336,9 +1595,14 @@
+@@ -1426,9 +1688,14 @@
int i = this.e(f, f1);
if (i > 0) {
@@ -569,7 +572,7 @@
return true;
} else {
return flag;
-@@ -1378,7 +1642,7 @@
+@@ -1468,7 +1735,7 @@
protected float applyArmorModifier(DamageSource damagesource, float f) {
if (!damagesource.ignoresArmor()) {
@@ -578,7 +581,7 @@
f = CombatMath.a(f, (float) this.getArmorStrength(), (float) this.b(GenericAttributes.ARMOR_TOUGHNESS));
}
-@@ -1391,7 +1655,8 @@
+@@ -1481,7 +1748,8 @@
} else {
int i;
@@ -588,7 +591,7 @@
i = (this.getEffect(MobEffects.RESISTANCE).getAmplifier() + 1) * 5;
int j = 25 - i;
float f1 = f * (float) j;
-@@ -1422,28 +1687,173 @@
+@@ -1512,28 +1780,173 @@
}
}
@@ -772,7 +775,7 @@
}
public CombatTracker getCombatTracker() {
-@@ -1464,9 +1874,19 @@
+@@ -1554,9 +1967,19 @@
}
public final void setArrowCount(int i) {
@@ -793,7 +796,7 @@
public final int dz() {
return (Integer) this.datawatcher.get(EntityLiving.bi);
}
-@@ -1594,6 +2014,12 @@
+@@ -1684,6 +2107,12 @@
public abstract ItemStack getEquipment(EnumItemSlot enumitemslot);
@@ -806,7 +809,7 @@
@Override
public abstract void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack);
-@@ -1816,6 +2242,7 @@
+@@ -1906,6 +2335,7 @@
}
if (this.onGround && !this.world.isClientSide) {
@@ -814,25 +817,25 @@
this.setFlag(7, false);
}
} else {
-@@ -1957,7 +2384,7 @@
+@@ -2047,7 +2477,7 @@
}
}
-- this.p();
+- this.updateEquipment();
+ this.updateEquipment(); // PAIL rename
if (this.ticksLived % 20 == 0) {
this.getCombatTracker().g();
}
-@@ -2058,7 +2485,7 @@
+@@ -2148,7 +2578,7 @@
}
-- private void p() {
+- public void updateEquipment() {
+ public void updateEquipment() { // PAIL private->public; updateEquipment
Map map = this.q();
if (map != null) {
-@@ -2321,6 +2748,7 @@
+@@ -2411,6 +2841,7 @@
}
if (!this.world.isClientSide) {
@@ -840,7 +843,7 @@
this.setFlag(7, flag);
}
-@@ -2441,6 +2869,7 @@
+@@ -2531,6 +2962,7 @@
}
public boolean hasLineOfSight(Entity entity) {
@@ -848,7 +851,7 @@
Vec3D vec3d = new Vec3D(this.locX(), this.getHeadY(), this.locZ());
Vec3D vec3d1 = new Vec3D(entity.locX(), entity.getHeadY(), entity.locZ());
-@@ -2458,14 +2887,21 @@
+@@ -2548,14 +2980,21 @@
@Override
public boolean isInteractable() {
@@ -872,7 +875,7 @@
@Override
protected void velocityChanged() {
this.velocityChanged = this.random.nextDouble() >= this.b(GenericAttributes.KNOCKBACK_RESISTANCE);
-@@ -2658,7 +3094,25 @@
+@@ -2748,7 +3187,25 @@
} else {
if (!this.activeItem.isEmpty() && this.isHandRaised()) {
this.b(this.activeItem, 16);
@@ -899,7 +902,7 @@
if (itemstack != this.activeItem) {
this.a(enumhand, itemstack);
-@@ -2750,10 +3204,18 @@
+@@ -2840,10 +3297,18 @@
}
if (flag2) {
@@ -921,7 +924,7 @@
}
}
-@@ -2850,7 +3312,7 @@
+@@ -2940,7 +3405,7 @@
}
public void entityWakeup() {
@@ -930,7 +933,7 @@
World world = this.world;
this.world.getClass();
-@@ -2921,7 +3383,7 @@
+@@ -3011,7 +3476,7 @@
Pair pair = (Pair) iterator.next();
if (!world.isClientSide && pair.getFirst() != null && world.random.nextFloat() < (Float) pair.getSecond()) {
diff --git a/nms-patches/net/minecraft/world/entity/EntityTypes.patch b/nms-patches/net/minecraft/world/entity/EntityTypes.patch
index d949b8025..b7734c10e 100644
--- a/nms-patches/net/minecraft/world/entity/EntityTypes.patch
+++ b/nms-patches/net/minecraft/world/entity/EntityTypes.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityTypes.java
-+++ b/net/minecraft/server/EntityTypes.java
-@@ -12,7 +12,7 @@
+--- a/net/minecraft/world/entity/EntityTypes.java
++++ b/net/minecraft/world/entity/EntityTypes.java
+@@ -142,7 +142,7 @@
public class EntityTypes {
private static final Logger LOGGER = LogManager.getLogger();
@@ -9,7 +9,7 @@
public static final EntityTypes ARMOR_STAND = a("armor_stand", EntityTypes.Builder.a(EntityArmorStand::new, EnumCreatureType.MISC).a(0.5F, 1.975F).trackingRange(10));
public static final EntityTypes ARROW = a("arrow", EntityTypes.Builder.a(EntityTippedArrow::new, EnumCreatureType.MISC).a(0.5F, 0.5F).trackingRange(4).updateInterval(20));
public static final EntityTypes BAT = a("bat", EntityTypes.Builder.a(EntityBat::new, EnumCreatureType.AMBIENT).a(0.5F, 0.9F).trackingRange(5));
-@@ -137,7 +137,7 @@
+@@ -267,7 +267,7 @@
private MinecraftKey bq;
private final EntitySize br;
@@ -18,7 +18,7 @@
return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_builder.a(s));
}
-@@ -169,10 +169,18 @@
+@@ -299,10 +299,18 @@
@Nullable
public T spawnCreature(WorldServer worldserver, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1) {
@@ -38,7 +38,7 @@
}
return t0;
-@@ -208,7 +216,7 @@
+@@ -338,7 +346,7 @@
t0.setCustomName(ichatbasecomponent);
}
@@ -47,7 +47,7 @@
return t0;
}
}
-@@ -351,7 +359,7 @@
+@@ -481,7 +489,7 @@
}
return entity;
@@ -56,7 +56,7 @@
}
private static Optional b(NBTTagCompound nbttagcompound, World world) {
-@@ -403,7 +411,7 @@
+@@ -533,7 +541,7 @@
this.g = enumcreaturetype == EnumCreatureType.CREATURE || enumcreaturetype == EnumCreatureType.MISC;
}
diff --git a/nms-patches/net/minecraft/world/entity/IEntityAngerable.patch b/nms-patches/net/minecraft/world/entity/IEntityAngerable.patch
index dbb196ef2..d2dd6ec88 100644
--- a/nms-patches/net/minecraft/world/entity/IEntityAngerable.patch
+++ b/nms-patches/net/minecraft/world/entity/IEntityAngerable.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/IEntityAngerable.java
-+++ b/net/minecraft/server/IEntityAngerable.java
-@@ -98,7 +98,7 @@
+--- a/net/minecraft/world/entity/IEntityAngerable.java
++++ b/net/minecraft/world/entity/IEntityAngerable.java
+@@ -103,7 +103,7 @@
default void pacify() {
this.setLastDamager((EntityLiving) null);
this.setAngerTarget((UUID) null);
@@ -9,7 +9,7 @@
this.setAnger(0);
}
-@@ -108,6 +108,8 @@
+@@ -113,6 +113,8 @@
void setGoalTarget(@Nullable EntityLiving entityliving);
diff --git a/nms-patches/net/minecraft/world/entity/IEntitySelector.patch b/nms-patches/net/minecraft/world/entity/IEntitySelector.patch
index e1ca0f263..f755c3452 100644
--- a/nms-patches/net/minecraft/world/entity/IEntitySelector.patch
+++ b/nms-patches/net/minecraft/world/entity/IEntitySelector.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/IEntitySelector.java
-+++ b/net/minecraft/server/IEntitySelector.java
-@@ -37,7 +37,7 @@
+--- a/net/minecraft/world/entity/IEntitySelector.java
++++ b/net/minecraft/world/entity/IEntitySelector.java
+@@ -42,7 +42,7 @@
ScoreboardTeamBase.EnumTeamPush scoreboardteambase_enumteampush = scoreboardteambase == null ? ScoreboardTeamBase.EnumTeamPush.ALWAYS : scoreboardteambase.getCollisionRule();
return (Predicate) (scoreboardteambase_enumteampush == ScoreboardTeamBase.EnumTeamPush.NEVER ? Predicates.alwaysFalse() : IEntitySelector.g.and((entity1) -> {
diff --git a/nms-patches/net/minecraft/world/entity/SaddleStorage.patch b/nms-patches/net/minecraft/world/entity/SaddleStorage.patch
index 5e0a2003a..7f7468574 100644
--- a/nms-patches/net/minecraft/world/entity/SaddleStorage.patch
+++ b/nms-patches/net/minecraft/world/entity/SaddleStorage.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/SaddleStorage.java
-+++ b/net/minecraft/server/SaddleStorage.java
-@@ -35,6 +35,15 @@
+--- a/net/minecraft/world/entity/SaddleStorage.java
++++ b/net/minecraft/world/entity/SaddleStorage.java
+@@ -38,6 +38,15 @@
}
}
diff --git a/nms-patches/net/minecraft/world/entity/ai/attributes/AttributeRanged.patch b/nms-patches/net/minecraft/world/entity/ai/attributes/AttributeRanged.patch
index 98be834de..e513acad6 100644
--- a/nms-patches/net/minecraft/world/entity/ai/attributes/AttributeRanged.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/attributes/AttributeRanged.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/AttributeRanged.java
-+++ b/net/minecraft/server/AttributeRanged.java
-@@ -20,6 +20,8 @@
+--- a/net/minecraft/world/entity/ai/attributes/AttributeRanged.java
++++ b/net/minecraft/world/entity/ai/attributes/AttributeRanged.java
+@@ -22,6 +22,8 @@
@Override
public double a(double d0) {
diff --git a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetForget.patch b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetForget.patch
index 31f7edc9f..9143810ac 100644
--- a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetForget.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetForget.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BehaviorAttackTargetForget.java
-+++ b/net/minecraft/server/BehaviorAttackTargetForget.java
-@@ -4,6 +4,12 @@
- import java.util.Optional;
- import java.util.function.Predicate;
+--- a/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetForget.java
++++ b/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetForget.java
+@@ -10,6 +10,12 @@
+ import net.minecraft.world.entity.ai.memory.MemoryModuleType;
+ import net.minecraft.world.entity.ai.memory.MemoryStatus;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
@@ -13,7 +13,7 @@
public class BehaviorAttackTargetForget extends Behavior {
private final Predicate b;
-@@ -54,6 +60,17 @@
+@@ -60,6 +66,17 @@
}
private void d(E e0) {
diff --git a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetSet.patch b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetSet.patch
index 8950ac6f0..c5689ca8a 100644
--- a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetSet.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetSet.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/BehaviorAttackTargetSet.java
-+++ b/net/minecraft/server/BehaviorAttackTargetSet.java
-@@ -5,6 +5,12 @@
- import java.util.function.Function;
- import java.util.function.Predicate;
+--- a/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetSet.java
++++ b/net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetSet.java
+@@ -10,6 +10,13 @@
+ import net.minecraft.world.entity.ai.memory.MemoryModuleType;
+ import net.minecraft.world.entity.ai.memory.MemoryStatus;
+// CraftBukkit start
++import net.minecraft.server.level.EntityPlayer;
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityTargetEvent;
@@ -13,7 +14,7 @@
public class BehaviorAttackTargetSet extends Behavior {
private final Predicate b;
-@@ -33,13 +39,21 @@
+@@ -38,13 +45,21 @@
}
protected void a(WorldServer worldserver, E e0, long i) {
diff --git a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorCareer.patch b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorCareer.patch
index 88f8bc27a..fc6da0113 100644
--- a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorCareer.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorCareer.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BehaviorCareer.java
-+++ b/net/minecraft/server/BehaviorCareer.java
-@@ -3,6 +3,12 @@
- import com.google.common.collect.ImmutableMap;
- import java.util.Optional;
+--- a/net/minecraft/world/entity/ai/behavior/BehaviorCareer.java
++++ b/net/minecraft/world/entity/ai/behavior/BehaviorCareer.java
+@@ -13,6 +13,12 @@
+ import net.minecraft.world.entity.npc.EntityVillager;
+ import net.minecraft.world.entity.npc.VillagerProfession;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftVillager;
@@ -13,7 +13,7 @@
public class BehaviorCareer extends Behavior {
public BehaviorCareer() {
-@@ -19,7 +25,7 @@
+@@ -29,7 +35,7 @@
GlobalPos globalpos = (GlobalPos) entityvillager.getBehaviorController().getMemory(MemoryModuleType.POTENTIAL_JOB_SITE).get();
entityvillager.getBehaviorController().removeMemory(MemoryModuleType.POTENTIAL_JOB_SITE);
@@ -22,7 +22,7 @@
worldserver.broadcastEntityEffect(entityvillager, (byte) 14);
if (entityvillager.getVillagerData().getProfession() == VillagerProfession.NONE) {
MinecraftServer minecraftserver = worldserver.getMinecraftServer();
-@@ -31,7 +37,14 @@
+@@ -41,7 +47,14 @@
return villagerprofession.b() == villageplacetype;
}).findFirst();
}).ifPresent((villagerprofession) -> {
diff --git a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorFarm.patch b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorFarm.patch
index 1e19d663f..dcd65c856 100644
--- a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorFarm.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorFarm.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BehaviorFarm.java
-+++ b/net/minecraft/server/BehaviorFarm.java
-@@ -58,8 +58,8 @@
+--- a/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java
++++ b/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java
+@@ -78,8 +78,8 @@
protected void a(WorldServer worldserver, EntityVillager entityvillager, long i) {
if (i > this.c && this.farmBlock != null) {
@@ -11,7 +11,7 @@
}
}
-@@ -79,7 +79,11 @@
+@@ -99,7 +99,11 @@
Block block1 = worldserver.getType(this.farmBlock.down()).getBlock();
if (block instanceof BlockCrops && ((BlockCrops) block).isRipe(iblockdata)) {
@@ -24,7 +24,7 @@
}
if (iblockdata.isAir() && block1 instanceof BlockSoil && entityvillager.canPlant()) {
-@@ -90,19 +94,28 @@
+@@ -110,19 +114,28 @@
boolean flag = false;
if (!itemstack.isEmpty()) {
@@ -57,7 +57,7 @@
}
if (flag) {
-@@ -121,8 +134,8 @@
+@@ -141,8 +154,8 @@
this.farmBlock = this.a(worldserver);
if (this.farmBlock != null) {
this.c = i + 20L;
diff --git a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorInteractDoor.patch b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorInteractDoor.patch
index 7d4df2a0d..a7193e45e 100644
--- a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorInteractDoor.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorInteractDoor.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BehaviorInteractDoor.java
-+++ b/net/minecraft/server/BehaviorInteractDoor.java
-@@ -52,6 +52,13 @@
+--- a/net/minecraft/world/entity/ai/behavior/BehaviorInteractDoor.java
++++ b/net/minecraft/world/entity/ai/behavior/BehaviorInteractDoor.java
+@@ -66,6 +66,13 @@
BlockDoor blockdoor = (BlockDoor) iblockdata.getBlock();
if (!blockdoor.h(iblockdata)) {
@@ -14,7 +14,7 @@
blockdoor.setDoor(worldserver, iblockdata, blockposition, true);
}
-@@ -65,6 +72,13 @@
+@@ -79,6 +86,13 @@
BlockDoor blockdoor1 = (BlockDoor) iblockdata1.getBlock();
if (!blockdoor1.h(iblockdata1)) {
@@ -28,7 +28,7 @@
blockdoor1.setDoor(worldserver, iblockdata1, blockposition1, true);
this.c(worldserver, entityliving, blockposition1);
}
-@@ -113,7 +127,7 @@
+@@ -127,7 +141,7 @@
private static boolean a(WorldServer worldserver, EntityLiving entityliving, BlockPosition blockposition) {
BehaviorController> behaviorcontroller = entityliving.getBehaviorController();
@@ -37,7 +37,7 @@
return entityliving1.getEntityType() == entityliving.getEntityType();
}).filter((entityliving1) -> {
return blockposition.a((IPosition) entityliving1.getPositionVector(), 2.0D);
-@@ -155,7 +169,7 @@
+@@ -169,7 +183,7 @@
if (behaviorcontroller.getMemory(MemoryModuleType.DOORS_TO_CLOSE).isPresent()) {
((Set) behaviorcontroller.getMemory(MemoryModuleType.DOORS_TO_CLOSE).get()).add(globalpos);
} else {
diff --git a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorMakeLove.patch b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorMakeLove.patch
index 935ea5590..8cd6dfda6 100644
--- a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorMakeLove.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorMakeLove.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BehaviorMakeLove.java
-+++ b/net/minecraft/server/BehaviorMakeLove.java
-@@ -93,6 +93,11 @@
+--- a/net/minecraft/world/entity/ai/behavior/BehaviorMakeLove.java
++++ b/net/minecraft/world/entity/ai/behavior/BehaviorMakeLove.java
+@@ -106,6 +106,11 @@
private Optional b(WorldServer worldserver, EntityVillager entityvillager, EntityVillager entityvillager1) {
EntityVillager entityvillager2 = entityvillager.createChild(worldserver, entityvillager1);
@@ -12,7 +12,7 @@
if (entityvillager2 == null) {
return Optional.empty();
-@@ -101,7 +106,7 @@
+@@ -114,7 +119,7 @@
entityvillager1.setAgeRaw(6000);
entityvillager2.setAgeRaw(-24000);
entityvillager2.setPositionRotation(entityvillager.locX(), entityvillager.locY(), entityvillager.locZ(), 0.0F, 0.0F);
@@ -21,7 +21,7 @@
worldserver.broadcastEntityEffect(entityvillager2, (byte) 12);
return Optional.of(entityvillager2);
}
-@@ -110,6 +115,6 @@
+@@ -123,6 +128,6 @@
private void a(WorldServer worldserver, EntityVillager entityvillager, BlockPosition blockposition) {
GlobalPos globalpos = GlobalPos.create(worldserver.getDimensionKey(), blockposition);
diff --git a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorProfession.patch b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorProfession.patch
index f183f8356..eecf2cbc8 100644
--- a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorProfession.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorProfession.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BehaviorProfession.java
-+++ b/net/minecraft/server/BehaviorProfession.java
-@@ -2,6 +2,12 @@
-
- import com.google.common.collect.ImmutableMap;
+--- a/net/minecraft/world/entity/ai/behavior/BehaviorProfession.java
++++ b/net/minecraft/world/entity/ai/behavior/BehaviorProfession.java
+@@ -8,6 +8,12 @@
+ import net.minecraft.world.entity.npc.VillagerData;
+ import net.minecraft.world.entity.npc.VillagerProfession;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftVillager;
@@ -13,7 +13,7 @@
public class BehaviorProfession extends Behavior {
public BehaviorProfession() {
-@@ -15,7 +21,14 @@
+@@ -21,7 +27,14 @@
}
protected void a(WorldServer worldserver, EntityVillager entityvillager, long i) {
diff --git a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorUtil.patch b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorUtil.patch
index d9efdc658..e8601ed1b 100644
--- a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorUtil.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorUtil.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BehaviorUtil.java
-+++ b/net/minecraft/server/BehaviorUtil.java
-@@ -38,7 +38,7 @@
+--- a/net/minecraft/world/entity/ai/behavior/BehaviorUtil.java
++++ b/net/minecraft/world/entity/ai/behavior/BehaviorUtil.java
+@@ -54,7 +54,7 @@
}
public static void a(EntityLiving entityliving, EntityLiving entityliving1) {
@@ -9,7 +9,7 @@
}
private static void b(EntityLiving entityliving, EntityLiving entityliving1, float f) {
-@@ -51,18 +51,19 @@
+@@ -67,18 +67,19 @@
public static void a(EntityLiving entityliving, Entity entity, float f, int i) {
MemoryTarget memorytarget = new MemoryTarget(new BehaviorPositionEntity(entity, false), f, i);
@@ -33,7 +33,7 @@
double d0 = entityliving.getHeadY() - 0.30000001192092896D;
EntityItem entityitem = new EntityItem(entityliving.world, entityliving.locX(), d0, entityliving.locZ(), itemstack);
float f = 0.3F;
-@@ -71,12 +72,19 @@
+@@ -87,12 +88,19 @@
vec3d1 = vec3d1.d().a(0.30000001192092896D);
entityitem.setMot(vec3d1);
entityitem.defaultPickupDelay();
diff --git a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorWorkComposter.patch b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorWorkComposter.patch
index e13157e0e..714e9292a 100644
--- a/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorWorkComposter.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/behavior/BehaviorWorkComposter.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BehaviorWorkComposter.java
-+++ b/net/minecraft/server/BehaviorWorkComposter.java
-@@ -11,7 +11,7 @@
+--- a/net/minecraft/world/entity/ai/behavior/BehaviorWorkComposter.java
++++ b/net/minecraft/world/entity/ai/behavior/BehaviorWorkComposter.java
+@@ -24,7 +24,7 @@
public BehaviorWorkComposter() {}
@Override
@@ -9,7 +9,7 @@
Optional optional = entityvillager.getBehaviorController().getMemory(MemoryModuleType.JOB_SITE);
if (optional.isPresent()) {
-@@ -30,7 +30,7 @@
+@@ -43,7 +43,7 @@
BlockPosition blockposition = globalpos.getBlockPosition();
if ((Integer) iblockdata.get(BlockComposter.a) == 8) {
@@ -18,7 +18,7 @@
}
int i = 20;
-@@ -55,7 +55,7 @@
+@@ -68,7 +68,7 @@
i -= k1;
for (int l1 = 0; l1 < k1; ++l1) {
diff --git a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.patch b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.patch
index 062e703fa..723798083 100644
--- a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PathfinderGoalBreakDoor.java
-+++ b/net/minecraft/server/PathfinderGoalBreakDoor.java
-@@ -66,6 +66,12 @@
+--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java
++++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java
+@@ -71,6 +71,12 @@
}
if (this.a == this.f() && this.a(this.entity.world.getDifficulty())) {
diff --git a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.patch b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.patch
index d6d75318a..1cb7f76af 100644
--- a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/PathfinderGoalEatTile.java
-+++ b/net/minecraft/server/PathfinderGoalEatTile.java
-@@ -3,6 +3,10 @@
- import java.util.EnumSet;
- import java.util.function.Predicate;
+--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.java
++++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.java
+@@ -11,6 +11,10 @@
+ import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.level.block.state.predicate.BlockStatePredicate;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -11,7 +11,7 @@
public class PathfinderGoalEatTile extends PathfinderGoal {
private static final Predicate a = BlockStatePredicate.a(Blocks.GRASS);
-@@ -55,7 +59,8 @@
+@@ -63,7 +67,8 @@
BlockPosition blockposition = this.b.getChunkCoordinates();
if (PathfinderGoalEatTile.a.test(this.c.getType(blockposition))) {
@@ -21,7 +21,7 @@
this.c.b(blockposition, false);
}
-@@ -64,7 +69,8 @@
+@@ -72,7 +77,8 @@
BlockPosition blockposition1 = blockposition.down();
if (this.c.getType(blockposition1).a(Blocks.GRASS_BLOCK)) {
diff --git a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalFollowOwner.patch b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalFollowOwner.patch
index 257d1bc3a..d6a3a5c3e 100644
--- a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalFollowOwner.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalFollowOwner.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/PathfinderGoalFollowOwner.java
-+++ b/net/minecraft/server/PathfinderGoalFollowOwner.java
-@@ -2,6 +2,12 @@
-
- import java.util.EnumSet;
+--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalFollowOwner.java
++++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalFollowOwner.java
+@@ -15,6 +15,12 @@
+ import net.minecraft.world.level.pathfinder.PathType;
+ import net.minecraft.world.level.pathfinder.PathfinderNormal;
+// CraftBukkit start
+import org.bukkit.Location;
@@ -13,7 +13,7 @@
public class PathfinderGoalFollowOwner extends PathfinderGoal {
private final EntityTameableAnimal a;
-@@ -104,7 +110,18 @@
+@@ -117,7 +123,18 @@
} else if (!this.a(new BlockPosition(i, j, k))) {
return false;
} else {
diff --git a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.patch b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.patch
index 3f8e380e7..5bb265fcb 100644
--- a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.patch
@@ -1,6 +1,17 @@
---- a/net/minecraft/server/PathfinderGoalPanic.java
-+++ b/net/minecraft/server/PathfinderGoalPanic.java
-@@ -68,6 +68,12 @@
+--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.java
++++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalPanic.java
+@@ -11,6 +11,10 @@
+ import net.minecraft.world.level.IBlockAccess;
+ import net.minecraft.world.phys.Vec3D;
+
++// CraftBukkit start
++import net.minecraft.world.entity.EntityLiving;
++// CraftBukkit end
++
+ public class PathfinderGoalPanic extends PathfinderGoal {
+
+ protected final EntityCreature a;
+@@ -76,6 +80,12 @@
@Override
public boolean b() {
diff --git a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.patch b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.patch
index c9c97266e..238ac6b18 100644
--- a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/PathfinderGoalRemoveBlock.java
-+++ b/net/minecraft/server/PathfinderGoalRemoveBlock.java
-@@ -3,6 +3,11 @@
- import java.util.Random;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java
++++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java
+@@ -20,6 +20,11 @@
+ import net.minecraft.world.level.chunk.IChunkAccess;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock;
@@ -12,7 +12,7 @@
public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget {
private final Block g;
-@@ -81,6 +86,14 @@
+@@ -98,6 +103,14 @@
}
if (this.i > 60) {
diff --git a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalSit.patch b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalSit.patch
index 047feacc8..8b9122470 100644
--- a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalSit.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalSit.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PathfinderGoalSit.java
-+++ b/net/minecraft/server/PathfinderGoalSit.java
-@@ -19,7 +19,7 @@
+--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalSit.java
++++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalSit.java
+@@ -22,7 +22,7 @@
@Override
public boolean a() {
if (!this.entity.isTamed()) {
diff --git a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalTame.patch b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalTame.patch
index e7d57703b..90e4cc423 100644
--- a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalTame.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalTame.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PathfinderGoalTame.java
-+++ b/net/minecraft/server/PathfinderGoalTame.java
-@@ -57,7 +57,8 @@
+--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalTame.java
++++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalTame.java
+@@ -62,7 +62,8 @@
int i = this.entity.getTemper();
int j = this.entity.getMaxDomestication();
diff --git a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.patch b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.patch
index 475a5030e..649ab5abb 100644
--- a/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/PathfinderGoalTempt.java
-+++ b/net/minecraft/server/PathfinderGoalTempt.java
-@@ -2,6 +2,13 @@
-
- import java.util.EnumSet;
+--- a/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.java
++++ b/net/minecraft/world/entity/ai/goal/PathfinderGoalTempt.java
+@@ -11,6 +11,13 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.item.crafting.RecipeItemStack;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
@@ -14,7 +14,7 @@
public class PathfinderGoalTempt extends PathfinderGoal {
private static final PathfinderTargetCondition c = (new PathfinderTargetCondition()).a(10.0D).a().b().d().c();
-@@ -12,7 +19,7 @@
+@@ -21,7 +28,7 @@
private double g;
private double h;
private double i;
@@ -23,7 +23,7 @@
private int j;
private boolean k;
private final RecipeItemStack l;
-@@ -40,7 +47,17 @@
+@@ -49,7 +56,17 @@
return false;
} else {
this.target = this.a.world.a(PathfinderGoalTempt.c, (EntityLiving) this.a);
diff --git a/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalDefendVillage.patch b/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalDefendVillage.patch
index e27bce567..e3745bc56 100644
--- a/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalDefendVillage.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalDefendVillage.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PathfinderGoalDefendVillage.java
-+++ b/net/minecraft/server/PathfinderGoalDefendVillage.java
-@@ -49,7 +49,7 @@
+--- a/net/minecraft/world/entity/ai/goal/target/PathfinderGoalDefendVillage.java
++++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalDefendVillage.java
+@@ -56,7 +56,7 @@
@Override
public void c() {
diff --git a/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalHurtByTarget.patch b/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalHurtByTarget.patch
index 097e86ac9..fd8d35117 100644
--- a/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalHurtByTarget.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalHurtByTarget.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PathfinderGoalHurtByTarget.java
-+++ b/net/minecraft/server/PathfinderGoalHurtByTarget.java
-@@ -53,7 +53,7 @@
+--- a/net/minecraft/world/entity/ai/goal/target/PathfinderGoalHurtByTarget.java
++++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalHurtByTarget.java
+@@ -62,7 +62,7 @@
@Override
public void c() {
@@ -9,7 +9,7 @@
this.g = this.e.getGoalTarget();
this.c = this.e.da();
this.h = 300;
-@@ -100,6 +100,6 @@
+@@ -109,6 +109,6 @@
}
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
diff --git a/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalNearestAttackableTarget.patch b/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalNearestAttackableTarget.patch
index 2ef0b8eee..b16ca00c1 100644
--- a/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalNearestAttackableTarget.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalNearestAttackableTarget.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java
-+++ b/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java
-@@ -52,7 +52,7 @@
+--- a/net/minecraft/world/entity/ai/goal/target/PathfinderGoalNearestAttackableTarget.java
++++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalNearestAttackableTarget.java
+@@ -59,7 +59,7 @@
@Override
public void c() {
diff --git a/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtByTarget.patch b/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtByTarget.patch
index 3190ada96..6376cea8a 100644
--- a/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtByTarget.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtByTarget.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PathfinderGoalOwnerHurtByTarget.java
-+++ b/net/minecraft/server/PathfinderGoalOwnerHurtByTarget.java
-@@ -34,7 +34,7 @@
+--- a/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtByTarget.java
++++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtByTarget.java
+@@ -38,7 +38,7 @@
@Override
public void c() {
diff --git a/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtTarget.patch b/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtTarget.patch
index 8da1a8c20..039eba83b 100644
--- a/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtTarget.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtTarget.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PathfinderGoalOwnerHurtTarget.java
-+++ b/net/minecraft/server/PathfinderGoalOwnerHurtTarget.java
-@@ -34,7 +34,7 @@
+--- a/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtTarget.java
++++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtTarget.java
+@@ -38,7 +38,7 @@
@Override
public void c() {
diff --git a/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalTarget.patch b/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalTarget.patch
index 69f8439ab..6453b6cf9 100644
--- a/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalTarget.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/goal/target/PathfinderGoalTarget.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/PathfinderGoalTarget.java
-+++ b/net/minecraft/server/PathfinderGoalTarget.java
-@@ -2,6 +2,8 @@
-
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/ai/goal/target/PathfinderGoalTarget.java
++++ b/net/minecraft/world/entity/ai/goal/target/PathfinderGoalTarget.java
+@@ -13,6 +13,8 @@
+ import net.minecraft.world.level.pathfinder.PathPoint;
+ import net.minecraft.world.scores.ScoreboardTeamBase;
+import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit
+
public abstract class PathfinderGoalTarget extends PathfinderGoal {
protected final EntityInsentient e;
-@@ -59,7 +61,7 @@
+@@ -70,7 +72,7 @@
if (entityliving instanceof EntityHuman && ((EntityHuman) entityliving).abilities.isInvulnerable) {
return false;
} else {
@@ -18,7 +18,7 @@
return true;
}
}
-@@ -80,7 +82,7 @@
+@@ -91,7 +93,7 @@
@Override
public void d() {
diff --git a/nms-patches/net/minecraft/world/entity/ai/village/VillageSiege.patch b/nms-patches/net/minecraft/world/entity/ai/village/VillageSiege.patch
index 7c6f8e201..56b6b9b8b 100644
--- a/nms-patches/net/minecraft/world/entity/ai/village/VillageSiege.patch
+++ b/nms-patches/net/minecraft/world/entity/ai/village/VillageSiege.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/VillageSiege.java
-+++ b/net/minecraft/server/VillageSiege.java
-@@ -108,7 +108,7 @@
+--- a/net/minecraft/world/entity/ai/village/VillageSiege.java
++++ b/net/minecraft/world/entity/ai/village/VillageSiege.java
+@@ -123,7 +123,7 @@
}
entityzombie.setPositionRotation(vec3d.x, vec3d.y, vec3d.z, worldserver.random.nextFloat() * 360.0F, 0.0F);
diff --git a/nms-patches/net/minecraft/world/entity/ambient/EntityBat.patch b/nms-patches/net/minecraft/world/entity/ambient/EntityBat.patch
index 6983e56e8..9652a85cc 100644
--- a/nms-patches/net/minecraft/world/entity/ambient/EntityBat.patch
+++ b/nms-patches/net/minecraft/world/entity/ambient/EntityBat.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/EntityBat.java
-+++ b/net/minecraft/server/EntityBat.java
-@@ -5,6 +5,8 @@
- import java.util.Random;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/ambient/EntityBat.java
++++ b/net/minecraft/world/entity/ambient/EntityBat.java
+@@ -30,6 +30,8 @@
+ import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.phys.Vec3D;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class EntityBat extends EntityAmbient {
private static final DataWatcherObject b = DataWatcher.a(EntityBat.class, DataWatcherRegistry.a);
-@@ -105,16 +107,24 @@
+@@ -130,16 +132,24 @@
}
if (this.world.a(EntityBat.c, (EntityLiving) this) != null) {
@@ -39,7 +39,7 @@
}
} else {
if (this.d != null && (!this.world.isEmpty(this.d) || this.d.getY() < 1)) {
-@@ -138,7 +148,11 @@
+@@ -163,7 +173,11 @@
this.aT = 0.5F;
this.yaw += f1;
if (this.random.nextInt(100) == 0 && this.world.getType(blockposition1).isOccluding(this.world, blockposition1)) {
@@ -52,7 +52,7 @@
}
}
-@@ -168,7 +182,11 @@
+@@ -193,7 +207,11 @@
return false;
} else {
if (!this.world.isClientSide && this.isAsleep()) {
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityAnimal.patch b/nms-patches/net/minecraft/world/entity/animal/EntityAnimal.patch
index 83652a239..420e983ac 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityAnimal.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityAnimal.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/EntityAnimal.java
-+++ b/net/minecraft/server/EntityAnimal.java
-@@ -4,10 +4,16 @@
- import java.util.UUID;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/animal/EntityAnimal.java
++++ b/net/minecraft/world/entity/animal/EntityAnimal.java
+@@ -27,10 +27,17 @@
+ import net.minecraft.world.level.block.Blocks;
+ import net.minecraft.world.level.pathfinder.PathType;
+// CraftBukkit start
++import net.minecraft.world.entity.EntityTameableAnimal;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityEnterLoveModeEvent;
+// CraftBukkit end
@@ -17,7 +18,7 @@
protected EntityAnimal(EntityTypes extends EntityAnimal> entitytypes, World world) {
super(entitytypes, world);
-@@ -44,6 +50,9 @@
+@@ -67,6 +74,9 @@
}
@@ -27,7 +28,7 @@
@Override
public boolean damageEntity(DamageSource damagesource, float f) {
if (this.isInvulnerable(damagesource)) {
-@@ -53,6 +62,7 @@
+@@ -76,6 +86,7 @@
return super.damageEntity(damagesource, f);
}
}
@@ -35,7 +36,7 @@
@Override
public float a(BlockPosition blockposition, IWorldReader iworldreader) {
-@@ -143,10 +153,17 @@
+@@ -166,10 +177,17 @@
}
public void g(@Nullable EntityHuman entityhuman) {
@@ -54,7 +55,7 @@
this.world.broadcastEntityEffect(this, (byte) 18);
}
-@@ -186,11 +203,24 @@
+@@ -209,11 +227,24 @@
EntityAgeable entityageable = this.createChild(worldserver, entityanimal);
if (entityageable != null) {
@@ -79,7 +80,7 @@
if (entityplayer != null) {
entityplayer.a(StatisticList.ANIMALS_BRED);
-@@ -203,10 +233,14 @@
+@@ -226,10 +257,14 @@
entityanimal.resetLove();
entityageable.setBaby(true);
entityageable.setPositionRotation(this.locX(), this.locY(), this.locZ(), 0.0F, 0.0F);
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityBee.patch b/nms-patches/net/minecraft/world/entity/animal/EntityBee.patch
index 16f797688..bb209df88 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityBee.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityBee.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityBee.java
-+++ b/net/minecraft/server/EntityBee.java
-@@ -137,7 +137,7 @@
+--- a/net/minecraft/world/entity/animal/EntityBee.java
++++ b/net/minecraft/world/entity/animal/EntityBee.java
+@@ -211,7 +211,7 @@
}
if (b0 > 0) {
@@ -9,7 +9,7 @@
}
}
-@@ -512,11 +512,15 @@
+@@ -586,11 +586,15 @@
} else {
Entity entity = damagesource.getEntity();
@@ -27,7 +27,7 @@
}
}
-@@ -537,7 +541,7 @@
+@@ -611,7 +615,7 @@
class d extends EntityBee.a {
private d() {
@@ -36,7 +36,7 @@
}
@Override
-@@ -597,7 +601,7 @@
+@@ -671,7 +675,7 @@
class g extends EntityBee.a {
private g() {
@@ -45,7 +45,7 @@
}
@Override
-@@ -646,7 +650,7 @@
+@@ -720,7 +724,7 @@
}
}
@@ -54,7 +54,7 @@
EntityBee.this.world.triggerEffect(2005, blockposition, 0);
EntityBee.this.world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(blockstateinteger, (Integer) iblockdata.get(blockstateinteger) + 1));
EntityBee.this.fi();
-@@ -661,7 +665,7 @@
+@@ -735,7 +739,7 @@
class i extends EntityBee.a {
private i() {
@@ -63,7 +63,7 @@
}
@Override
-@@ -725,7 +729,7 @@
+@@ -799,7 +803,7 @@
private int h = 0;
k() {
@@ -72,7 +72,7 @@
this.a(EnumSet.of(PathfinderGoal.Type.MOVE));
}
-@@ -909,7 +913,7 @@
+@@ -983,7 +987,7 @@
private int c;
f() {
@@ -81,7 +81,7 @@
this.c = EntityBee.this.world.random.nextInt(10);
this.a(EnumSet.of(PathfinderGoal.Type.MOVE));
}
-@@ -967,7 +971,7 @@
+@@ -1041,7 +1045,7 @@
private int f;
e() {
@@ -90,7 +90,7 @@
this.c = EntityBee.this.world.random.nextInt(10);
this.d = Lists.newArrayList();
this.e = null;
-@@ -1187,7 +1191,7 @@
+@@ -1261,7 +1265,7 @@
@Override
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
if (entityinsentient instanceof EntityBee && this.e.hasLineOfSight(entityliving)) {
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityCat.patch b/nms-patches/net/minecraft/world/entity/animal/EntityCat.patch
index c44a0e4da..5d2fb5c3f 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityCat.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityCat.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityCat.java
-+++ b/net/minecraft/server/EntityCat.java
-@@ -15,7 +15,7 @@
+--- a/net/minecraft/world/entity/animal/EntityCat.java
++++ b/net/minecraft/world/entity/animal/EntityCat.java
+@@ -78,7 +78,7 @@
private static final DataWatcherObject bt = DataWatcher.a(EntityCat.class, DataWatcherRegistry.i);
private static final DataWatcherObject bu = DataWatcher.a(EntityCat.class, DataWatcherRegistry.i);
private static final DataWatcherObject bv = DataWatcher.a(EntityCat.class, DataWatcherRegistry.b);
@@ -9,7 +9,7 @@
hashmap.put(0, new MinecraftKey("textures/entity/cat/tabby.png"));
hashmap.put(1, new MinecraftKey("textures/entity/cat/black.png"));
hashmap.put(2, new MinecraftKey("textures/entity/cat/red.png"));
-@@ -341,7 +341,7 @@
+@@ -404,7 +404,7 @@
}
} else if (this.k(itemstack)) {
this.a(entityhuman, itemstack);
@@ -18,7 +18,7 @@
this.tame(entityhuman);
this.setWillSit(true);
this.world.broadcastEntityEffect(this, (byte) 7);
-@@ -499,7 +499,15 @@
+@@ -562,7 +562,15 @@
while (iterator.hasNext()) {
ItemStack itemstack = (ItemStack) iterator.next();
@@ -35,7 +35,7 @@
}
}
-@@ -529,7 +537,7 @@
+@@ -592,7 +600,7 @@
static class PathfinderGoalTemptChance extends PathfinderGoalTempt {
@Nullable
@@ -44,7 +44,7 @@
private final EntityCat d;
public PathfinderGoalTemptChance(EntityCat entitycat, double d0, RecipeItemStack recipeitemstack, boolean flag) {
-@@ -564,9 +572,9 @@
+@@ -627,9 +635,9 @@
private final EntityCat i;
public a(EntityCat entitycat, Class oclass, float f, double d0, double d1) {
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityChicken.patch b/nms-patches/net/minecraft/world/entity/animal/EntityChicken.patch
index 3f5b53854..5a56e046b 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityChicken.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityChicken.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityChicken.java
-+++ b/net/minecraft/server/EntityChicken.java
-@@ -40,6 +40,11 @@
+--- a/net/minecraft/world/entity/animal/EntityChicken.java
++++ b/net/minecraft/world/entity/animal/EntityChicken.java
+@@ -74,6 +74,11 @@
@Override
public void movementTick() {
@@ -12,7 +12,7 @@
super.movementTick();
this.br = this.bo;
this.bq = this.bp;
-@@ -59,7 +64,9 @@
+@@ -93,7 +98,9 @@
this.bo += this.bs * 2.0F;
if (!this.world.isClientSide && this.isAlive() && !this.isBaby() && !this.isChickenJockey() && --this.eggLayTime <= 0) {
this.playSound(SoundEffects.ENTITY_CHICKEN_EGG, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityCow.patch b/nms-patches/net/minecraft/world/entity/animal/EntityCow.patch
index b65637538..872078adb 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityCow.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityCow.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/EntityCow.java
-+++ b/net/minecraft/server/EntityCow.java
-@@ -1,5 +1,10 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/entity/animal/EntityCow.java
++++ b/net/minecraft/world/entity/animal/EntityCow.java
+@@ -30,6 +30,11 @@
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.level.block.state.IBlockData;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -11,7 +12,7 @@
public class EntityCow extends EntityAnimal {
public EntityCow(EntityTypes extends EntityCow> entitytypes, World world) {
-@@ -52,8 +57,16 @@
+@@ -82,8 +87,16 @@
ItemStack itemstack = entityhuman.b(enumhand);
if (itemstack.getItem() == Items.BUCKET && !this.isBaby()) {
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityDolphin.patch b/nms-patches/net/minecraft/world/entity/animal/EntityDolphin.patch
index 5d27eed5c..dfe01360f 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityDolphin.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityDolphin.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityDolphin.java
-+++ b/net/minecraft/server/EntityDolphin.java
-@@ -109,7 +109,7 @@
+--- a/net/minecraft/world/entity/animal/EntityDolphin.java
++++ b/net/minecraft/world/entity/animal/EntityDolphin.java
+@@ -173,7 +173,7 @@
this.goalSelector.a(8, new EntityDolphin.d());
this.goalSelector.a(8, new PathfinderGoalFollowBoat(this));
this.goalSelector.a(9, new PathfinderGoalAvoidTarget<>(this, EntityGuardian.class, 8.0F, 1.0D, 1.0D));
@@ -9,7 +9,7 @@
}
public static AttributeProvider.Builder eM() {
-@@ -176,6 +176,12 @@
+@@ -240,6 +240,12 @@
ItemStack itemstack = entityitem.getItemStack();
if (this.canPickup(itemstack)) {
@@ -22,7 +22,7 @@
this.a(entityitem);
this.setSlot(EnumItemSlot.MAINHAND, itemstack);
this.dropChanceHand[EnumItemSlot.MAINHAND.b()] = 2.0F;
-@@ -323,7 +329,7 @@
+@@ -387,7 +393,7 @@
@Override
public boolean a() {
@@ -31,7 +31,7 @@
}
@Override
-@@ -432,7 +438,7 @@
+@@ -496,7 +502,7 @@
@Override
public void c() {
@@ -40,7 +40,7 @@
}
@Override
-@@ -451,7 +457,7 @@
+@@ -515,7 +521,7 @@
}
if (this.c.isSwimming() && this.c.world.random.nextInt(6) == 0) {
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityFish.patch b/nms-patches/net/minecraft/world/entity/animal/EntityFish.patch
index bd9ca4850..42a81048f 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityFish.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityFish.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityFish.java
-+++ b/net/minecraft/server/EntityFish.java
-@@ -32,7 +32,7 @@
+--- a/net/minecraft/world/entity/animal/EntityFish.java
++++ b/net/minecraft/world/entity/animal/EntityFish.java
+@@ -70,7 +70,7 @@
@Override
public boolean isTypeNotPersistent(double d0) {
@@ -9,7 +9,7 @@
}
@Override
-@@ -52,6 +52,7 @@
+@@ -90,6 +90,7 @@
public void setFromBucket(boolean flag) {
this.datawatcher.set(EntityFish.FROM_BUCKET, flag);
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityFox.patch b/nms-patches/net/minecraft/world/entity/animal/EntityFox.patch
index 63a201962..b3d471346 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityFox.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityFox.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityFox.java
-+++ b/net/minecraft/server/EntityFox.java
-@@ -264,8 +264,8 @@
+--- a/net/minecraft/world/entity/animal/EntityFox.java
++++ b/net/minecraft/world/entity/animal/EntityFox.java
+@@ -334,8 +334,8 @@
private List fa() {
List list = Lists.newArrayList();
@@ -11,7 +11,7 @@
return list;
}
-@@ -401,7 +401,8 @@
+@@ -471,7 +471,8 @@
protected void b(EntityItem entityitem) {
ItemStack itemstack = entityitem.getItemStack();
@@ -21,7 +21,7 @@
int i = itemstack.getCount();
if (i > 1) {
-@@ -923,6 +924,11 @@
+@@ -993,6 +994,11 @@
int i = (Integer) iblockdata.get(BlockSweetBerryBush.a);
iblockdata.set(BlockSweetBerryBush.a, 1);
@@ -33,7 +33,7 @@
int j = 1 + EntityFox.this.world.random.nextInt(2) + (i == 3 ? 1 : 0);
ItemStack itemstack = EntityFox.this.getEquipment(EnumItemSlot.MAINHAND);
-@@ -962,7 +968,7 @@
+@@ -1032,7 +1038,7 @@
private int f;
public r() {
@@ -42,7 +42,7 @@
this.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK));
}
-@@ -1014,7 +1020,7 @@
+@@ -1084,7 +1090,7 @@
private int c;
public t() {
@@ -51,7 +51,7 @@
this.c = EntityFox.this.random.nextInt(140);
this.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK, PathfinderGoal.Type.JUMP));
}
-@@ -1125,7 +1131,7 @@
+@@ -1195,7 +1201,7 @@
private EntityLiving k;
private int l;
@@ -60,7 +60,7 @@
super(EntityFox.this, oclass, 10, flag, flag1, predicate);
}
-@@ -1205,6 +1211,14 @@
+@@ -1275,6 +1281,14 @@
if (entityplayer1 != null && entityplayer != entityplayer1) {
entityfox.b(entityplayer1.getUniqueID());
}
@@ -75,7 +75,7 @@
if (entityplayer2 != null) {
entityplayer2.a(StatisticList.ANIMALS_BRED);
-@@ -1217,10 +1231,14 @@
+@@ -1287,10 +1301,14 @@
this.partner.resetLove();
entityfox.setAgeRaw(-24000);
entityfox.setPositionRotation(this.animal.locX(), this.animal.locY(), this.animal.locZ(), 0.0F, 0.0F);
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityIronGolem.patch b/nms-patches/net/minecraft/world/entity/animal/EntityIronGolem.patch
index d8e31ccac..81e54c4d9 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityIronGolem.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityIronGolem.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityIronGolem.java
-+++ b/net/minecraft/server/EntityIronGolem.java
-@@ -58,7 +58,7 @@
+--- a/net/minecraft/world/entity/animal/EntityIronGolem.java
++++ b/net/minecraft/world/entity/animal/EntityIronGolem.java
+@@ -104,7 +104,7 @@
@Override
protected void C(Entity entity) {
if (entity instanceof IMonster && !(entity instanceof EntityCreeper) && this.getRandom().nextInt(20) == 0) {
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityMushroomCow.patch b/nms-patches/net/minecraft/world/entity/animal/EntityMushroomCow.patch
index 01309b8ac..58b572d7e 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityMushroomCow.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityMushroomCow.patch
@@ -1,7 +1,7 @@
---- a/net/minecraft/server/EntityMushroomCow.java
-+++ b/net/minecraft/server/EntityMushroomCow.java
-@@ -5,6 +5,11 @@
- import java.util.UUID;
+--- a/net/minecraft/world/entity/animal/EntityMushroomCow.java
++++ b/net/minecraft/world/entity/animal/EntityMushroomCow.java
+@@ -41,6 +41,11 @@
+ import net.minecraft.world.level.block.state.IBlockData;
import org.apache.commons.lang3.tuple.Pair;
+// CraftBukkit start
@@ -12,7 +12,7 @@
public class EntityMushroomCow extends EntityCow implements IShearable {
private static final DataWatcherObject bo = DataWatcher.a(EntityMushroomCow.class, DataWatcherRegistry.d);
-@@ -75,6 +80,11 @@
+@@ -111,6 +116,11 @@
this.playSound(soundeffect, 1.0F, 1.0F);
return EnumInteractionResult.a(this.world.isClientSide);
} else if (itemstack.getItem() == Items.SHEARS && this.canShear()) {
@@ -24,7 +24,7 @@
this.shear(SoundCategory.PLAYERS);
if (!this.world.isClientSide) {
itemstack.damage(1, entityhuman, (entityhuman1) -> {
-@@ -121,7 +131,7 @@
+@@ -157,7 +167,7 @@
this.world.playSound((EntityHuman) null, (Entity) this, SoundEffects.ENTITY_MOOSHROOM_SHEAR, soundcategory, 1.0F, 1.0F);
if (!this.world.s_()) {
((WorldServer) this.world).a(Particles.EXPLOSION, this.locX(), this.e(0.5D), this.locZ(), 1, 0.0D, 0.0D, 0.0D, 0.0D);
@@ -33,7 +33,7 @@
EntityCow entitycow = (EntityCow) EntityTypes.COW.a(this.world);
entitycow.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch);
-@@ -137,7 +147,14 @@
+@@ -173,7 +183,14 @@
}
entitycow.setInvulnerable(this.isInvulnerable());
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityOcelot.patch b/nms-patches/net/minecraft/world/entity/animal/EntityOcelot.patch
index 959492a64..9a12983df 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityOcelot.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityOcelot.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityOcelot.java
-+++ b/net/minecraft/server/EntityOcelot.java
-@@ -81,7 +81,7 @@
+--- a/net/minecraft/world/entity/animal/EntityOcelot.java
++++ b/net/minecraft/world/entity/animal/EntityOcelot.java
+@@ -128,7 +128,7 @@
@Override
public boolean isTypeNotPersistent(double d0) {
@@ -9,7 +9,7 @@
}
public static AttributeProvider.Builder eK() {
-@@ -135,7 +135,8 @@
+@@ -182,7 +182,8 @@
if ((this.br == null || this.br.h()) && !this.isTrusting() && this.k(itemstack) && entityhuman.h((Entity) this) < 9.0D) {
this.a(entityhuman, itemstack);
if (!this.world.isClientSide) {
@@ -19,7 +19,7 @@
this.setTrusting(true);
this.u(true);
this.world.broadcastEntityEffect(this, (byte) 41);
-@@ -243,9 +244,9 @@
+@@ -290,9 +291,9 @@
private final EntityOcelot i;
public a(EntityOcelot entityocelot, Class oclass, float f, double d0, double d1) {
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityPanda.patch b/nms-patches/net/minecraft/world/entity/animal/EntityPanda.patch
index 66dda224b..be5ca253a 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityPanda.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityPanda.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/EntityPanda.java
-+++ b/net/minecraft/server/EntityPanda.java
-@@ -9,6 +9,8 @@
- import java.util.function.Predicate;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/animal/EntityPanda.java
++++ b/net/minecraft/world/entity/animal/EntityPanda.java
+@@ -64,6 +64,8 @@
+ import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.phys.Vec3D;
+import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit
+
public class EntityPanda extends EntityAnimal {
private static final DataWatcherObject bp = DataWatcher.a(EntityPanda.class, DataWatcherRegistry.b);
-@@ -445,7 +447,7 @@
+@@ -500,7 +502,7 @@
@Override
protected void b(EntityItem entityitem) {
@@ -18,7 +18,7 @@
this.a(entityitem);
ItemStack itemstack = entityitem.getItemStack();
-@@ -666,7 +668,7 @@
+@@ -721,7 +723,7 @@
@Override
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
if (entityinsentient instanceof EntityPanda && ((EntityPanda) entityinsentient).isAggressive()) {
@@ -27,7 +27,7 @@
}
}
-@@ -770,9 +772,9 @@
+@@ -825,9 +827,9 @@
private final EntityPanda i;
public c(EntityPanda entitypanda, Class oclass, float f, double d0, double d1) {
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityParrot.patch b/nms-patches/net/minecraft/world/entity/animal/EntityParrot.patch
index cdd56d662..f23b6af94 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityParrot.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityParrot.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityParrot.java
-+++ b/net/minecraft/server/EntityParrot.java
-@@ -20,7 +20,7 @@
+--- a/net/minecraft/world/entity/animal/EntityParrot.java
++++ b/net/minecraft/world/entity/animal/EntityParrot.java
+@@ -74,7 +74,7 @@
};
private static final Item bw = Items.COOKIE;
private static final Set- bx = Sets.newHashSet(new Item[]{Items.WHEAT_SEEDS, Items.MELON_SEEDS, Items.PUMPKIN_SEEDS, Items.BEETROOT_SEEDS});
@@ -9,7 +9,7 @@
hashmap.put(EntityTypes.BLAZE, SoundEffects.ENTITY_PARROT_IMITATE_BLAZE);
hashmap.put(EntityTypes.CAVE_SPIDER, SoundEffects.ENTITY_PARROT_IMITATE_SPIDER);
hashmap.put(EntityTypes.CREEPER, SoundEffects.ENTITY_PARROT_IMITATE_CREEPER);
-@@ -187,7 +187,7 @@
+@@ -241,7 +241,7 @@
}
if (!this.world.isClientSide) {
@@ -18,7 +18,7 @@
this.tame(entityhuman);
this.world.broadcastEntityEffect(this, (byte) 7);
} else {
-@@ -201,7 +201,7 @@
+@@ -255,7 +255,7 @@
itemstack.subtract(1);
}
@@ -27,7 +27,7 @@
if (entityhuman.isCreative() || !this.isInvulnerable()) {
this.damageEntity(DamageSource.playerAttack(entityhuman), Float.MAX_VALUE);
}
-@@ -315,7 +315,7 @@
+@@ -369,7 +369,7 @@
@Override
public boolean isCollidable() {
@@ -36,7 +36,7 @@
}
@Override
-@@ -330,7 +330,7 @@
+@@ -384,7 +384,7 @@
if (this.isInvulnerable(damagesource)) {
return false;
} else {
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityPig.patch b/nms-patches/net/minecraft/world/entity/animal/EntityPig.patch
index 6081ea393..d2a89e790 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityPig.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityPig.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntityPig.java
-+++ b/net/minecraft/server/EntityPig.java
-@@ -3,6 +3,10 @@
- import com.google.common.collect.UnmodifiableIterator;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/animal/EntityPig.java
++++ b/net/minecraft/world/entity/animal/EntityPig.java
+@@ -50,6 +50,10 @@
+ import net.minecraft.world.phys.AxisAlignedBB;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -11,7 +11,7 @@
public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable {
private static final DataWatcherObject bo = DataWatcher.a(EntityPig.class, DataWatcherRegistry.i);
-@@ -204,7 +208,13 @@
+@@ -251,7 +255,13 @@
}
entitypigzombie.setPersistent();
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityPufferFish.patch b/nms-patches/net/minecraft/world/entity/animal/EntityPufferFish.patch
index 10c8f55b7..57abdca9f 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityPufferFish.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityPufferFish.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityPufferFish.java
-+++ b/net/minecraft/server/EntityPufferFish.java
-@@ -114,7 +114,7 @@
+--- a/net/minecraft/world/entity/animal/EntityPufferFish.java
++++ b/net/minecraft/world/entity/animal/EntityPufferFish.java
+@@ -136,7 +136,7 @@
int i = this.getPuffState();
if (entityinsentient.damageEntity(DamageSource.mobAttack(this), (float) (1 + i))) {
@@ -9,7 +9,7 @@
this.playSound(SoundEffects.ENTITY_PUFFER_FISH_STING, 1.0F, 1.0F);
}
-@@ -129,7 +129,7 @@
+@@ -151,7 +151,7 @@
((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.j, 0.0F));
}
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityRabbit.patch b/nms-patches/net/minecraft/world/entity/animal/EntityRabbit.patch
index d6441f14e..b3c1d5a0f 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityRabbit.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityRabbit.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityRabbit.java
-+++ b/net/minecraft/server/EntityRabbit.java
-@@ -17,8 +17,14 @@
+--- a/net/minecraft/world/entity/animal/EntityRabbit.java
++++ b/net/minecraft/world/entity/animal/EntityRabbit.java
+@@ -72,8 +72,14 @@
super(entitytypes, world);
this.bi = new EntityRabbit.ControllerJumpRabbit(this);
this.moveController = new EntityRabbit.ControllerMoveRabbit(this);
@@ -15,7 +15,7 @@
@Override
public void initPathfinder() {
-@@ -285,7 +291,7 @@
+@@ -340,7 +346,7 @@
if (i == 99) {
this.getAttributeInstance(GenericAttributes.ARMOR).setValue(8.0D);
this.goalSelector.a(4, new EntityRabbit.PathfinderGoalKillerRabbitMeleeAttack(this));
@@ -24,7 +24,7 @@
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityWolf.class, true));
if (!this.hasCustomName()) {
-@@ -401,9 +407,23 @@
+@@ -456,9 +462,23 @@
Integer integer = (Integer) iblockdata.get(BlockCarrots.AGE);
if (integer == 0) {
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntitySheep.patch b/nms-patches/net/minecraft/world/entity/animal/EntitySheep.patch
index 7d5a18fbd..bf5167deb 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntitySheep.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntitySheep.patch
@@ -1,10 +1,12 @@
---- a/net/minecraft/server/EntitySheep.java
-+++ b/net/minecraft/server/EntitySheep.java
-@@ -8,10 +8,16 @@
- import java.util.stream.Collectors;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/animal/EntitySheep.java
++++ b/net/minecraft/world/entity/animal/EntitySheep.java
+@@ -60,10 +60,18 @@
+ import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.level.storage.loot.LootTables;
+// CraftBukkit start
++import net.minecraft.world.inventory.InventoryCraftResult;
++import net.minecraft.world.item.Item;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.SheepRegrowWoolEvent;
+import org.bukkit.inventory.InventoryView;
@@ -18,7 +20,7 @@
enummap.put(EnumColor.WHITE, Blocks.WHITE_WOOL);
enummap.put(EnumColor.ORANGE, Blocks.ORANGE_WOOL);
enummap.put(EnumColor.MAGENTA, Blocks.MAGENTA_WOOL);
-@@ -138,6 +144,11 @@
+@@ -190,6 +198,11 @@
if (itemstack.getItem() == Items.SHEARS) {
if (!this.world.isClientSide && this.canShear()) {
@@ -30,7 +32,7 @@
this.shear(SoundCategory.PLAYERS);
itemstack.damage(1, entityhuman, (entityhuman1) -> {
entityhuman1.broadcastItemBreak(enumhand);
-@@ -158,7 +169,9 @@
+@@ -210,7 +223,9 @@
int i = 1 + this.random.nextInt(3);
for (int j = 0; j < i; ++j) {
@@ -40,7 +42,7 @@
if (entityitem != null) {
entityitem.setMot(entityitem.getMot().add((double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (this.random.nextFloat() * 0.05F), (double) ((this.random.nextFloat() - this.random.nextFloat()) * 0.1F)));
-@@ -248,6 +261,12 @@
+@@ -300,6 +315,12 @@
@Override
public void blockEaten() {
@@ -53,7 +55,7 @@
this.setSheared(false);
if (this.isBaby()) {
this.setAge(60);
-@@ -266,7 +285,7 @@
+@@ -318,7 +339,7 @@
EnumColor enumcolor = ((EntitySheep) entityanimal).getColor();
EnumColor enumcolor1 = ((EntitySheep) entityanimal1).getColor();
InventoryCrafting inventorycrafting = a(enumcolor, enumcolor1);
@@ -62,7 +64,7 @@
return recipecrafting.a(inventorycrafting);
}).map(ItemStack::getItem);
-@@ -284,10 +303,18 @@
+@@ -336,10 +357,18 @@
public boolean canUse(EntityHuman entityhuman) {
return false;
}
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntitySnowman.patch b/nms-patches/net/minecraft/world/entity/animal/EntitySnowman.patch
index cad2f2154..b5a55af16 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntitySnowman.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntitySnowman.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntitySnowman.java
-+++ b/net/minecraft/server/EntitySnowman.java
-@@ -2,6 +2,10 @@
-
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/animal/EntitySnowman.java
++++ b/net/minecraft/world/entity/animal/EntitySnowman.java
+@@ -38,6 +38,10 @@
+ import net.minecraft.world.level.block.Blocks;
+ import net.minecraft.world.level.block.state.IBlockData;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -11,7 +11,7 @@
public class EntitySnowman extends EntityGolem implements IShearable, IRangedEntity {
private static final DataWatcherObject b = DataWatcher.a(EntitySnowman.class, DataWatcherRegistry.a);
-@@ -60,7 +64,7 @@
+@@ -96,7 +100,7 @@
int k = MathHelper.floor(this.locZ());
if (this.world.getBiome(new BlockPosition(i, 0, k)).getAdjustedTemperature(new BlockPosition(i, j, k)) > 1.0F) {
@@ -20,7 +20,7 @@
}
if (!this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
-@@ -76,7 +80,7 @@
+@@ -112,7 +116,7 @@
BlockPosition blockposition = new BlockPosition(i, j, k);
if (this.world.getType(blockposition).isAir() && this.world.getBiome(blockposition).getAdjustedTemperature(blockposition) < 0.8F && iblockdata.canPlace(this.world, blockposition)) {
@@ -29,7 +29,7 @@
}
}
}
-@@ -107,6 +111,11 @@
+@@ -143,6 +147,11 @@
ItemStack itemstack = entityhuman.b(enumhand);
if (itemstack.getItem() == Items.SHEARS && this.canShear()) {
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityTurtle.patch b/nms-patches/net/minecraft/world/entity/animal/EntityTurtle.patch
index 1a6b70b44..dcf9afedc 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityTurtle.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityTurtle.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityTurtle.java
-+++ b/net/minecraft/server/EntityTurtle.java
-@@ -252,7 +252,9 @@
+--- a/net/minecraft/world/entity/animal/EntityTurtle.java
++++ b/net/minecraft/world/entity/animal/EntityTurtle.java
+@@ -314,7 +314,9 @@
protected void m() {
super.m();
if (!this.isBaby() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
@@ -10,7 +10,7 @@
}
}
-@@ -279,7 +281,9 @@
+@@ -341,7 +343,9 @@
@Override
public void onLightningStrike(WorldServer worldserver, EntityLightning entitylightning) {
@@ -20,7 +20,7 @@
}
static class g extends NavigationGuardian {
-@@ -438,8 +442,12 @@
+@@ -500,8 +504,12 @@
} else if (this.g.bv > 200) {
World world = this.g.world;
@@ -33,7 +33,7 @@
this.g.setHasEgg(false);
this.g.u(false);
this.g.setLoveTicks(600);
-@@ -519,7 +527,7 @@
+@@ -581,7 +589,7 @@
--this.e;
return false;
} else {
diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityWolf.patch b/nms-patches/net/minecraft/world/entity/animal/EntityWolf.patch
index 6ed6ffad3..33445ac29 100644
--- a/nms-patches/net/minecraft/world/entity/animal/EntityWolf.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/EntityWolf.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntityWolf.java
-+++ b/net/minecraft/server/EntityWolf.java
-@@ -4,6 +4,11 @@
- import java.util.function.Predicate;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/animal/EntityWolf.java
++++ b/net/minecraft/world/entity/animal/EntityWolf.java
+@@ -62,6 +62,11 @@
+ import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -12,7 +12,7 @@
public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable {
private static final DataWatcherObject br = DataWatcher.a(EntityWolf.class, DataWatcherRegistry.i);
-@@ -43,7 +48,7 @@
+@@ -101,7 +106,7 @@
this.goalSelector.a(10, new PathfinderGoalRandomLookaround(this));
this.targetSelector.a(1, new PathfinderGoalOwnerHurtByTarget(this));
this.targetSelector.a(2, new PathfinderGoalOwnerHurtTarget(this));
@@ -21,7 +21,7 @@
this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::a_));
this.targetSelector.a(5, new PathfinderGoalRandomTargetNonTamed<>(this, EntityAnimal.class, false, EntityWolf.bq));
this.targetSelector.a(6, new PathfinderGoalRandomTargetNonTamed<>(this, EntityTurtle.class, false, EntityTurtle.bo));
-@@ -55,6 +60,24 @@
+@@ -113,6 +118,24 @@
return EntityInsentient.p().a(GenericAttributes.MOVEMENT_SPEED, 0.30000001192092896D).a(GenericAttributes.MAX_HEALTH, 8.0D).a(GenericAttributes.ATTACK_DAMAGE, 2.0D);
}
@@ -46,7 +46,7 @@
@Override
protected void initDatawatcher() {
super.initDatawatcher();
-@@ -201,7 +224,7 @@
+@@ -259,7 +282,7 @@
} else {
Entity entity = damagesource.getEntity();
@@ -55,7 +55,7 @@
if (entity != null && !(entity instanceof EntityHuman) && !(entity instanceof EntityArrow)) {
f = (f + 1.0F) / 2.0F;
}
-@@ -226,7 +249,7 @@
+@@ -284,7 +307,7 @@
super.setTamed(flag);
if (flag) {
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(20.0D);
@@ -64,7 +64,7 @@
} else {
this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(8.0D);
}
-@@ -250,7 +273,7 @@
+@@ -308,7 +331,7 @@
itemstack.subtract(1);
}
@@ -73,7 +73,7 @@
return EnumInteractionResult.SUCCESS;
}
-@@ -261,7 +284,7 @@
+@@ -319,7 +342,7 @@
this.setWillSit(!this.isWillSit());
this.jumping = false;
this.navigation.o();
@@ -82,7 +82,7 @@
return EnumInteractionResult.SUCCESS;
}
-@@ -283,7 +306,8 @@
+@@ -341,7 +364,8 @@
itemstack.subtract(1);
}
diff --git a/nms-patches/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.patch b/nms-patches/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.patch
index ab96211ec..089a1a05b 100644
--- a/nms-patches/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/EntityHorseAbstract.java
-+++ b/net/minecraft/server/EntityHorseAbstract.java
-@@ -7,6 +7,8 @@
- import java.util.function.Predicate;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java
++++ b/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java
+@@ -68,6 +68,8 @@
+ import net.minecraft.world.phys.AxisAlignedBB;
+ import net.minecraft.world.phys.Vec3D;
+import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; // CraftBukkit
+
public abstract class EntityHorseAbstract extends EntityAnimal implements IInventoryListener, IJumpable, ISaddleable {
private static final Predicate bw = (entityliving) -> {
-@@ -34,6 +36,7 @@
+@@ -95,6 +97,7 @@
private float bK;
protected boolean bu = true;
protected int bv;
@@ -17,7 +17,7 @@
protected EntityHorseAbstract(EntityTypes extends EntityHorseAbstract> entitytypes, World world) {
super(entitytypes, world);
-@@ -218,7 +221,7 @@
+@@ -279,7 +282,7 @@
public void loadChest() {
InventorySubcontainer inventorysubcontainer = this.inventoryChest;
@@ -26,7 +26,7 @@
if (inventorysubcontainer != null) {
inventorysubcontainer.b((IInventoryListener) this);
int i = Math.min(inventorysubcontainer.getSize(), this.inventoryChest.getSize());
-@@ -334,7 +337,7 @@
+@@ -395,7 +398,7 @@
}
public int getMaxDomestication() {
@@ -35,7 +35,7 @@
}
@Override
-@@ -405,7 +408,7 @@
+@@ -466,7 +469,7 @@
}
if (this.getHealth() < this.getMaxHealth() && f > 0.0F) {
@@ -44,7 +44,7 @@
flag = true;
}
-@@ -481,7 +484,7 @@
+@@ -542,7 +545,7 @@
super.movementTick();
if (!this.world.isClientSide && this.isAlive()) {
if (this.random.nextInt(900) == 0 && this.deathTicks == 0) {
@@ -53,7 +53,7 @@
}
if (this.fl()) {
-@@ -718,6 +721,7 @@
+@@ -779,6 +782,7 @@
if (this.getOwnerUUID() != null) {
nbttagcompound.a("Owner", this.getOwnerUUID());
}
@@ -61,7 +61,7 @@
if (!this.inventoryChest.getItem(0).isEmpty()) {
nbttagcompound.set("SaddleItem", this.inventoryChest.getItem(0).save(new NBTTagCompound()));
-@@ -745,6 +749,11 @@
+@@ -806,6 +810,11 @@
if (uuid != null) {
this.setOwnerUUID(uuid);
}
@@ -73,7 +73,7 @@
if (nbttagcompound.hasKeyOfType("SaddleItem", 10)) {
ItemStack itemstack = ItemStack.a(nbttagcompound.getCompound("SaddleItem"));
-@@ -796,6 +805,18 @@
+@@ -857,6 +866,18 @@
@Override
public void b(int i) {
diff --git a/nms-patches/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.patch b/nms-patches/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.patch
index 17901f95a..80fcec46d 100644
--- a/nms-patches/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityLlamaTrader.java
-+++ b/net/minecraft/server/EntityLlamaTrader.java
-@@ -127,7 +127,7 @@
+--- a/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.java
++++ b/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.java
+@@ -143,7 +143,7 @@
@Override
public void c() {
diff --git a/nms-patches/net/minecraft/world/entity/animal/horse/PathfinderGoalHorseTrap.patch b/nms-patches/net/minecraft/world/entity/animal/horse/PathfinderGoalHorseTrap.patch
index 85c0858fb..d991c6e88 100644
--- a/nms-patches/net/minecraft/world/entity/animal/horse/PathfinderGoalHorseTrap.patch
+++ b/nms-patches/net/minecraft/world/entity/animal/horse/PathfinderGoalHorseTrap.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PathfinderGoalHorseTrap.java
-+++ b/net/minecraft/server/PathfinderGoalHorseTrap.java
-@@ -25,19 +25,20 @@
+--- a/net/minecraft/world/entity/animal/horse/PathfinderGoalHorseTrap.java
++++ b/net/minecraft/world/entity/animal/horse/PathfinderGoalHorseTrap.java
+@@ -40,19 +40,20 @@
entitylightning.teleportAndSync(this.a.locX(), this.a.locY(), this.a.locZ());
entitylightning.setEffect(true);
diff --git a/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.patch b/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.patch
index a8997bc4e..36322cd68 100644
--- a/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.patch
+++ b/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntityEnderCrystal.java
-+++ b/net/minecraft/server/EntityEnderCrystal.java
-@@ -3,6 +3,11 @@
- import java.util.Optional;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java
++++ b/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java
+@@ -20,6 +20,11 @@
+ import net.minecraft.world.level.block.BlockFireAbstract;
+ import net.minecraft.world.level.dimension.end.EnderDragonBattle;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -12,7 +12,7 @@
public class EntityEnderCrystal extends Entity {
private static final DataWatcherObject> c = DataWatcher.a(EntityEnderCrystal.class, DataWatcherRegistry.m);
-@@ -38,7 +43,11 @@
+@@ -55,7 +60,11 @@
BlockPosition blockposition = this.getChunkCoordinates();
if (((WorldServer) this.world).getDragonBattle() != null && this.world.getType(blockposition).isAir()) {
@@ -25,7 +25,7 @@
}
}
-@@ -78,9 +87,22 @@
+@@ -95,9 +104,22 @@
return false;
} else {
if (!this.dead && !this.world.isClientSide) {
diff --git a/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.patch b/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.patch
index 534f75c06..971b00436 100644
--- a/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.patch
+++ b/nms-patches/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.patch
@@ -1,10 +1,15 @@
---- a/net/minecraft/server/EntityEnderDragon.java
-+++ b/net/minecraft/server/EntityEnderDragon.java
-@@ -7,6 +7,12 @@
+--- a/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
++++ b/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
+@@ -51,6 +51,17 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
++import net.minecraft.world.item.ItemStack;
++import net.minecraft.world.level.Explosion;
++import net.minecraft.world.level.block.entity.TileEntity;
++import net.minecraft.world.level.storage.loot.LootTableInfo;
++import net.minecraft.world.level.storage.loot.parameters.LootContextParameters;
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.event.entity.EntityExplodeEvent;
+import org.bukkit.event.entity.EntityRegainHealthEvent;
@@ -13,7 +18,7 @@
public class EntityEnderDragon extends EntityInsentient implements IMonster {
private static final Logger LOGGER = LogManager.getLogger();
-@@ -38,6 +44,7 @@
+@@ -82,6 +93,7 @@
private final PathPoint[] bJ = new PathPoint[24];
private final int[] bK = new int[24];
private final Path bL = new Path();
@@ -21,7 +26,7 @@
public EntityEnderDragon(EntityTypes extends EntityEnderDragon> entitytypes, World world) {
super(EntityTypes.ENDER_DRAGON, world);
-@@ -175,7 +182,7 @@
+@@ -219,7 +231,7 @@
Vec3D vec3d1 = idragoncontroller.g();
@@ -30,7 +35,7 @@
d0 = vec3d1.x - this.locX();
d1 = vec3d1.y - this.locY();
d2 = vec3d1.z - this.locZ();
-@@ -313,7 +320,14 @@
+@@ -357,7 +369,14 @@
if (this.currentEnderCrystal.dead) {
this.currentEnderCrystal = null;
} else if (this.ticksLived % 10 == 0 && this.getHealth() < this.getMaxHealth()) {
@@ -46,7 +51,7 @@
}
}
-@@ -388,6 +402,9 @@
+@@ -432,6 +451,9 @@
int j1 = MathHelper.floor(axisalignedbb.maxZ);
boolean flag = false;
boolean flag1 = false;
@@ -56,7 +61,7 @@
for (int k1 = i; k1 <= l; ++k1) {
for (int l1 = j; l1 <= i1; ++l1) {
-@@ -398,7 +415,11 @@
+@@ -442,7 +464,11 @@
if (!iblockdata.isAir() && iblockdata.getMaterial() != Material.FIRE) {
if (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) && !TagsBlock.DRAGON_IMMUNE.isTagged(block)) {
@@ -69,7 +74,7 @@
} else {
flag = true;
}
-@@ -407,6 +428,51 @@
+@@ -451,6 +477,51 @@
}
}
diff --git a/nms-patches/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.patch b/nms-patches/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.patch
index 3ea1dc2c0..934df4683 100644
--- a/nms-patches/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.patch
+++ b/nms-patches/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/DragonControllerManager.java
-+++ b/net/minecraft/server/DragonControllerManager.java
-@@ -3,6 +3,11 @@
+--- a/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.java
++++ b/net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager.java
+@@ -4,6 +4,11 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -12,7 +12,7 @@
public class DragonControllerManager {
private static final Logger LOGGER = LogManager.getLogger();
-@@ -21,6 +26,19 @@
+@@ -22,6 +27,19 @@
this.currentDragonController.e();
}
@@ -32,7 +32,7 @@
this.currentDragonController = this.b(dragoncontrollerphase);
if (!this.enderDragon.world.isClientSide) {
this.enderDragon.getDataWatcher().set(EntityEnderDragon.PHASE, dragoncontrollerphase.b());
-@@ -42,6 +60,6 @@
+@@ -43,6 +61,6 @@
this.dragonControllers[i] = dragoncontrollerphase.a(this.enderDragon);
}
diff --git a/nms-patches/net/minecraft/world/entity/boss/wither/EntityWither.patch b/nms-patches/net/minecraft/world/entity/boss/wither/EntityWither.patch
index 5e1db61a8..d1b222dc1 100644
--- a/nms-patches/net/minecraft/world/entity/boss/wither/EntityWither.patch
+++ b/nms-patches/net/minecraft/world/entity/boss/wither/EntityWither.patch
@@ -1,10 +1,14 @@
---- a/net/minecraft/server/EntityWither.java
-+++ b/net/minecraft/server/EntityWither.java
-@@ -6,6 +6,13 @@
- import java.util.function.Predicate;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/boss/wither/EntityWither.java
++++ b/net/minecraft/world/entity/boss/wither/EntityWither.java
+@@ -52,6 +52,17 @@
+ import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
++import net.minecraft.network.protocol.game.PacketPlayOutWorldEvent;
++import net.minecraft.server.MinecraftServer;
++import net.minecraft.server.level.WorldServer;
++import net.minecraft.world.level.block.Blocks;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityRegainHealthEvent;
+import org.bukkit.event.entity.EntityTargetEvent;
@@ -14,7 +18,7 @@
public class EntityWither extends EntityMonster implements IRangedEntity {
private static final DataWatcherObject b = DataWatcher.a(EntityWither.class, DataWatcherRegistry.b);
-@@ -188,16 +195,40 @@
+@@ -234,16 +245,40 @@
i = this.getInvul() - 1;
if (i <= 0) {
Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
@@ -58,7 +62,7 @@
}
} else {
-@@ -249,9 +280,11 @@
+@@ -295,9 +330,11 @@
if (entityliving != this && entityliving.isAlive() && this.hasLineOfSight(entityliving)) {
if (entityliving instanceof EntityHuman) {
if (!((EntityHuman) entityliving).abilities.isInvulnerable) {
@@ -70,7 +74,7 @@
this.setHeadTarget(i, entityliving.getId());
}
break;
-@@ -287,6 +320,11 @@
+@@ -333,6 +370,11 @@
IBlockData iblockdata = this.world.getType(blockposition);
if (c(iblockdata)) {
@@ -82,7 +86,7 @@
flag = this.world.a(blockposition, true, this) || flag;
}
}
-@@ -300,7 +338,7 @@
+@@ -346,7 +388,7 @@
}
if (this.ticksLived % 20 == 0) {
diff --git a/nms-patches/net/minecraft/world/entity/decoration/EntityArmorStand.patch b/nms-patches/net/minecraft/world/entity/decoration/EntityArmorStand.patch
index 4351c5c4e..5dfc25bcc 100644
--- a/nms-patches/net/minecraft/world/entity/decoration/EntityArmorStand.patch
+++ b/nms-patches/net/minecraft/world/entity/decoration/EntityArmorStand.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntityArmorStand.java
-+++ b/net/minecraft/server/EntityArmorStand.java
-@@ -5,6 +5,15 @@
- import java.util.function.Predicate;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/decoration/EntityArmorStand.java
++++ b/net/minecraft/world/entity/decoration/EntityArmorStand.java
+@@ -39,6 +39,15 @@
+ import net.minecraft.world.level.material.EnumPistonReaction;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.inventory.EquipmentSlot;
@@ -16,7 +16,7 @@
public class EntityArmorStand extends EntityLiving {
private static final Vector3f bj = new Vector3f(0.0F, 0.0F, 0.0F);
-@@ -55,6 +64,13 @@
+@@ -89,6 +98,13 @@
this.setPosition(d0, d1, d2);
}
@@ -30,7 +30,7 @@
@Override
public void updateSize() {
double d0 = this.locX();
-@@ -110,13 +126,20 @@
+@@ -144,13 +160,20 @@
@Override
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
@@ -53,7 +53,7 @@
this.armorItems.set(enumitemslot.b(), itemstack);
}
-@@ -383,6 +406,21 @@
+@@ -417,6 +440,21 @@
return false;
} else {
ItemStack itemstack2;
@@ -75,7 +75,7 @@
if (entityhuman.abilities.canInstantlyBuild && itemstack1.isEmpty() && !itemstack.isEmpty()) {
itemstack2 = itemstack.cloneItemStack();
-@@ -411,12 +449,22 @@
+@@ -445,12 +483,22 @@
public boolean damageEntity(DamageSource damagesource, float f) {
if (!this.world.isClientSide && !this.dead) {
if (DamageSource.OUT_OF_WORLD.equals(damagesource)) {
@@ -101,7 +101,7 @@
return false;
} else if (DamageSource.FIRE.equals(damagesource)) {
if (this.isBurning()) {
-@@ -441,7 +489,7 @@
+@@ -475,7 +523,7 @@
} else if (damagesource.v()) {
this.F();
this.D();
@@ -110,7 +110,7 @@
return flag1;
} else {
long i = this.world.getTime();
-@@ -452,7 +500,7 @@
+@@ -486,7 +534,7 @@
} else {
this.f(damagesource);
this.D();
@@ -119,7 +119,7 @@
}
return true;
-@@ -479,7 +527,7 @@
+@@ -513,7 +561,7 @@
f1 -= f;
if (f1 <= 0.5F) {
this.g(damagesource);
@@ -128,7 +128,7 @@
} else {
this.setHealth(f1);
}
-@@ -487,13 +535,13 @@
+@@ -521,13 +569,13 @@
}
private void f(DamageSource damagesource) {
@@ -144,7 +144,7 @@
ItemStack itemstack;
int i;
-@@ -501,7 +549,7 @@
+@@ -535,7 +583,7 @@
for (i = 0; i < this.handItems.size(); ++i) {
itemstack = (ItemStack) this.handItems.get(i);
if (!itemstack.isEmpty()) {
@@ -153,7 +153,7 @@
this.handItems.set(i, ItemStack.b);
}
}
-@@ -509,10 +557,11 @@
+@@ -543,10 +591,11 @@
for (i = 0; i < this.armorItems.size(); ++i) {
itemstack = (ItemStack) this.armorItems.get(i);
if (!itemstack.isEmpty()) {
@@ -166,7 +166,7 @@
}
-@@ -613,8 +662,16 @@
+@@ -647,8 +696,16 @@
return this.isSmall();
}
diff --git a/nms-patches/net/minecraft/world/entity/decoration/EntityHanging.patch b/nms-patches/net/minecraft/world/entity/decoration/EntityHanging.patch
index fdb1b7227..b4fe187b9 100644
--- a/nms-patches/net/minecraft/world/entity/decoration/EntityHanging.patch
+++ b/nms-patches/net/minecraft/world/entity/decoration/EntityHanging.patch
@@ -1,10 +1,12 @@
---- a/net/minecraft/server/EntityHanging.java
-+++ b/net/minecraft/server/EntityHanging.java
-@@ -4,6 +4,12 @@
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/decoration/EntityHanging.java
++++ b/net/minecraft/world/entity/decoration/EntityHanging.java
+@@ -24,6 +24,14 @@
+ import net.minecraft.world.phys.Vec3D;
import org.apache.commons.lang3.Validate;
+// CraftBukkit start
++import net.minecraft.world.damagesource.EntityDamageSourceIndirect;
++import net.minecraft.world.level.material.Material;
+import org.bukkit.entity.Hanging;
+import org.bukkit.event.hanging.HangingBreakByEntityEvent;
+import org.bukkit.event.hanging.HangingBreakEvent;
@@ -13,7 +15,7 @@
public abstract class EntityHanging extends Entity {
protected static final Predicate b = (entity) -> {
-@@ -37,26 +43,37 @@
+@@ -57,26 +65,37 @@
protected void updateBoundingBox() {
if (this.direction != null) {
@@ -64,7 +66,7 @@
d8 = 1.0D;
} else {
d6 = 1.0D;
-@@ -65,11 +82,12 @@
+@@ -85,11 +104,12 @@
d6 /= 32.0D;
d7 /= 32.0D;
d8 /= 32.0D;
@@ -79,7 +81,7 @@
return i % 32 == 0 ? 0.5D : 0.0D;
}
-@@ -83,6 +101,24 @@
+@@ -103,6 +123,24 @@
if (this.e++ == 100) {
this.e = 0;
if (!this.dead && !this.survives()) {
@@ -104,7 +106,7 @@
this.die();
this.a((Entity) null);
}
-@@ -146,6 +182,22 @@
+@@ -166,6 +204,22 @@
return false;
} else {
if (!this.dead && !this.world.isClientSide) {
@@ -127,7 +129,7 @@
this.die();
this.velocityChanged();
this.a(damagesource.getEntity());
-@@ -158,6 +210,18 @@
+@@ -178,6 +232,18 @@
@Override
public void move(EnumMoveType enummovetype, Vec3D vec3d) {
if (!this.world.isClientSide && !this.dead && vec3d.g() > 0.0D) {
@@ -146,7 +148,7 @@
this.die();
this.a((Entity) null);
}
-@@ -166,7 +230,7 @@
+@@ -186,7 +252,7 @@
@Override
public void i(double d0, double d1, double d2) {
diff --git a/nms-patches/net/minecraft/world/entity/decoration/EntityItemFrame.patch b/nms-patches/net/minecraft/world/entity/decoration/EntityItemFrame.patch
index 13cff21e3..e299ef2ee 100644
--- a/nms-patches/net/minecraft/world/entity/decoration/EntityItemFrame.patch
+++ b/nms-patches/net/minecraft/world/entity/decoration/EntityItemFrame.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityItemFrame.java
-+++ b/net/minecraft/server/EntityItemFrame.java
-@@ -53,16 +53,27 @@
+--- a/net/minecraft/world/entity/decoration/EntityItemFrame.java
++++ b/net/minecraft/world/entity/decoration/EntityItemFrame.java
+@@ -83,16 +83,27 @@
@Override
protected void updateBoundingBox() {
if (this.direction != null) {
@@ -37,7 +37,7 @@
switch (enumdirection_enumaxis) {
case X:
-@@ -78,9 +89,10 @@
+@@ -108,9 +119,10 @@
d4 /= 32.0D;
d5 /= 32.0D;
d6 /= 32.0D;
@@ -49,7 +49,7 @@
@Override
public boolean survives() {
-@@ -130,6 +142,11 @@
+@@ -160,6 +172,11 @@
return false;
} else if (!damagesource.isExplosion() && !this.getItem().isEmpty()) {
if (!this.world.isClientSide) {
@@ -61,7 +61,7 @@
this.b(damagesource.getEntity(), false);
this.playSound(SoundEffects.ENTITY_ITEM_FRAME_REMOVE_ITEM, 1.0F, 1.0F);
}
-@@ -217,6 +234,12 @@
+@@ -247,6 +264,12 @@
}
public void setItem(ItemStack itemstack, boolean flag) {
@@ -74,7 +74,7 @@
if (!itemstack.isEmpty()) {
itemstack = itemstack.cloneItemStack();
itemstack.setCount(1);
-@@ -224,7 +247,7 @@
+@@ -254,7 +277,7 @@
}
this.getDataWatcher().set(EntityItemFrame.ITEM, itemstack);
diff --git a/nms-patches/net/minecraft/world/entity/decoration/EntityLeash.patch b/nms-patches/net/minecraft/world/entity/decoration/EntityLeash.patch
index a6ef65309..e1e7fb8e1 100644
--- a/nms-patches/net/minecraft/world/entity/decoration/EntityLeash.patch
+++ b/nms-patches/net/minecraft/world/entity/decoration/EntityLeash.patch
@@ -1,15 +1,20 @@
---- a/net/minecraft/server/EntityLeash.java
-+++ b/net/minecraft/server/EntityLeash.java
-@@ -4,6 +4,8 @@
- import java.util.List;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/decoration/EntityLeash.java
++++ b/net/minecraft/world/entity/decoration/EntityLeash.java
+@@ -23,6 +23,13 @@
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.phys.AxisAlignedBB;
-+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
++// CraftBukkit start
++import net.minecraft.network.protocol.game.PacketPlayOutAttachEntity;
++import net.minecraft.server.level.EntityPlayer;
++import net.minecraft.server.level.WorldServer;
++import org.bukkit.craftbukkit.event.CraftEventFactory;
++// CraftBukkit end
+
public class EntityLeash extends EntityHanging {
public EntityLeash(EntityTypes extends EntityLeash> entitytypes, World world) {
-@@ -29,6 +31,7 @@
+@@ -48,6 +55,7 @@
@Override
protected void updateBoundingBox() {
this.setPositionRaw((double) this.blockPosition.getX() + 0.5D, (double) this.blockPosition.getY() + 0.5D, (double) this.blockPosition.getZ() + 0.5D);
@@ -17,7 +22,7 @@
}
@Override
-@@ -75,22 +78,42 @@
+@@ -94,22 +102,42 @@
while (iterator.hasNext()) {
entityinsentient = (EntityInsentient) iterator.next();
if (entityinsentient.getLeashHolder() == entityhuman) {
diff --git a/nms-patches/net/minecraft/world/entity/decoration/EntityPainting.patch b/nms-patches/net/minecraft/world/entity/decoration/EntityPainting.patch
index db5b520be..23de005ae 100644
--- a/nms-patches/net/minecraft/world/entity/decoration/EntityPainting.patch
+++ b/nms-patches/net/minecraft/world/entity/decoration/EntityPainting.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityPainting.java
-+++ b/net/minecraft/server/EntityPainting.java
-@@ -11,6 +11,10 @@
+--- a/net/minecraft/world/entity/decoration/EntityPainting.java
++++ b/net/minecraft/world/entity/decoration/EntityPainting.java
+@@ -26,6 +26,10 @@
public EntityPainting(EntityTypes extends EntityPainting> entitytypes, World world) {
super(entitytypes, world);
diff --git a/nms-patches/net/minecraft/world/entity/item/EntityFallingBlock.patch b/nms-patches/net/minecraft/world/entity/item/EntityFallingBlock.patch
index 3de850e79..af437d19f 100644
--- a/nms-patches/net/minecraft/world/entity/item/EntityFallingBlock.patch
+++ b/nms-patches/net/minecraft/world/entity/item/EntityFallingBlock.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/EntityFallingBlock.java
-+++ b/net/minecraft/server/EntityFallingBlock.java
-@@ -4,6 +4,8 @@
- import java.util.Iterator;
- import java.util.List;
+--- a/net/minecraft/world/entity/item/EntityFallingBlock.java
++++ b/net/minecraft/world/entity/item/EntityFallingBlock.java
+@@ -43,6 +43,8 @@
+ import net.minecraft.world.phys.MovingObjectPositionBlock;
+ import net.minecraft.world.phys.Vec3D;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class EntityFallingBlock extends Entity {
private IBlockData block;
-@@ -70,7 +72,7 @@
+@@ -109,7 +111,7 @@
if (this.ticksLived++ == 0) {
blockposition = this.getChunkCoordinates();
@@ -18,7 +18,7 @@
this.world.a(blockposition, false);
} else if (!this.world.isClientSide) {
this.die();
-@@ -122,6 +124,11 @@
+@@ -161,6 +163,11 @@
this.block = (IBlockData) this.block.set(BlockProperties.C, true);
}
@@ -30,7 +30,7 @@
if (this.world.setTypeAndData(blockposition, this.block, 3)) {
if (block instanceof BlockFalling) {
((BlockFalling) block).a(this.world, blockposition, this.block, iblockdata, this);
-@@ -178,7 +185,9 @@
+@@ -217,7 +224,9 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
diff --git a/nms-patches/net/minecraft/world/entity/item/EntityItem.patch b/nms-patches/net/minecraft/world/entity/item/EntityItem.patch
index fb3057ad1..2ac6f4bec 100644
--- a/nms-patches/net/minecraft/world/entity/item/EntityItem.patch
+++ b/nms-patches/net/minecraft/world/entity/item/EntityItem.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/EntityItem.java
-+++ b/net/minecraft/server/EntityItem.java
-@@ -6,6 +6,11 @@
- import java.util.UUID;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/item/EntityItem.java
++++ b/net/minecraft/world/entity/item/EntityItem.java
+@@ -31,6 +31,12 @@
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
++import net.minecraft.server.MinecraftServer;
+import org.bukkit.event.entity.EntityPickupItemEvent;
+import org.bukkit.event.player.PlayerPickupItemEvent;
+// CraftBukkit end
@@ -12,7 +13,7 @@
public class EntityItem extends Entity {
private static final DataWatcherObject ITEM = DataWatcher.a(EntityItem.class, DataWatcherRegistry.g);
-@@ -15,6 +20,7 @@
+@@ -40,6 +46,7 @@
private UUID thrower;
private UUID owner;
public final float b;
@@ -20,7 +21,7 @@
public EntityItem(EntityTypes extends EntityItem> entitytypes, World world) {
super(entitytypes, world);
-@@ -50,9 +56,12 @@
+@@ -75,9 +82,12 @@
this.die();
} else {
super.tick();
@@ -36,7 +37,7 @@
this.lastX = this.locX();
this.lastY = this.locY();
-@@ -108,9 +117,11 @@
+@@ -133,9 +143,11 @@
}
}
@@ -48,7 +49,7 @@
this.impulse |= this.aK();
if (!this.world.isClientSide) {
-@@ -122,6 +133,12 @@
+@@ -147,6 +159,12 @@
}
if (!this.world.isClientSide && this.age >= 6000) {
@@ -61,7 +62,7 @@
this.die();
}
-@@ -197,10 +214,11 @@
+@@ -222,10 +240,11 @@
private static void a(EntityItem entityitem, ItemStack itemstack, ItemStack itemstack1) {
ItemStack itemstack2 = a(itemstack, itemstack1, 64);
@@ -74,7 +75,7 @@
a(entityitem, itemstack, itemstack1);
entityitem.pickupDelay = Math.max(entityitem.pickupDelay, entityitem1.pickupDelay);
entityitem.age = Math.min(entityitem.age, entityitem1.age);
-@@ -224,6 +242,11 @@
+@@ -249,6 +268,11 @@
} else if (!this.getItemStack().getItem().a(damagesource)) {
return false;
} else {
@@ -86,7 +87,7 @@
this.velocityChanged();
this.f = (int) ((float) this.f - f);
if (this.f <= 0) {
-@@ -285,6 +308,46 @@
+@@ -310,6 +334,46 @@
Item item = itemstack.getItem();
int i = itemstack.getCount();
@@ -133,7 +134,7 @@
if (this.pickupDelay == 0 && (this.owner == null || this.owner.equals(entityhuman.getUniqueID())) && entityhuman.inventory.pickup(itemstack)) {
entityhuman.receive(this, i);
if (itemstack.isEmpty()) {
-@@ -328,7 +391,9 @@
+@@ -353,7 +417,9 @@
}
public void setItemStack(ItemStack itemstack) {
diff --git a/nms-patches/net/minecraft/world/entity/item/EntityTNTPrimed.patch b/nms-patches/net/minecraft/world/entity/item/EntityTNTPrimed.patch
index e30d8ca03..395b4f603 100644
--- a/nms-patches/net/minecraft/world/entity/item/EntityTNTPrimed.patch
+++ b/nms-patches/net/minecraft/world/entity/item/EntityTNTPrimed.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntityTNTPrimed.java
-+++ b/net/minecraft/server/EntityTNTPrimed.java
-@@ -2,12 +2,16 @@
-
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/item/EntityTNTPrimed.java
++++ b/net/minecraft/world/entity/item/EntityTNTPrimed.java
+@@ -17,12 +17,16 @@
+ import net.minecraft.world.level.Explosion;
+ import net.minecraft.world.level.World;
+import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
+
@@ -17,7 +17,7 @@
public EntityTNTPrimed(EntityTypes extends EntityTNTPrimed> entitytypes, World world) {
super(entitytypes, world);
-@@ -57,10 +61,13 @@
+@@ -72,10 +76,13 @@
--this.fuseTicks;
if (this.fuseTicks <= 0) {
@@ -32,7 +32,7 @@
} else {
this.aK();
if (this.world.isClientSide) {
-@@ -71,9 +78,16 @@
+@@ -86,9 +93,16 @@
}
private void explode() {
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityCaveSpider.patch b/nms-patches/net/minecraft/world/entity/monster/EntityCaveSpider.patch
index 5bffc53bb..aef0d4e31 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityCaveSpider.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityCaveSpider.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityCaveSpider.java
-+++ b/net/minecraft/server/EntityCaveSpider.java
-@@ -25,7 +25,7 @@
+--- a/net/minecraft/world/entity/monster/EntityCaveSpider.java
++++ b/net/minecraft/world/entity/monster/EntityCaveSpider.java
+@@ -41,7 +41,7 @@
}
if (b0 > 0) {
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityCreeper.patch b/nms-patches/net/minecraft/world/entity/monster/EntityCreeper.patch
index ed6fe58a7..58d67c548 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityCreeper.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityCreeper.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntityCreeper.java
-+++ b/net/minecraft/server/EntityCreeper.java
-@@ -3,6 +3,12 @@
- import java.util.Collection;
- import java.util.Iterator;
+--- a/net/minecraft/world/entity/monster/EntityCreeper.java
++++ b/net/minecraft/world/entity/monster/EntityCreeper.java
+@@ -38,6 +38,12 @@
+ import net.minecraft.world.level.IMaterial;
+ import net.minecraft.world.level.World;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -13,7 +13,7 @@
public class EntityCreeper extends EntityMonster {
private static final DataWatcherObject b = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.b);
-@@ -165,9 +171,19 @@
+@@ -200,9 +206,19 @@
@Override
public void onLightningStrike(WorldServer worldserver, EntityLightning entitylightning) {
super.onLightningStrike(worldserver, entitylightning);
@@ -34,7 +34,7 @@
@Override
protected EnumInteractionResult b(EntityHuman entityhuman, EnumHand enumhand) {
ItemStack itemstack = entityhuman.b(enumhand);
-@@ -192,10 +208,18 @@
+@@ -227,10 +243,18 @@
Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
float f = this.isPowered() ? 2.0F : 1.0F;
@@ -57,7 +57,7 @@
}
}
-@@ -206,6 +230,7 @@
+@@ -241,6 +265,7 @@
if (!collection.isEmpty()) {
EntityAreaEffectCloud entityareaeffectcloud = new EntityAreaEffectCloud(this.world, this.locX(), this.locY(), this.locZ());
@@ -65,7 +65,7 @@
entityareaeffectcloud.setRadius(2.5F);
entityareaeffectcloud.setRadiusOnUse(-0.5F);
entityareaeffectcloud.setWaitTime(10);
-@@ -219,7 +244,7 @@
+@@ -254,7 +279,7 @@
entityareaeffectcloud.addEffect(new MobEffect(mobeffect));
}
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityEnderman.patch b/nms-patches/net/minecraft/world/entity/monster/EntityEnderman.patch
index 5dbd84058..d6ce5ff37 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityEnderman.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityEnderman.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityEnderman.java
-+++ b/net/minecraft/server/EntityEnderman.java
-@@ -51,7 +51,17 @@
+--- a/net/minecraft/world/entity/monster/EntityEnderman.java
++++ b/net/minecraft/world/entity/monster/EntityEnderman.java
+@@ -105,7 +105,17 @@
@Override
public void setGoalTarget(@Nullable EntityLiving entityliving) {
@@ -19,7 +19,7 @@
AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
if (entityliving == null) {
-@@ -66,6 +76,7 @@
+@@ -120,6 +130,7 @@
attributemodifiable.b(EntityEnderman.c);
}
}
@@ -27,7 +27,7 @@
}
-@@ -359,8 +370,12 @@
+@@ -413,8 +424,12 @@
boolean flag = movingobjectpositionblock.getBlockPosition().equals(blockposition);
if (block.a((Tag) TagsBlock.ENDERMAN_HOLDABLE) && flag) {
@@ -42,7 +42,7 @@
}
}
-@@ -395,8 +410,12 @@
+@@ -449,8 +464,12 @@
if (iblockdata2 != null) {
iblockdata2 = Block.b(iblockdata2, (GeneratorAccess) this.a.world, blockposition);
if (this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) {
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityGhast.patch b/nms-patches/net/minecraft/world/entity/monster/EntityGhast.patch
index 07b2616fb..449e83901 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityGhast.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityGhast.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityGhast.java
-+++ b/net/minecraft/server/EntityGhast.java
-@@ -163,7 +163,8 @@
+--- a/net/minecraft/world/entity/monster/EntityGhast.java
++++ b/net/minecraft/world/entity/monster/EntityGhast.java
+@@ -193,7 +193,8 @@
EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.ghast, d2, d3, d4);
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityGuardianElder.patch b/nms-patches/net/minecraft/world/entity/monster/EntityGuardianElder.patch
index 9dcb957bd..fc6007b1a 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityGuardianElder.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityGuardianElder.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityGuardianElder.java
-+++ b/net/minecraft/server/EntityGuardianElder.java
-@@ -65,7 +65,7 @@
+--- a/net/minecraft/world/entity/monster/EntityGuardianElder.java
++++ b/net/minecraft/world/entity/monster/EntityGuardianElder.java
+@@ -79,7 +79,7 @@
if (!entityplayer.hasEffect(mobeffectlist) || entityplayer.getEffect(mobeffectlist).getAmplifier() < 2 || entityplayer.getEffect(mobeffectlist).getDuration() < 1200) {
entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.k, this.isSilent() ? 0.0F : 1.0F));
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityIllagerIllusioner.patch b/nms-patches/net/minecraft/world/entity/monster/EntityIllagerIllusioner.patch
index 88c538872..32b229536 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityIllagerIllusioner.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityIllagerIllusioner.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityIllagerIllusioner.java
-+++ b/net/minecraft/server/EntityIllagerIllusioner.java
-@@ -30,7 +30,7 @@
+--- a/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java
++++ b/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java
+@@ -67,7 +67,7 @@
this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D));
this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F));
this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F));
@@ -9,7 +9,7 @@
this.targetSelector.a(2, (new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)).a(300));
this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)).a(300));
this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, false)).a(300));
-@@ -169,7 +169,7 @@
+@@ -206,7 +206,7 @@
@Override
protected void j() {
@@ -18,7 +18,7 @@
}
@Override
-@@ -206,7 +206,7 @@
+@@ -243,7 +243,7 @@
@Override
protected void j() {
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityIllagerWizard.patch b/nms-patches/net/minecraft/world/entity/monster/EntityIllagerWizard.patch
index 403b29719..cbbc280b3 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityIllagerWizard.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityIllagerWizard.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityIllagerWizard.java
-+++ b/net/minecraft/server/EntityIllagerWizard.java
-@@ -145,6 +145,11 @@
+--- a/net/minecraft/world/entity/monster/EntityIllagerWizard.java
++++ b/net/minecraft/world/entity/monster/EntityIllagerWizard.java
+@@ -156,6 +156,11 @@
public void e() {
--this.b;
if (this.b == 0) {
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityPhantom.patch b/nms-patches/net/minecraft/world/entity/monster/EntityPhantom.patch
index 960e8aebd..7a1b47698 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityPhantom.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityPhantom.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityPhantom.java
-+++ b/net/minecraft/server/EntityPhantom.java
-@@ -207,7 +207,7 @@
+--- a/net/minecraft/world/entity/monster/EntityPhantom.java
++++ b/net/minecraft/world/entity/monster/EntityPhantom.java
+@@ -243,7 +243,7 @@
EntityHuman entityhuman = (EntityHuman) iterator.next();
if (EntityPhantom.this.a((EntityLiving) entityhuman, PathfinderTargetCondition.a)) {
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityPigZombie.patch b/nms-patches/net/minecraft/world/entity/monster/EntityPigZombie.patch
index 3c466b47b..f5a8b728a 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityPigZombie.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityPigZombie.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityPigZombie.java
-+++ b/net/minecraft/server/EntityPigZombie.java
-@@ -35,7 +35,7 @@
+--- a/net/minecraft/world/entity/monster/EntityPigZombie.java
++++ b/net/minecraft/world/entity/monster/EntityPigZombie.java
+@@ -69,7 +69,7 @@
protected void m() {
this.goalSelector.a(2, new PathfinderGoalZombieAttack(this, 1.0D, false));
this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D));
@@ -9,7 +9,7 @@
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::a_));
this.targetSelector.a(3, new PathfinderGoalUniversalAngerReset<>(this, true));
}
-@@ -108,7 +108,7 @@
+@@ -142,7 +142,7 @@
}).filter((entitypigzombie) -> {
return !entitypigzombie.r(this.getGoalTarget());
}).forEach((entitypigzombie) -> {
@@ -18,7 +18,7 @@
});
}
-@@ -117,7 +117,7 @@
+@@ -151,7 +151,7 @@
}
@Override
@@ -27,7 +27,7 @@
if (this.getGoalTarget() == null && entityliving != null) {
this.bo = EntityPigZombie.d.a(this.random);
this.bt = EntityPigZombie.bs.a(this.random);
-@@ -127,12 +127,21 @@
+@@ -161,12 +161,21 @@
this.e((EntityHuman) entityliving);
}
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityPillager.patch b/nms-patches/net/minecraft/world/entity/monster/EntityPillager.patch
index ddc035e5a..32c928ab1 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityPillager.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityPillager.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityPillager.java
-+++ b/net/minecraft/server/EntityPillager.java
-@@ -22,7 +22,7 @@
+--- a/net/minecraft/world/entity/monster/EntityPillager.java
++++ b/net/minecraft/world/entity/monster/EntityPillager.java
+@@ -70,7 +70,7 @@
this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D));
this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 15.0F, 1.0F));
this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 15.0F));
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityRavager.patch b/nms-patches/net/minecraft/world/entity/monster/EntityRavager.patch
index 3cb559e0d..752105942 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityRavager.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityRavager.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityRavager.java
-+++ b/net/minecraft/server/EntityRavager.java
-@@ -28,7 +28,7 @@
+--- a/net/minecraft/world/entity/monster/EntityRavager.java
++++ b/net/minecraft/world/entity/monster/EntityRavager.java
+@@ -69,7 +69,7 @@
this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 0.4D));
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F));
@@ -9,12 +9,12 @@
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, true));
this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
-@@ -119,7 +119,7 @@
+@@ -160,7 +160,7 @@
IBlockData iblockdata = this.world.getType(blockposition);
Block block = iblockdata.getBlock();
- if (block instanceof BlockLeaves) {
-+ if (block instanceof BlockLeaves && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { // CraftBukkit
++ if (block instanceof BlockLeaves && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, net.minecraft.world.level.block.Blocks.AIR.getBlockData()).isCancelled()) { // CraftBukkit
flag = this.world.a(blockposition, true, this) || flag;
}
}
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityShulker.patch b/nms-patches/net/minecraft/world/entity/monster/EntityShulker.patch
index 024591f07..7be5a2bfe 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityShulker.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityShulker.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/EntityShulker.java
-+++ b/net/minecraft/server/EntityShulker.java
-@@ -7,6 +7,11 @@
- import java.util.UUID;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/monster/EntityShulker.java
++++ b/net/minecraft/world/entity/monster/EntityShulker.java
+@@ -47,6 +47,12 @@
+ import net.minecraft.world.phys.AxisAlignedBB;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
++import net.minecraft.server.level.WorldServer;
+import org.bukkit.Location;
+import org.bukkit.event.entity.EntityTeleportEvent;
+// CraftBukkit end
@@ -12,7 +13,7 @@
public class EntityShulker extends EntityGolem implements IMonster {
private static final UUID bp = UUID.fromString("7E0292F2-9434-48D5-A29F-9583AF7DF27F");
-@@ -31,7 +36,7 @@
+@@ -71,7 +77,7 @@
this.goalSelector.a(4, new EntityShulker.a());
this.goalSelector.a(7, new EntityShulker.e());
this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
@@ -21,7 +22,7 @@
this.targetSelector.a(2, new EntityShulker.d(this));
this.targetSelector.a(3, new EntityShulker.c(this));
}
-@@ -279,6 +284,16 @@
+@@ -319,6 +325,16 @@
EnumDirection enumdirection = this.g(blockposition1);
if (enumdirection != null) {
@@ -38,7 +39,7 @@
this.datawatcher.set(EntityShulker.b, enumdirection);
this.playSound(SoundEffects.ENTITY_SHULKER_TELEPORT, 1.0F, 1.0F);
this.datawatcher.set(EntityShulker.c, Optional.of(blockposition1));
-@@ -319,6 +334,7 @@
+@@ -359,6 +375,7 @@
}
this.g((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D);
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntitySilverfish.patch b/nms-patches/net/minecraft/world/entity/monster/EntitySilverfish.patch
index 87febd563..2c79d7445 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntitySilverfish.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntitySilverfish.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntitySilverfish.java
-+++ b/net/minecraft/server/EntitySilverfish.java
-@@ -18,7 +18,7 @@
+--- a/net/minecraft/world/entity/monster/EntitySilverfish.java
++++ b/net/minecraft/world/entity/monster/EntitySilverfish.java
+@@ -45,7 +45,7 @@
this.goalSelector.a(3, this.b);
this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, 1.0D, false));
this.goalSelector.a(5, new EntitySilverfish.PathfinderGoalSilverfishHideInBlock(this));
@@ -9,7 +9,7 @@
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
}
-@@ -156,6 +156,11 @@
+@@ -183,6 +183,11 @@
IBlockData iblockdata = world.getType(blockposition);
if (BlockMonsterEggs.h(iblockdata)) {
@@ -21,12 +21,12 @@
world.setTypeAndData(blockposition, BlockMonsterEggs.c(iblockdata.getBlock()), 3);
this.a.doSpawnEffect();
this.a.die();
-@@ -202,6 +207,11 @@
+@@ -229,6 +234,11 @@
Block block = iblockdata.getBlock();
if (block instanceof BlockMonsterEggs) {
+ // CraftBukkit start
-+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, Blocks.AIR.getBlockData()).isCancelled()) {
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.silverfish, blockposition1, net.minecraft.world.level.block.Blocks.AIR.getBlockData()).isCancelled()) {
+ continue;
+ }
+ // CraftBukkit end
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntitySkeletonAbstract.patch b/nms-patches/net/minecraft/world/entity/monster/EntitySkeletonAbstract.patch
index e9b8e8d48..1249d5184 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntitySkeletonAbstract.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntitySkeletonAbstract.patch
@@ -1,11 +1,11 @@
---- a/net/minecraft/server/EntitySkeletonAbstract.java
-+++ b/net/minecraft/server/EntitySkeletonAbstract.java
-@@ -154,8 +154,19 @@
+--- a/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java
++++ b/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java
+@@ -196,8 +196,19 @@
double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2);
entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.world.getDifficulty().a() * 4));
+ // CraftBukkit start
-+ org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getItemInMainHand(), null, entityarrow, EnumHand.MAIN_HAND, 0.8F, true);
++ org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getItemInMainHand(), null, entityarrow, net.minecraft.world.EnumHand.MAIN_HAND, 0.8F, true);
+ if (event.isCancelled()) {
+ event.getProjectile().remove();
+ return;
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntitySkeletonWither.patch b/nms-patches/net/minecraft/world/entity/monster/EntitySkeletonWither.patch
index a907a477d..229ac1266 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntitySkeletonWither.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntitySkeletonWither.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntitySkeletonWither.java
-+++ b/net/minecraft/server/EntitySkeletonWither.java
-@@ -80,7 +80,7 @@
+--- a/net/minecraft/world/entity/monster/EntitySkeletonWither.java
++++ b/net/minecraft/world/entity/monster/EntitySkeletonWither.java
+@@ -105,7 +105,7 @@
return false;
} else {
if (entity instanceof EntityLiving) {
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntitySlime.patch b/nms-patches/net/minecraft/world/entity/monster/EntitySlime.patch
index 060ca1702..48c398eb2 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntitySlime.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntitySlime.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntitySlime.java
-+++ b/net/minecraft/server/EntitySlime.java
-@@ -6,6 +6,14 @@
- import java.util.Random;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/monster/EntitySlime.java
++++ b/net/minecraft/world/entity/monster/EntitySlime.java
+@@ -45,6 +45,14 @@
+ import net.minecraft.world.level.storage.loot.LootTables;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import java.util.ArrayList;
@@ -15,7 +15,7 @@
public class EntitySlime extends EntityInsentient implements IMonster {
private static final DataWatcherObject bo = DataWatcher.a(EntitySlime.class, DataWatcherRegistry.b);
-@@ -149,7 +157,7 @@
+@@ -188,7 +196,7 @@
@Override
public EntityTypes extends EntitySlime> getEntityType() {
@@ -24,7 +24,7 @@
}
@Override
-@@ -163,6 +171,19 @@
+@@ -202,6 +210,19 @@
int j = i / 2;
int k = 2 + this.random.nextInt(3);
@@ -44,7 +44,7 @@
for (int l = 0; l < k; ++l) {
float f1 = ((float) (l % 2) - 0.5F) * f;
float f2 = ((float) (l / 2) - 0.5F) * f;
-@@ -177,8 +198,17 @@
+@@ -216,8 +237,17 @@
entityslime.setInvulnerable(this.isInvulnerable());
entityslime.setSize(j, true);
entityslime.setPositionRotation(this.locX() + (double) f1, this.locY() + 0.5D, this.locZ() + (double) f2, this.random.nextFloat() * 360.0F, 0.0F);
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntitySpider.patch b/nms-patches/net/minecraft/world/entity/monster/EntitySpider.patch
index 989b28108..81e3f5883 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntitySpider.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntitySpider.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntitySpider.java
-+++ b/net/minecraft/server/EntitySpider.java
-@@ -136,7 +136,7 @@
+--- a/net/minecraft/world/entity/monster/EntitySpider.java
++++ b/net/minecraft/world/entity/monster/EntitySpider.java
+@@ -175,7 +175,7 @@
MobEffectList mobeffectlist = ((EntitySpider.GroupDataSpider) object).a;
if (mobeffectlist != null) {
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityStrider.patch b/nms-patches/net/minecraft/world/entity/monster/EntityStrider.patch
index 317050363..664ad7b99 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityStrider.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityStrider.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityStrider.java
-+++ b/net/minecraft/server/EntityStrider.java
-@@ -252,7 +252,12 @@
+--- a/net/minecraft/world/entity/monster/EntityStrider.java
++++ b/net/minecraft/world/entity/monster/EntityStrider.java
+@@ -318,7 +318,12 @@
IBlockData iblockdata1 = this.aN();
boolean flag = iblockdata.a((Tag) TagsBlock.STRIDER_WARM_BLOCKS) || iblockdata1.a((Tag) TagsBlock.STRIDER_WARM_BLOCKS) || this.b((Tag) TagsFluid.LAVA) > 0.0D;
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityVex.patch b/nms-patches/net/minecraft/world/entity/monster/EntityVex.patch
index 4fa8ccde3..7cc8927b6 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityVex.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityVex.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityVex.java
-+++ b/net/minecraft/server/EntityVex.java
-@@ -45,7 +45,7 @@
+--- a/net/minecraft/world/entity/monster/EntityVex.java
++++ b/net/minecraft/world/entity/monster/EntityVex.java
+@@ -81,7 +81,7 @@
this.goalSelector.a(8, new EntityVex.d());
this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F));
this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F));
@@ -9,7 +9,7 @@
this.targetSelector.a(2, new EntityVex.b(this));
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
}
-@@ -186,7 +186,7 @@
+@@ -222,7 +222,7 @@
@Override
public void c() {
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityWitch.patch b/nms-patches/net/minecraft/world/entity/monster/EntityWitch.patch
index fa3659afd..e1ca8f1a9 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityWitch.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityWitch.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityWitch.java
-+++ b/net/minecraft/server/EntityWitch.java
-@@ -93,7 +93,7 @@
+--- a/net/minecraft/world/entity/monster/EntityWitch.java
++++ b/net/minecraft/world/entity/monster/EntityWitch.java
+@@ -132,7 +132,7 @@
while (iterator.hasNext()) {
MobEffect mobeffect = (MobEffect) iterator.next();
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityZombie.patch b/nms-patches/net/minecraft/world/entity/monster/EntityZombie.patch
index 9b58dd5b2..3cb65e5cf 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityZombie.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityZombie.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/EntityZombie.java
-+++ b/net/minecraft/server/EntityZombie.java
-@@ -9,6 +9,14 @@
- import java.util.function.Predicate;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/monster/EntityZombie.java
++++ b/net/minecraft/world/entity/monster/EntityZombie.java
+@@ -70,6 +70,15 @@
+ import net.minecraft.world.level.block.Blocks;
+ import net.minecraft.world.level.block.state.IBlockData;
+// CraftBukkit start
++import net.minecraft.server.MinecraftServer;
+import org.bukkit.entity.Zombie;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+import org.bukkit.event.entity.EntityCombustByEntityEvent;
@@ -15,7 +16,7 @@
public class EntityZombie extends EntityMonster {
private static final UUID b = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
-@@ -23,6 +31,7 @@
+@@ -84,6 +93,7 @@
private boolean bs;
private int bt;
public int drownedConversionTime;
@@ -23,7 +24,7 @@
public EntityZombie(EntityTypes extends EntityZombie> entitytypes, World world) {
super(entitytypes, world);
-@@ -139,7 +148,10 @@
+@@ -200,7 +210,10 @@
public void tick() {
if (!this.world.isClientSide && this.isAlive() && !this.isNoAI()) {
if (this.isDrownConverting()) {
@@ -35,7 +36,7 @@
if (this.drownedConversionTime < 0) {
this.eP();
}
-@@ -156,6 +168,7 @@
+@@ -217,6 +230,7 @@
}
super.tick();
@@ -43,7 +44,7 @@
}
@Override
-@@ -188,6 +201,7 @@
+@@ -249,6 +263,7 @@
}
public void startDrownedConversion(int i) {
@@ -51,7 +52,7 @@
this.drownedConversionTime = i;
this.getDataWatcher().set(EntityZombie.DROWN_CONVERTING, true);
}
-@@ -201,11 +215,15 @@
+@@ -262,11 +277,15 @@
}
protected void b(EntityTypes extends EntityZombie> entitytypes) {
@@ -68,7 +69,7 @@
}
}
-@@ -245,9 +263,9 @@
+@@ -306,9 +325,9 @@
if (SpawnerCreature.a(entitypositiontypes_surface, (IWorldReader) this.world, blockposition, entitytypes) && EntityPositionTypes.a(entitytypes, worldserver, EnumMobSpawn.REINFORCEMENT, blockposition, this.world.random)) {
entityzombie.setPosition((double) i1, (double) j1, (double) k1);
if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.j((Entity) entityzombie) && this.world.getCubes(entityzombie) && !this.world.containsLiquid(entityzombie.getBoundingBox())) {
@@ -80,7 +81,7 @@
this.getAttributeInstance(GenericAttributes.SPAWN_REINFORCEMENTS).addModifier(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, AttributeModifier.Operation.ADDITION));
entityzombie.getAttributeInstance(GenericAttributes.SPAWN_REINFORCEMENTS).addModifier(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, AttributeModifier.Operation.ADDITION));
break;
-@@ -268,7 +286,14 @@
+@@ -329,7 +348,14 @@
float f = this.world.getDamageScaler(this.getChunkCoordinates()).b();
if (this.getItemInMainHand().isEmpty() && this.isBurning() && this.random.nextFloat() < f * 0.3F) {
@@ -96,7 +97,7 @@
}
}
-@@ -349,7 +374,12 @@
+@@ -410,7 +436,12 @@
}
EntityVillager entityvillager = (EntityVillager) entityliving;
@@ -110,7 +111,7 @@
entityzombievillager.prepare(worldserver, worldserver.getDamageScaler(entityzombievillager.getChunkCoordinates()), EnumMobSpawn.CONVERSION, new EntityZombie.GroupDataZombie(false, true), (NBTTagCompound) null);
entityzombievillager.setVillagerData(entityvillager.getVillagerData());
-@@ -406,7 +436,7 @@
+@@ -467,7 +498,7 @@
entitychicken1.prepare(worldaccess, difficultydamagescaler, EnumMobSpawn.JOCKEY, (GroupDataEntity) null, (NBTTagCompound) null);
entitychicken1.setChickenJockey(true);
this.startRiding(entitychicken1);
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityZombieHusk.patch b/nms-patches/net/minecraft/world/entity/monster/EntityZombieHusk.patch
index b4349ec3b..681e99a4e 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityZombieHusk.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityZombieHusk.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityZombieHusk.java
-+++ b/net/minecraft/server/EntityZombieHusk.java
-@@ -44,7 +44,7 @@
+--- a/net/minecraft/world/entity/monster/EntityZombieHusk.java
++++ b/net/minecraft/world/entity/monster/EntityZombieHusk.java
+@@ -58,7 +58,7 @@
if (flag && this.getItemInMainHand().isEmpty() && entity instanceof EntityLiving) {
float f = this.world.getDamageScaler(this.getChunkCoordinates()).b();
diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityZombieVillager.patch b/nms-patches/net/minecraft/world/entity/monster/EntityZombieVillager.patch
index d8a3e11ec..a53380c61 100644
--- a/nms-patches/net/minecraft/world/entity/monster/EntityZombieVillager.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/EntityZombieVillager.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/EntityZombieVillager.java
-+++ b/net/minecraft/server/EntityZombieVillager.java
-@@ -6,6 +6,12 @@
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/monster/EntityZombieVillager.java
++++ b/net/minecraft/world/entity/monster/EntityZombieVillager.java
+@@ -47,6 +47,13 @@
+ import net.minecraft.world.level.block.Blocks;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
++import net.minecraft.server.MinecraftServer;
+import org.bukkit.entity.ZombieVillager;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+import org.bukkit.event.entity.EntityTransformEvent;
@@ -13,7 +14,7 @@
public class EntityZombieVillager extends EntityZombie implements VillagerDataHolder {
public static final DataWatcherObject CONVERTING = DataWatcher.a(EntityZombieVillager.class, DataWatcherRegistry.i);
-@@ -15,6 +21,7 @@
+@@ -56,6 +63,7 @@
private NBTBase bp;
private NBTTagCompound bq;
private int br;
@@ -21,7 +22,7 @@
public EntityZombieVillager(EntityTypes extends EntityZombieVillager> entitytypes, World world) {
super(entitytypes, world);
-@@ -31,7 +38,7 @@
+@@ -72,7 +80,7 @@
@Override
public void saveData(NBTTagCompound nbttagcompound) {
super.saveData(nbttagcompound);
@@ -30,7 +31,7 @@
Logger logger = EntityZombieVillager.LOGGER;
logger.getClass();
-@@ -87,6 +94,10 @@
+@@ -128,6 +136,10 @@
public void tick() {
if (!this.world.isClientSide && this.isAlive() && this.isConverting()) {
int i = this.getConversionProgress();
@@ -41,7 +42,7 @@
this.conversionTime -= i;
if (this.conversionTime <= 0) {
-@@ -95,6 +106,7 @@
+@@ -136,6 +148,7 @@
}
super.tick();
@@ -49,7 +50,7 @@
}
@Override
-@@ -138,13 +150,22 @@
+@@ -179,13 +192,22 @@
this.conversionPlayer = uuid;
this.conversionTime = i;
this.getDataWatcher().set(EntityZombieVillager.CONVERTING, true);
@@ -75,7 +76,7 @@
EnumItemSlot[] aenumitemslot = EnumItemSlot.values();
int i = aenumitemslot.length;
-@@ -185,7 +206,7 @@
+@@ -226,7 +248,7 @@
}
}
diff --git a/nms-patches/net/minecraft/world/entity/monster/piglin/EntityPiglinAbstract.patch b/nms-patches/net/minecraft/world/entity/monster/piglin/EntityPiglinAbstract.patch
index 6df74c90c..0646697ce 100644
--- a/nms-patches/net/minecraft/world/entity/monster/piglin/EntityPiglinAbstract.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/piglin/EntityPiglinAbstract.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityPiglinAbstract.java
-+++ b/net/minecraft/server/EntityPiglinAbstract.java
-@@ -81,7 +81,7 @@
+--- a/net/minecraft/world/entity/monster/piglin/EntityPiglinAbstract.java
++++ b/net/minecraft/world/entity/monster/piglin/EntityPiglinAbstract.java
+@@ -99,7 +99,7 @@
}
protected void c(WorldServer worldserver) {
@@ -9,7 +9,7 @@
if (entitypigzombie != null) {
entitypigzombie.addEffect(new MobEffect(MobEffects.CONFUSION, 200, 0));
-@@ -96,7 +96,7 @@
+@@ -114,7 +114,7 @@
@Nullable
@Override
public EntityLiving getGoalTarget() {
diff --git a/nms-patches/net/minecraft/world/entity/monster/piglin/PiglinAI.patch b/nms-patches/net/minecraft/world/entity/monster/piglin/PiglinAI.patch
index 1e1657bcf..6a040e2db 100644
--- a/nms-patches/net/minecraft/world/entity/monster/piglin/PiglinAI.patch
+++ b/nms-patches/net/minecraft/world/entity/monster/piglin/PiglinAI.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PiglinAI.java
-+++ b/net/minecraft/server/PiglinAI.java
-@@ -52,7 +52,8 @@
+--- a/net/minecraft/world/entity/monster/piglin/PiglinAI.java
++++ b/net/minecraft/world/entity/monster/piglin/PiglinAI.java
+@@ -114,7 +114,8 @@
private static void b(EntityPiglin entitypiglin, BehaviorController behaviorcontroller) {
behaviorcontroller.a(Activity.FLIGHT, 10, ImmutableList.of(new BehaviorAttackTargetForget<>((entityliving) -> {
return !b(entitypiglin, entityliving);
@@ -10,7 +10,7 @@
}
private static void c(BehaviorController behaviorcontroller) {
-@@ -70,7 +71,8 @@
+@@ -132,7 +133,8 @@
}
private static void f(BehaviorController behaviorcontroller) {
@@ -20,7 +20,7 @@
}
private static BehaviorGateSingle a() {
-@@ -78,7 +80,8 @@
+@@ -140,7 +142,8 @@
}
private static BehaviorGateSingle b() {
@@ -30,7 +30,7 @@
}
private static BehaviorWalkAway c() {
-@@ -95,10 +98,10 @@
+@@ -157,10 +160,10 @@
protected static void b(EntityPiglin entitypiglin) {
BehaviorController behaviorcontroller = entitypiglin.getBehaviorController();
@@ -43,7 +43,7 @@
if (activity != activity1) {
d(entitypiglin).ifPresent(entitypiglin::a);
-@@ -130,14 +133,18 @@
+@@ -192,14 +195,18 @@
n(entitypiglin);
ItemStack itemstack;
@@ -64,7 +64,7 @@
Item item = itemstack.getItem();
-@@ -148,7 +155,7 @@
+@@ -210,7 +217,7 @@
} else if (c(item) && !u(entitypiglin)) {
s(entitypiglin);
} else {
@@ -73,7 +73,7 @@
if (!flag) {
d(entitypiglin, itemstack);
-@@ -350,7 +357,7 @@
+@@ -412,7 +419,7 @@
}
public static void a(EntityHuman entityhuman, boolean flag) {
@@ -82,7 +82,7 @@
list.stream().filter(PiglinAI::d).filter((entitypiglin) -> {
return !flag || BehaviorUtil.c(entitypiglin, entityhuman);
-@@ -586,7 +593,7 @@
+@@ -648,7 +655,7 @@
EntityLiving entityliving = (EntityLiving) behaviorcontroller.getMemory(MemoryModuleType.AVOID_TARGET).get();
EntityTypes> entitytypes = entityliving.getEntityType();
@@ -91,7 +91,7 @@
}
}
-@@ -668,7 +675,7 @@
+@@ -730,7 +737,7 @@
}
public static boolean b(EntityLiving entityliving) {
diff --git a/nms-patches/net/minecraft/world/entity/npc/EntityVillager.patch b/nms-patches/net/minecraft/world/entity/npc/EntityVillager.patch
index 6e5123bec..a214d54c8 100644
--- a/nms-patches/net/minecraft/world/entity/npc/EntityVillager.patch
+++ b/nms-patches/net/minecraft/world/entity/npc/EntityVillager.patch
@@ -1,7 +1,7 @@
---- a/net/minecraft/server/EntityVillager.java
-+++ b/net/minecraft/server/EntityVillager.java
-@@ -19,6 +19,14 @@
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/npc/EntityVillager.java
++++ b/net/minecraft/world/entity/npc/EntityVillager.java
+@@ -89,6 +89,14 @@
+ import net.minecraft.world.phys.AxisAlignedBB;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
@@ -15,7 +15,7 @@
public class EntityVillager extends EntityVillagerAbstract implements ReputationHandler, VillagerDataHolder {
private static final DataWatcherObject br = DataWatcher.a(EntityVillager.class, DataWatcherRegistry.q);
-@@ -64,7 +72,7 @@
+@@ -134,7 +142,7 @@
@Override
public BehaviorController getBehaviorController() {
@@ -24,7 +24,7 @@
}
@Override
-@@ -83,7 +91,7 @@
+@@ -153,7 +161,7 @@
public void c(WorldServer worldserver) {
BehaviorController behaviorcontroller = this.getBehaviorController();
@@ -33,7 +33,7 @@
this.bg = behaviorcontroller.h();
this.a(this.getBehaviorController());
}
-@@ -133,7 +141,7 @@
+@@ -203,7 +211,7 @@
@Override
protected void mobTick() {
this.world.getMethodProfiler().enter("villagerBrain");
@@ -42,7 +42,7 @@
this.world.getMethodProfiler().exit();
if (this.bF) {
this.bF = false;
-@@ -147,7 +155,7 @@
+@@ -217,7 +225,7 @@
this.bu = false;
}
@@ -51,7 +51,7 @@
}
}
-@@ -358,7 +366,14 @@
+@@ -428,7 +436,14 @@
while (iterator.hasNext()) {
MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
@@ -67,7 +67,7 @@
}
}
-@@ -387,7 +402,7 @@
+@@ -457,7 +472,7 @@
@Override
public void saveData(NBTTagCompound nbttagcompound) {
super.saveData(nbttagcompound);
@@ -76,7 +76,7 @@
Logger logger = EntityVillager.LOGGER;
logger.getClass();
-@@ -700,7 +715,12 @@
+@@ -770,7 +785,12 @@
}
entitywitch.setPersistent();
@@ -90,7 +90,7 @@
this.fq();
this.die();
} else {
-@@ -833,7 +853,7 @@
+@@ -903,7 +923,7 @@
if (entityirongolem != null) {
if (entityirongolem.a((GeneratorAccess) worldserver, EnumMobSpawn.MOB_SUMMONED) && entityirongolem.a((IWorldReader) worldserver)) {
@@ -99,7 +99,7 @@
return entityirongolem;
}
-@@ -911,7 +931,7 @@
+@@ -981,7 +1001,7 @@
@Override
public void entitySleep(BlockPosition blockposition) {
super.entitySleep(blockposition);
@@ -108,7 +108,7 @@
this.bg.removeMemory(MemoryModuleType.WALK_TARGET);
this.bg.removeMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE);
}
-@@ -919,7 +939,7 @@
+@@ -989,7 +1009,7 @@
@Override
public void entityWakeup() {
super.entityWakeup();
diff --git a/nms-patches/net/minecraft/world/entity/npc/EntityVillagerAbstract.patch b/nms-patches/net/minecraft/world/entity/npc/EntityVillagerAbstract.patch
index 47919b889..bc89499db 100644
--- a/nms-patches/net/minecraft/world/entity/npc/EntityVillagerAbstract.patch
+++ b/nms-patches/net/minecraft/world/entity/npc/EntityVillagerAbstract.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntityVillagerAbstract.java
-+++ b/net/minecraft/server/EntityVillagerAbstract.java
-@@ -5,14 +5,30 @@
- import java.util.Set;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/npc/EntityVillagerAbstract.java
++++ b/net/minecraft/world/entity/npc/EntityVillagerAbstract.java
+@@ -32,14 +32,30 @@
+ import net.minecraft.world.level.WorldAccess;
+ import net.minecraft.world.level.pathfinder.PathType;
+// CraftBukkit start
+import org.bukkit.Bukkit;
@@ -32,7 +32,7 @@
public EntityVillagerAbstract(EntityTypes extends EntityVillagerAbstract> entitytypes, World world) {
super(entitytypes, world);
-@@ -213,7 +229,16 @@
+@@ -240,7 +256,16 @@
MerchantRecipe merchantrecipe = villagertrades_imerchantrecipeoption.a(this, this.random);
if (merchantrecipe != null) {
diff --git a/nms-patches/net/minecraft/world/entity/npc/EntityVillagerTrader.patch b/nms-patches/net/minecraft/world/entity/npc/EntityVillagerTrader.patch
index e0ede8543..e1bdb7215 100644
--- a/nms-patches/net/minecraft/world/entity/npc/EntityVillagerTrader.patch
+++ b/nms-patches/net/minecraft/world/entity/npc/EntityVillagerTrader.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntityVillagerTrader.java
-+++ b/net/minecraft/server/EntityVillagerTrader.java
-@@ -3,6 +3,13 @@
- import java.util.EnumSet;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/npc/EntityVillagerTrader.java
++++ b/net/minecraft/world/entity/npc/EntityVillagerTrader.java
+@@ -46,6 +46,13 @@
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.Bukkit;
@@ -14,7 +14,7 @@
public class EntityVillagerTrader extends EntityVillagerAbstract {
@Nullable
-@@ -12,6 +19,7 @@
+@@ -55,6 +62,7 @@
public EntityVillagerTrader(EntityTypes extends EntityVillagerTrader> entitytypes, World world) {
super(entitytypes, world);
this.attachedToPlayer = true;
@@ -22,7 +22,7 @@
}
@Override
-@@ -89,7 +97,16 @@
+@@ -132,7 +140,16 @@
MerchantRecipe merchantrecipe = villagertrades_imerchantrecipeoption.a(this, this.random);
if (merchantrecipe != null) {
diff --git a/nms-patches/net/minecraft/world/entity/npc/MobSpawnerTrader.patch b/nms-patches/net/minecraft/world/entity/npc/MobSpawnerTrader.patch
index f7d580deb..7bd0390c9 100644
--- a/nms-patches/net/minecraft/world/entity/npc/MobSpawnerTrader.patch
+++ b/nms-patches/net/minecraft/world/entity/npc/MobSpawnerTrader.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/MobSpawnerTrader.java
-+++ b/net/minecraft/server/MobSpawnerTrader.java
-@@ -83,7 +83,7 @@
+--- a/net/minecraft/world/entity/npc/MobSpawnerTrader.java
++++ b/net/minecraft/world/entity/npc/MobSpawnerTrader.java
+@@ -104,7 +104,7 @@
return false;
}
@@ -9,16 +9,16 @@
if (entityvillagertrader != null) {
for (int i = 0; i < 2; ++i) {
-@@ -91,7 +91,7 @@
+@@ -112,7 +112,7 @@
}
this.b.a(entityvillagertrader.getUniqueID());
-- entityvillagertrader.u(48000);
+- entityvillagertrader.setDespawnDelay(48000);
+ // entityvillagertrader.u(48000); // CraftBukkit - moved to EntityVillagerTrader constructor. This lets the value be modified by plugins on CreatureSpawnEvent
entityvillagertrader.g(blockposition1);
entityvillagertrader.a(blockposition1, 16);
return true;
-@@ -106,7 +106,7 @@
+@@ -127,7 +127,7 @@
BlockPosition blockposition = this.a((IWorldReader) worldserver, entityvillagertrader.getChunkCoordinates(), i);
if (blockposition != null) {
diff --git a/nms-patches/net/minecraft/world/entity/player/EntityHuman.patch b/nms-patches/net/minecraft/world/entity/player/EntityHuman.patch
index 0e63dad0c..9446fff5a 100644
--- a/nms-patches/net/minecraft/world/entity/player/EntityHuman.patch
+++ b/nms-patches/net/minecraft/world/entity/player/EntityHuman.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntityHuman.java
-+++ b/net/minecraft/server/EntityHuman.java
-@@ -16,10 +16,24 @@
- import java.util.function.Predicate;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/player/EntityHuman.java
++++ b/net/minecraft/world/entity/player/EntityHuman.java
+@@ -110,10 +110,24 @@
+ import net.minecraft.world.scores.ScoreboardTeam;
+ import net.minecraft.world.scores.ScoreboardTeamBase;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
@@ -26,7 +26,7 @@
private static final DataWatcherObject c = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.c);
private static final DataWatcherObject d = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.b);
protected static final DataWatcherObject bi = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a);
-@@ -28,10 +42,10 @@
+@@ -122,10 +136,10 @@
protected static final DataWatcherObject bl = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p);
private long e;
public final PlayerInventory inventory = new PlayerInventory(this);
@@ -39,7 +39,7 @@
protected int br;
public float bs;
public float bt;
-@@ -57,6 +71,16 @@
+@@ -151,6 +165,16 @@
@Nullable
public EntityFishingHook hookedFish;
@@ -56,7 +56,7 @@
public EntityHuman(World world, BlockPosition blockposition, float f, GameProfile gameprofile) {
super(EntityTypes.PLAYER, world);
this.bL = ItemStack.b;
-@@ -194,7 +218,7 @@
+@@ -288,7 +312,7 @@
ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD);
if (itemstack.getItem() == Items.TURTLE_HELMET && !this.a((Tag) TagsFluid.WATER)) {
@@ -65,7 +65,7 @@
}
}
-@@ -359,7 +383,8 @@
+@@ -453,7 +477,8 @@
if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.world.getGameRules().getBoolean(GameRules.NATURAL_REGENERATION)) {
if (this.getHealth() < this.getMaxHealth() && this.ticksLived % 20 == 0) {
@@ -75,7 +75,7 @@
}
if (this.foodData.c() && this.ticksLived % 10 == 0) {
-@@ -544,6 +569,30 @@
+@@ -638,6 +663,30 @@
entityitem.setMot((double) (-f3 * f2 * 0.3F) + Math.cos((double) f5) * (double) f6, (double) (-f1 * 0.3F + 0.1F + (this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (f4 * f2 * 0.3F) + Math.sin((double) f5) * (double) f6);
}
@@ -106,7 +106,7 @@
return entityitem;
}
}
-@@ -670,16 +719,17 @@
+@@ -764,16 +813,17 @@
if (this.isInvulnerable(damagesource)) {
return false;
} else if (this.abilities.isInvulnerable && !damagesource.ignoresInvulnerability()) {
@@ -126,7 +126,7 @@
}
if (this.world.getDifficulty() == EnumDifficulty.EASY) {
-@@ -691,7 +741,13 @@
+@@ -785,7 +835,13 @@
}
}
@@ -141,7 +141,7 @@
}
}
}
-@@ -706,10 +762,29 @@
+@@ -800,10 +856,29 @@
}
public boolean a(EntityHuman entityhuman) {
@@ -174,7 +174,7 @@
}
@Override
-@@ -746,8 +821,13 @@
+@@ -840,8 +915,13 @@
}
}
@@ -189,7 +189,7 @@
if (!this.isInvulnerable(damagesource)) {
f = this.applyArmorModifier(damagesource, f);
f = this.applyMagicModifier(damagesource, f);
-@@ -762,7 +842,7 @@
+@@ -856,7 +936,7 @@
}
if (f != 0.0F) {
@@ -198,7 +198,7 @@
float f3 = this.getHealth();
this.setHealth(this.getHealth() - f);
-@@ -773,6 +853,7 @@
+@@ -867,6 +947,7 @@
}
}
@@ -206,7 +206,7 @@
}
@Override
-@@ -932,7 +1013,7 @@
+@@ -1026,7 +1107,7 @@
f *= 0.2F + f2 * f2 * 0.8F;
f1 *= f2;
@@ -215,7 +215,7 @@
if (f > 0.0F || f1 > 0.0F) {
boolean flag = f2 > 0.9F;
boolean flag1 = false;
-@@ -971,8 +1052,15 @@
+@@ -1065,8 +1146,15 @@
if (entity instanceof EntityLiving) {
f3 = ((EntityLiving) entity).getHealth();
if (j > 0 && !entity.isBurning()) {
@@ -233,7 +233,7 @@
}
}
-@@ -1000,8 +1088,11 @@
+@@ -1094,8 +1182,11 @@
EntityLiving entityliving = (EntityLiving) iterator.next();
if (entityliving != this && entityliving != entity && !this.r(entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.h((Entity) entityliving) < 9.0D) {
@@ -246,7 +246,7 @@
}
}
-@@ -1010,9 +1101,26 @@
+@@ -1104,9 +1195,26 @@
}
if (entity instanceof EntityPlayer && entity.velocityChanged) {
@@ -273,7 +273,7 @@
}
if (flag2) {
-@@ -1057,7 +1165,14 @@
+@@ -1151,7 +1259,14 @@
this.a(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F));
if (j > 0) {
@@ -289,7 +289,7 @@
}
if (this.world instanceof WorldServer && f5 > 2.0F) {
-@@ -1067,12 +1182,17 @@
+@@ -1161,12 +1276,17 @@
}
}
@@ -308,7 +308,7 @@
}
}
-@@ -1133,6 +1253,12 @@
+@@ -1227,6 +1347,12 @@
}
public Either sleep(BlockPosition blockposition) {
@@ -321,7 +321,7 @@
this.entitySleep(blockposition);
this.sleepTicks = 0;
return Either.right(Unit.INSTANCE);
-@@ -1217,9 +1343,9 @@
+@@ -1311,9 +1437,9 @@
super.jump();
this.a(StatisticList.JUMP);
if (this.isSprinting()) {
@@ -333,7 +333,7 @@
}
}
-@@ -1253,7 +1379,11 @@
+@@ -1347,7 +1473,11 @@
this.setMot(vec3d2.x, d3 * 0.6D, vec3d2.z);
this.aE = f;
this.fallDistance = 0.0F;
@@ -346,7 +346,7 @@
} else {
super.g(vec3d);
}
-@@ -1288,19 +1418,19 @@
+@@ -1382,19 +1512,19 @@
i = Math.round(MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F);
if (i > 0) {
this.a(StatisticList.SWIM_ONE_CM, i);
@@ -369,7 +369,7 @@
}
} else if (this.isClimbing()) {
if (d1 > 0.0D) {
-@@ -1311,13 +1441,13 @@
+@@ -1405,13 +1535,13 @@
if (i > 0) {
if (this.isSprinting()) {
this.a(StatisticList.SPRINT_ONE_CM, i);
@@ -386,7 +386,7 @@
}
}
} else if (this.isGliding()) {
-@@ -1383,12 +1513,24 @@
+@@ -1477,12 +1607,24 @@
}
public void startGliding() {
@@ -412,7 +412,7 @@
}
@Override
-@@ -1478,10 +1620,21 @@
+@@ -1572,10 +1714,21 @@
return this.expLevel >= 30 ? 112 + (this.expLevel - 30) * 9 : (this.expLevel >= 15 ? 37 + (this.expLevel - 15) * 5 : 7 + this.expLevel * 2);
}
@@ -435,7 +435,7 @@
}
}
-@@ -1555,14 +1708,21 @@
+@@ -1649,14 +1802,21 @@
@Override
public void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
@@ -460,7 +460,7 @@
this.inventory.armor.set(enumitemslot.b(), itemstack);
}
-@@ -1603,26 +1763,31 @@
+@@ -1697,26 +1857,31 @@
protected void releaseShoulderEntities() {
if (this.e + 20L < this.world.getTime()) {
diff --git a/nms-patches/net/minecraft/world/entity/player/PlayerInventory.patch b/nms-patches/net/minecraft/world/entity/player/PlayerInventory.patch
index 11b455074..a9424210a 100644
--- a/nms-patches/net/minecraft/world/entity/player/PlayerInventory.patch
+++ b/nms-patches/net/minecraft/world/entity/player/PlayerInventory.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/PlayerInventory.java
-+++ b/net/minecraft/server/PlayerInventory.java
-@@ -5,6 +5,13 @@
- import java.util.List;
- import java.util.function.Predicate;
+--- a/net/minecraft/world/entity/player/PlayerInventory.java
++++ b/net/minecraft/world/entity/player/PlayerInventory.java
+@@ -26,6 +26,13 @@
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.level.block.state.IBlockData;
+// CraftBukkit start
+import java.util.ArrayList;
@@ -14,7 +14,7 @@
public class PlayerInventory implements IInventory, INamableTileEntity {
public final NonNullList items;
-@@ -16,6 +23,54 @@
+@@ -37,6 +44,54 @@
private ItemStack carried;
private int h;
@@ -24,7 +24,7 @@
+
+ public List getContents() {
+ List combined = new ArrayList(items.size() + armor.size() + extraSlots.size());
-+ for (List sub : this.f) {
++ for (List sub : this.f) {
+ combined.addAll(sub);
+ }
+
@@ -69,7 +69,7 @@
public PlayerInventory(EntityHuman entityhuman) {
this.items = NonNullList.a(36, ItemStack.b);
this.armor = NonNullList.a(4, ItemStack.b);
-@@ -41,6 +96,28 @@
+@@ -62,6 +117,28 @@
return itemstack.getItem() == itemstack1.getItem() && ItemStack.equals(itemstack, itemstack1);
}
@@ -98,7 +98,7 @@
public int getFirstEmptySlotIndex() {
for (int i = 0; i < this.items.size(); ++i) {
if (((ItemStack) this.items.get(i)).isEmpty()) {
-@@ -480,8 +557,9 @@
+@@ -501,8 +578,9 @@
ItemStack itemstack = (ItemStack) this.armor.get(i);
if ((!damagesource.isFire() || !itemstack.getItem().u()) && itemstack.getItem() instanceof ItemArmor) {
@@ -109,7 +109,7 @@
});
}
}
-@@ -517,6 +595,11 @@
+@@ -538,6 +616,11 @@
}
public ItemStack getCarried() {
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityArrow.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityArrow.patch
index 5e6950c4f..54ab62371 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityArrow.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityArrow.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/EntityArrow.java
-+++ b/net/minecraft/server/EntityArrow.java
-@@ -8,6 +8,11 @@
- import java.util.List;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/projectile/EntityArrow.java
++++ b/net/minecraft/world/entity/projectile/EntityArrow.java
+@@ -45,6 +45,12 @@
+ import net.minecraft.world.phys.Vec3D;
+ import net.minecraft.world.phys.shapes.VoxelShape;
+// CraftBukkit start
++import net.minecraft.world.entity.item.EntityItem;
+import org.bukkit.event.entity.EntityCombustByEntityEvent;
+import org.bukkit.event.player.PlayerPickupArrowEvent;
+// CraftBukkit end
@@ -12,7 +13,7 @@
public abstract class EntityArrow extends IProjectile {
private static final DataWatcherObject f = DataWatcher.a(EntityArrow.class, DataWatcherRegistry.a);
-@@ -291,7 +296,13 @@
+@@ -328,7 +334,13 @@
int k = entity.getFireTicks();
if (this.isBurning() && !flag) {
@@ -27,7 +28,7 @@
}
if (entity.damageEntity(damagesource, (float) i)) {
-@@ -458,9 +469,23 @@
+@@ -495,9 +507,23 @@
@Override
public void pickup(EntityHuman entityhuman) {
if (!this.world.isClientSide && (this.inGround || this.t()) && this.shake <= 0) {
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityEgg.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityEgg.patch
index c7cf9cf76..6acfa817f 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityEgg.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityEgg.patch
@@ -1,9 +1,12 @@
---- a/net/minecraft/server/EntityEgg.java
-+++ b/net/minecraft/server/EntityEgg.java
-@@ -1,5 +1,12 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/entity/projectile/EntityEgg.java
++++ b/net/minecraft/world/entity/projectile/EntityEgg.java
+@@ -10,6 +10,15 @@
+ import net.minecraft.world.phys.MovingObjectPosition;
+ import net.minecraft.world.phys.MovingObjectPositionEntity;
+// CraftBukkit start
++import net.minecraft.server.level.EntityPlayer;
++import net.minecraft.world.entity.Entity;
+import org.bukkit.entity.Ageable;
+import org.bukkit.entity.EntityType;
+import org.bukkit.entity.Player;
@@ -13,7 +16,7 @@
public class EntityEgg extends EntityProjectileThrowable {
public EntityEgg(EntityTypes extends EntityEgg> entitytypes, World world) {
-@@ -24,20 +31,40 @@
+@@ -34,20 +43,40 @@
protected void a(MovingObjectPosition movingobjectposition) {
super.a(movingobjectposition);
if (!this.world.isClientSide) {
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityEnderPearl.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityEnderPearl.patch
index 36ff72776..ff439cf93 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityEnderPearl.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityEnderPearl.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntityEnderPearl.java
-+++ b/net/minecraft/server/EntityEnderPearl.java
-@@ -2,6 +2,13 @@
-
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/projectile/EntityEnderPearl.java
++++ b/net/minecraft/world/entity/projectile/EntityEnderPearl.java
+@@ -17,6 +17,13 @@
+ import net.minecraft.world.phys.MovingObjectPosition;
+ import net.minecraft.world.phys.MovingObjectPositionEntity;
+// CraftBukkit start
+import org.bukkit.Bukkit;
@@ -14,7 +14,7 @@
public class EntityEnderPearl extends EntityProjectileThrowable {
public EntityEnderPearl(EntityTypes extends EntityEnderPearl> entitytypes, World world) {
-@@ -37,21 +44,35 @@
+@@ -52,21 +59,35 @@
EntityPlayer entityplayer = (EntityPlayer) entity;
if (entityplayer.playerConnection.a().isConnected() && entityplayer.world == this.world && !entityplayer.isSleeping()) {
@@ -61,7 +61,7 @@
}
} else if (entity != null) {
entity.enderTeleportTo(this.locX(), this.locY(), this.locZ());
-@@ -80,7 +101,7 @@
+@@ -95,7 +116,7 @@
public Entity b(WorldServer worldserver) {
Entity entity = this.getShooter();
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityEnderSignal.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityEnderSignal.patch
index 68577115e..bb20422cc 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityEnderSignal.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityEnderSignal.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityEnderSignal.java
-+++ b/net/minecraft/server/EntityEnderSignal.java
-@@ -20,8 +20,8 @@
+--- a/net/minecraft/world/entity/projectile/EntityEnderSignal.java
++++ b/net/minecraft/world/entity/projectile/EntityEnderSignal.java
+@@ -39,8 +39,8 @@
}
public void setItem(ItemStack itemstack) {
@@ -11,7 +11,7 @@
itemstack1.setCount(1);
}));
}
-@@ -137,7 +137,7 @@
+@@ -156,7 +156,7 @@
public void loadData(NBTTagCompound nbttagcompound) {
ItemStack itemstack = ItemStack.a(nbttagcompound.getCompound("Item"));
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityEvokerFangs.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityEvokerFangs.patch
index 30081d729..b3670e319 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityEvokerFangs.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityEvokerFangs.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityEvokerFangs.java
-+++ b/net/minecraft/server/EntityEvokerFangs.java
-@@ -114,7 +114,9 @@
+--- a/net/minecraft/world/entity/projectile/EntityEvokerFangs.java
++++ b/net/minecraft/world/entity/projectile/EntityEvokerFangs.java
+@@ -124,7 +124,9 @@
if (entityliving.isAlive() && !entityliving.isInvulnerable() && entityliving != entityliving1) {
if (entityliving1 == null) {
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityFireball.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityFireball.patch
index a1a36789e..91aaba3b8 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityFireball.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityFireball.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/EntityFireball.java
-+++ b/net/minecraft/server/EntityFireball.java
-@@ -1,10 +1,14 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/entity/projectile/EntityFireball.java
++++ b/net/minecraft/world/entity/projectile/EntityFireball.java
+@@ -15,11 +15,15 @@
+ import net.minecraft.world.phys.MovingObjectPosition;
+ import net.minecraft.world.phys.Vec3D;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
@@ -15,7 +16,7 @@
protected EntityFireball(EntityTypes extends EntityFireball> entitytypes, World world) {
super(entitytypes, world);
-@@ -14,6 +18,12 @@
+@@ -29,6 +33,12 @@
this(entitytypes, world);
this.setPositionRotation(d0, d1, d2, this.yaw, this.pitch);
this.af();
@@ -28,7 +29,7 @@
double d6 = (double) MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
if (d6 != 0.0D) {
-@@ -49,6 +59,12 @@
+@@ -64,6 +74,12 @@
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
this.a(movingobjectposition);
@@ -41,7 +42,7 @@
}
this.checkBlockCollisions();
-@@ -133,6 +149,11 @@
+@@ -148,6 +164,11 @@
Entity entity = damagesource.getEntity();
if (entity != null) {
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityFireballFireball.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityFireballFireball.patch
index 69a2fc05a..49fad3371 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityFireballFireball.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityFireballFireball.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityFireballFireball.java
-+++ b/net/minecraft/server/EntityFireballFireball.java
-@@ -18,7 +18,7 @@
+--- a/net/minecraft/world/entity/projectile/EntityFireballFireball.java
++++ b/net/minecraft/world/entity/projectile/EntityFireballFireball.java
+@@ -29,7 +29,7 @@
public void setItem(ItemStack itemstack) {
if (itemstack.getItem() != Items.FIRE_CHARGE || itemstack.hasTag()) {
@@ -9,7 +9,7 @@
itemstack1.setCount(1);
}));
}
-@@ -50,6 +50,6 @@
+@@ -61,6 +61,6 @@
super.loadData(nbttagcompound);
ItemStack itemstack = ItemStack.a(nbttagcompound.getCompound("Item"));
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityFireworks.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityFireworks.patch
index 2a6c512df..872f22c6f 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityFireworks.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityFireworks.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/EntityFireworks.java
-+++ b/net/minecraft/server/EntityFireworks.java
-@@ -5,6 +5,8 @@
- import java.util.OptionalInt;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/projectile/EntityFireworks.java
++++ b/net/minecraft/world/entity/projectile/EntityFireworks.java
+@@ -29,6 +29,8 @@
+ import net.minecraft.world.phys.MovingObjectPositionEntity;
+ import net.minecraft.world.phys.Vec3D;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class EntityFireworks extends IProjectile {
public static final DataWatcherObject FIREWORK_ITEM = DataWatcher.a(EntityFireworks.class, DataWatcherRegistry.g);
-@@ -121,7 +123,11 @@
+@@ -145,7 +147,11 @@
}
if (!this.world.isClientSide && this.ticksFlown > this.expectedLifespan) {
@@ -22,7 +22,7 @@
}
}
-@@ -136,7 +142,11 @@
+@@ -160,7 +166,11 @@
protected void a(MovingObjectPositionEntity movingobjectpositionentity) {
super.a(movingobjectpositionentity);
if (!this.world.isClientSide) {
@@ -35,7 +35,7 @@
}
}
-@@ -146,7 +156,11 @@
+@@ -170,7 +180,11 @@
this.world.getType(blockposition).a(this.world, blockposition, (Entity) this);
if (!this.world.s_() && this.hasExplosions()) {
@@ -48,7 +48,7 @@
}
super.a(movingobjectpositionblock);
-@@ -172,7 +186,9 @@
+@@ -196,7 +210,9 @@
if (f > 0.0F) {
if (this.ridingEntity != null) {
@@ -58,7 +58,7 @@
}
double d0 = 5.0D;
-@@ -199,7 +215,9 @@
+@@ -223,7 +239,9 @@
if (flag) {
float f1 = f * (float) Math.sqrt((5.0D - (double) this.g((Entity) entityliving)) / 5.0D);
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityFishingHook.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityFishingHook.patch
index 977e401d5..fa548f118 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityFishingHook.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityFishingHook.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntityFishingHook.java
-+++ b/net/minecraft/server/EntityFishingHook.java
-@@ -7,6 +7,12 @@
- import java.util.Random;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/projectile/EntityFishingHook.java
++++ b/net/minecraft/world/entity/projectile/EntityFishingHook.java
+@@ -45,6 +45,12 @@
+ import net.minecraft.world.phys.MovingObjectPositionEntity;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.entity.Player;
@@ -13,7 +13,7 @@
public class EntityFishingHook extends IProjectile {
private final Random b;
-@@ -25,6 +31,12 @@
+@@ -63,6 +69,12 @@
private final int an;
private final int lureLevel;
@@ -26,7 +26,7 @@
private EntityFishingHook(World world, EntityHuman entityhuman, int i, int j) {
super(EntityTypes.FISHING_BOBBER, world);
this.b = new Random();
-@@ -253,6 +265,10 @@
+@@ -291,6 +303,10 @@
this.waitTime = 0;
this.ai = 0;
this.getDataWatcher().set(EntityFishingHook.f, false);
@@ -37,7 +37,7 @@
}
} else {
float f;
-@@ -286,6 +302,13 @@
+@@ -324,6 +340,13 @@
worldserver.a(Particles.FISHING, d0, d1, d2, 0, (double) (-f4), 0.01D, (double) f3, 1.0D);
}
} else {
@@ -51,7 +51,7 @@
this.playSound(SoundEffects.ENTITY_FISHING_BOBBER_SPLASH, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
double d3 = this.locY() + 0.5D;
-@@ -322,8 +345,10 @@
+@@ -360,8 +383,10 @@
this.ai = MathHelper.nextInt(this.random, 20, 80);
}
} else {
@@ -64,7 +64,7 @@
}
}
-@@ -390,6 +415,14 @@
+@@ -428,6 +453,14 @@
int i = 0;
if (this.hooked != null) {
@@ -79,7 +79,7 @@
this.reel();
CriterionTriggers.D.a((EntityPlayer) entityhuman, itemstack, this, (Collection) Collections.emptyList());
this.world.broadcastEntityEffect(this, (byte) 31);
-@@ -405,6 +438,15 @@
+@@ -443,6 +476,15 @@
while (iterator.hasNext()) {
ItemStack itemstack1 = (ItemStack) iterator.next();
EntityItem entityitem = new EntityItem(this.world, this.locX(), this.locY(), this.locZ(), itemstack1);
@@ -95,7 +95,7 @@
double d0 = entityhuman.locX() - this.locX();
double d1 = entityhuman.locY() - this.locY();
double d2 = entityhuman.locZ() - this.locZ();
-@@ -412,7 +454,11 @@
+@@ -450,7 +492,11 @@
entityitem.setMot(d0 * 0.1D, d1 * 0.1D + Math.sqrt(Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2)) * 0.08D, d2 * 0.1D);
this.world.addEntity(entityitem);
@@ -108,7 +108,7 @@
if (itemstack1.getItem().a((Tag) TagsItem.FISHES)) {
entityhuman.a(StatisticList.FISH_CAUGHT, 1);
}
-@@ -422,8 +468,25 @@
+@@ -460,8 +506,25 @@
}
if (this.onGround) {
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityLargeFireball.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityLargeFireball.patch
index 31b75323a..81d9934cc 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityLargeFireball.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityLargeFireball.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/EntityLargeFireball.java
-+++ b/net/minecraft/server/EntityLargeFireball.java
-@@ -1,15 +1,19 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/entity/projectile/EntityLargeFireball.java
++++ b/net/minecraft/world/entity/projectile/EntityLargeFireball.java
+@@ -11,16 +11,20 @@
+ import net.minecraft.world.phys.MovingObjectPosition;
+ import net.minecraft.world.phys.MovingObjectPositionEntity;
+import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
+
@@ -20,7 +21,7 @@
}
@Override
-@@ -18,7 +22,15 @@
+@@ -29,7 +33,15 @@
if (!this.world.isClientSide) {
boolean flag = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING);
@@ -37,7 +38,7 @@
this.die();
}
-@@ -49,7 +61,8 @@
+@@ -60,7 +72,8 @@
public void loadData(NBTTagCompound nbttagcompound) {
super.loadData(nbttagcompound);
if (nbttagcompound.hasKeyOfType("ExplosionPower", 99)) {
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityPotion.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityPotion.patch
index 2af85dd28..856247591 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityPotion.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityPotion.patch
@@ -1,12 +1,14 @@
---- a/net/minecraft/server/EntityPotion.java
-+++ b/net/minecraft/server/EntityPotion.java
-@@ -5,6 +5,14 @@
- import java.util.function.Predicate;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/projectile/EntityPotion.java
++++ b/net/minecraft/world/entity/projectile/EntityPotion.java
+@@ -32,6 +32,16 @@
+ import net.minecraft.world.phys.MovingObjectPositionBlock;
+ import net.minecraft.world.phys.MovingObjectPositionEntity;
+// CraftBukkit start
+import java.util.HashMap;
+import java.util.Map;
++import net.minecraft.server.level.EntityPlayer;
++import net.minecraft.world.level.block.Blocks;
+import org.bukkit.craftbukkit.entity.CraftLivingEntity;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.entity.LivingEntity;
@@ -15,7 +17,7 @@
public class EntityPotion extends EntityProjectileThrowable {
public static final Predicate b = EntityLiving::dO;
-@@ -69,7 +77,7 @@
+@@ -96,7 +106,7 @@
if (flag) {
this.splash();
@@ -24,7 +26,7 @@
if (this.isLingering()) {
this.a(itemstack, potionregistry);
} else {
-@@ -106,6 +114,7 @@
+@@ -133,6 +143,7 @@
private void a(List list, @Nullable Entity entity) {
AxisAlignedBB axisalignedbb = this.getBoundingBox().grow(4.0D, 2.0D, 4.0D);
List list1 = this.world.a(EntityLiving.class, axisalignedbb);
@@ -32,7 +34,7 @@
if (!list1.isEmpty()) {
Iterator iterator = list1.iterator();
-@@ -123,21 +132,46 @@
+@@ -150,21 +161,46 @@
d1 = 1.0D;
}
@@ -93,7 +95,7 @@
}
}
}
-@@ -173,7 +207,14 @@
+@@ -200,7 +236,14 @@
entityareaeffectcloud.setColor(nbttagcompound.getInt("CustomPotionColor"));
}
@@ -109,7 +111,7 @@
}
public boolean isLingering() {
-@@ -184,11 +225,19 @@
+@@ -211,11 +254,19 @@
IBlockData iblockdata = this.world.getType(blockposition);
if (iblockdata.a((Tag) TagsBlock.FIRE)) {
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityProjectileThrowable.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityProjectileThrowable.patch
index f6e0b5cbc..ab7f980e9 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityProjectileThrowable.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityProjectileThrowable.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityProjectileThrowable.java
-+++ b/net/minecraft/server/EntityProjectileThrowable.java
-@@ -18,8 +18,8 @@
+--- a/net/minecraft/world/entity/projectile/EntityProjectileThrowable.java
++++ b/net/minecraft/world/entity/projectile/EntityProjectileThrowable.java
+@@ -29,8 +29,8 @@
public void setItem(ItemStack itemstack) {
if (itemstack.getItem() != this.getDefaultItem() || itemstack.hasTag()) {
@@ -11,7 +11,7 @@
}));
}
-@@ -27,6 +27,12 @@
+@@ -38,6 +38,12 @@
protected abstract Item getDefaultItem();
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityShulkerBullet.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityShulkerBullet.patch
index 798f84a05..618d82e93 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityShulkerBullet.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityShulkerBullet.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityShulkerBullet.java
-+++ b/net/minecraft/server/EntityShulkerBullet.java
-@@ -34,8 +34,21 @@
+--- a/net/minecraft/world/entity/projectile/EntityShulkerBullet.java
++++ b/net/minecraft/world/entity/projectile/EntityShulkerBullet.java
+@@ -58,8 +58,21 @@
this.target = entity;
this.dir = EnumDirection.UP;
this.a(enumdirection_enumaxis);
@@ -22,7 +22,7 @@
@Override
public SoundCategory getSoundCategory() {
return SoundCategory.HOSTILE;
-@@ -256,7 +269,7 @@
+@@ -280,7 +293,7 @@
if (flag) {
this.a(entityliving, entity);
if (entity instanceof EntityLiving) {
@@ -31,7 +31,7 @@
}
}
-@@ -282,6 +295,11 @@
+@@ -306,6 +319,11 @@
@Override
public boolean damageEntity(DamageSource damagesource, float f) {
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntitySmallFireball.patch b/nms-patches/net/minecraft/world/entity/projectile/EntitySmallFireball.patch
index 30c995082..0ed936798 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntitySmallFireball.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntitySmallFireball.patch
@@ -1,14 +1,15 @@
---- a/net/minecraft/server/EntitySmallFireball.java
-+++ b/net/minecraft/server/EntitySmallFireball.java
-@@ -1,5 +1,7 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/entity/projectile/EntitySmallFireball.java
++++ b/net/minecraft/world/entity/projectile/EntitySmallFireball.java
+@@ -14,6 +14,8 @@
+ import net.minecraft.world.phys.MovingObjectPositionBlock;
+ import net.minecraft.world.phys.MovingObjectPositionEntity;
+import org.bukkit.event.entity.EntityCombustByEntityEvent; // CraftBukkit
+
public class EntitySmallFireball extends EntityFireballFireball {
public EntitySmallFireball(EntityTypes extends EntitySmallFireball> entitytypes, World world) {
-@@ -8,6 +10,11 @@
+@@ -22,6 +24,11 @@
public EntitySmallFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
super(EntityTypes.SMALL_FIREBALL, entityliving, d0, d1, d2, world);
@@ -20,7 +21,7 @@
}
public EntitySmallFireball(World world, double d0, double d1, double d2, double d3, double d4, double d5) {
-@@ -24,7 +31,14 @@
+@@ -38,7 +45,14 @@
Entity entity1 = this.getShooter();
int i = entity.getFireTicks();
@@ -36,7 +37,7 @@
boolean flag = entity.damageEntity(DamageSource.fireball(this, entity1), 5.0F);
if (!flag) {
-@@ -43,10 +57,10 @@
+@@ -57,10 +71,10 @@
if (!this.world.isClientSide) {
Entity entity = this.getShooter();
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntitySpectralArrow.patch b/nms-patches/net/minecraft/world/entity/projectile/EntitySpectralArrow.patch
index 1e7688aff..eea9216eb 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntitySpectralArrow.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntitySpectralArrow.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntitySpectralArrow.java
-+++ b/net/minecraft/server/EntitySpectralArrow.java
-@@ -35,7 +35,7 @@
+--- a/net/minecraft/world/entity/projectile/EntitySpectralArrow.java
++++ b/net/minecraft/world/entity/projectile/EntitySpectralArrow.java
+@@ -45,7 +45,7 @@
super.a(entityliving);
MobEffect mobeffect = new MobEffect(MobEffects.GLOWING, this.duration, 0);
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityThrownExpBottle.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityThrownExpBottle.patch
index c942cc9e2..5331b3f23 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityThrownExpBottle.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityThrownExpBottle.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityThrownExpBottle.java
-+++ b/net/minecraft/server/EntityThrownExpBottle.java
-@@ -28,9 +28,18 @@
+--- a/net/minecraft/world/entity/projectile/EntityThrownExpBottle.java
++++ b/net/minecraft/world/entity/projectile/EntityThrownExpBottle.java
+@@ -38,9 +38,18 @@
protected void a(MovingObjectPosition movingobjectposition) {
super.a(movingobjectposition);
if (!this.world.isClientSide) {
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityThrownTrident.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityThrownTrident.patch
index 69da22e8e..3d6cf786a 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityThrownTrident.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityThrownTrident.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityThrownTrident.java
-+++ b/net/minecraft/server/EntityThrownTrident.java
-@@ -132,7 +132,7 @@
+--- a/net/minecraft/world/entity/projectile/EntityThrownTrident.java
++++ b/net/minecraft/world/entity/projectile/EntityThrownTrident.java
+@@ -154,7 +154,7 @@
entitylightning.d(Vec3D.c((BaseBlockPosition) blockposition));
entitylightning.d(entity1 instanceof EntityPlayer ? (EntityPlayer) entity1 : null);
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityTippedArrow.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityTippedArrow.patch
index 6e9ecd854..6fd53b380 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityTippedArrow.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityTippedArrow.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityTippedArrow.java
-+++ b/net/minecraft/server/EntityTippedArrow.java
-@@ -122,6 +122,25 @@
+--- a/net/minecraft/world/entity/projectile/EntityTippedArrow.java
++++ b/net/minecraft/world/entity/projectile/EntityTippedArrow.java
+@@ -138,6 +138,25 @@
}
}
@@ -14,7 +14,7 @@
+ }
+
+ public void setType(String string) {
-+ this.potionRegistry = IRegistry.POTION.get(new MinecraftKey(string));
++ this.potionRegistry = IRegistry.POTION.get(new net.minecraft.resources.MinecraftKey(string));
+ this.getDataWatcher().set(EntityTippedArrow.COLOR, PotionUtil.a((Collection) PotionUtil.a(this.potionRegistry, (Collection) this.effects)));
+ }
+
@@ -26,7 +26,7 @@
public int getColor() {
return (Integer) this.datawatcher.get(EntityTippedArrow.COLOR);
}
-@@ -189,7 +208,7 @@
+@@ -205,7 +224,7 @@
while (iterator.hasNext()) {
mobeffect = (MobEffect) iterator.next();
@@ -35,7 +35,7 @@
}
if (!this.effects.isEmpty()) {
-@@ -197,7 +216,7 @@
+@@ -213,7 +232,7 @@
while (iterator.hasNext()) {
mobeffect = (MobEffect) iterator.next();
diff --git a/nms-patches/net/minecraft/world/entity/projectile/EntityWitherSkull.patch b/nms-patches/net/minecraft/world/entity/projectile/EntityWitherSkull.patch
index a9a2c4d6c..f2cc99589 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/EntityWitherSkull.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/EntityWitherSkull.patch
@@ -1,14 +1,15 @@
---- a/net/minecraft/server/EntityWitherSkull.java
-+++ b/net/minecraft/server/EntityWitherSkull.java
-@@ -1,5 +1,7 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/entity/projectile/EntityWitherSkull.java
++++ b/net/minecraft/world/entity/projectile/EntityWitherSkull.java
+@@ -21,6 +21,8 @@
+ import net.minecraft.world.phys.MovingObjectPosition;
+ import net.minecraft.world.phys.MovingObjectPositionEntity;
+import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
+
public class EntityWitherSkull extends EntityFireball {
private static final DataWatcherObject e = DataWatcher.a(EntityWitherSkull.class, DataWatcherRegistry.i);
-@@ -43,7 +45,7 @@
+@@ -64,7 +66,7 @@
if (entity.isAlive()) {
this.a(entityliving, entity);
} else {
@@ -17,7 +18,7 @@
}
}
} else {
-@@ -60,7 +62,7 @@
+@@ -81,7 +83,7 @@
}
if (b0 > 0) {
@@ -26,7 +27,7 @@
}
}
-@@ -73,7 +75,15 @@
+@@ -94,7 +96,15 @@
if (!this.world.isClientSide) {
Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
diff --git a/nms-patches/net/minecraft/world/entity/projectile/IProjectile.patch b/nms-patches/net/minecraft/world/entity/projectile/IProjectile.patch
index 5351564e4..7e46f4c45 100644
--- a/nms-patches/net/minecraft/world/entity/projectile/IProjectile.patch
+++ b/nms-patches/net/minecraft/world/entity/projectile/IProjectile.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/IProjectile.java
-+++ b/net/minecraft/server/IProjectile.java
-@@ -4,6 +4,10 @@
- import java.util.UUID;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/projectile/IProjectile.java
++++ b/net/minecraft/world/entity/projectile/IProjectile.java
+@@ -15,6 +15,10 @@
+ import net.minecraft.world.phys.MovingObjectPositionEntity;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.projectiles.ProjectileSource;
@@ -11,7 +11,7 @@
public abstract class IProjectile extends Entity {
private UUID shooter;
-@@ -19,6 +23,7 @@
+@@ -30,6 +34,7 @@
this.shooter = entity.getUniqueID();
this.c = entity.getId();
}
@@ -19,7 +19,7 @@
}
-@@ -101,6 +106,7 @@
+@@ -112,6 +117,7 @@
}
protected void a(MovingObjectPosition movingobjectposition) {
diff --git a/nms-patches/net/minecraft/world/entity/raid/EntityRaider.patch b/nms-patches/net/minecraft/world/entity/raid/EntityRaider.patch
index 47e3e224f..b3fb21897 100644
--- a/nms-patches/net/minecraft/world/entity/raid/EntityRaider.patch
+++ b/nms-patches/net/minecraft/world/entity/raid/EntityRaider.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityRaider.java
-+++ b/net/minecraft/server/EntityRaider.java
-@@ -131,7 +131,7 @@
+--- a/net/minecraft/world/entity/raid/EntityRaider.java
++++ b/net/minecraft/world/entity/raid/EntityRaider.java
+@@ -167,7 +167,7 @@
MobEffect mobeffect1 = new MobEffect(MobEffects.BAD_OMEN, 120000, i, false, false, true);
if (!this.world.getGameRules().getBoolean(GameRules.DISABLE_RAIDS)) {
@@ -9,7 +9,7 @@
}
}
}
-@@ -398,7 +398,7 @@
+@@ -434,7 +434,7 @@
while (iterator.hasNext()) {
EntityRaider entityraider = (EntityRaider) iterator.next();
@@ -18,7 +18,7 @@
}
}
-@@ -415,7 +415,7 @@
+@@ -451,7 +451,7 @@
while (iterator.hasNext()) {
EntityRaider entityraider = (EntityRaider) iterator.next();
@@ -27,7 +27,7 @@
entityraider.setAggressive(true);
}
-@@ -489,7 +489,7 @@
+@@ -525,7 +525,7 @@
private final T b;
diff --git a/nms-patches/net/minecraft/world/entity/raid/PersistentRaid.patch b/nms-patches/net/minecraft/world/entity/raid/PersistentRaid.patch
index c7c258aca..7376ab31e 100644
--- a/nms-patches/net/minecraft/world/entity/raid/PersistentRaid.patch
+++ b/nms-patches/net/minecraft/world/entity/raid/PersistentRaid.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/PersistentRaid.java
-+++ b/net/minecraft/server/PersistentRaid.java
-@@ -92,19 +92,33 @@
+--- a/net/minecraft/world/entity/raid/PersistentRaid.java
++++ b/net/minecraft/world/entity/raid/PersistentRaid.java
+@@ -110,19 +110,33 @@
boolean flag = false;
if (!raid.isStarted()) {
diff --git a/nms-patches/net/minecraft/world/entity/raid/Raid.patch b/nms-patches/net/minecraft/world/entity/raid/Raid.patch
index 8412ec4e8..8e963ea25 100644
--- a/nms-patches/net/minecraft/world/entity/raid/Raid.patch
+++ b/nms-patches/net/minecraft/world/entity/raid/Raid.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/Raid.java
-+++ b/net/minecraft/server/Raid.java
-@@ -111,6 +111,12 @@
+--- a/net/minecraft/world/entity/raid/Raid.java
++++ b/net/minecraft/world/entity/raid/Raid.java
+@@ -153,6 +153,12 @@
return this.status == Raid.Status.LOSS;
}
@@ -13,7 +13,7 @@
public World getWorld() {
return this.world;
}
-@@ -186,6 +192,7 @@
+@@ -228,6 +234,7 @@
this.active = this.world.isLoaded(this.center);
if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL) {
@@ -21,7 +21,7 @@
this.stop();
return;
}
-@@ -205,13 +212,16 @@
+@@ -247,13 +254,16 @@
if (!this.world.a_(this.center)) {
if (this.groupsSpawned > 0) {
this.status = Raid.Status.LOSS;
@@ -38,7 +38,7 @@
this.stop();
return;
}
-@@ -285,6 +295,7 @@
+@@ -327,6 +337,7 @@
}
if (j > 3) {
@@ -46,7 +46,7 @@
this.stop();
break;
}
-@@ -297,6 +308,7 @@
+@@ -339,6 +350,7 @@
this.status = Raid.Status.VICTORY;
Iterator iterator = this.heroes.iterator();
@@ -54,7 +54,7 @@
while (iterator.hasNext()) {
UUID uuid = (UUID) iterator.next();
Entity entity = this.world.getEntity(uuid);
-@@ -310,9 +322,11 @@
+@@ -352,9 +364,11 @@
entityplayer.a(StatisticList.RAID_WIN);
CriterionTriggers.H.a(entityplayer);
@@ -66,7 +66,7 @@
}
}
-@@ -320,6 +334,7 @@
+@@ -362,6 +376,7 @@
} else if (this.a()) {
++this.x;
if (this.x >= 600) {
@@ -74,7 +74,7 @@
this.stop();
return;
}
-@@ -454,6 +469,10 @@
+@@ -496,6 +511,10 @@
Raid.Wave[] araid_wave = Raid.Wave.f;
int j = araid_wave.length;
@@ -85,7 +85,7 @@
for (int k = 0; k < j; ++k) {
Raid.Wave raid_wave = araid_wave[k];
int l = this.a(raid_wave, i, flag1) + this.a(raid_wave, this.random, i, difficultydamagescaler, flag1);
-@@ -466,9 +485,11 @@
+@@ -508,9 +527,11 @@
entityraider.setPatrolLeader(true);
this.a(i, entityraider);
flag = true;
@@ -97,7 +97,7 @@
if (raid_wave.g == EntityTypes.RAVAGER) {
EntityRaider entityraider1 = null;
-@@ -487,6 +508,7 @@
+@@ -529,6 +550,7 @@
this.a(i, entityraider1, blockposition, false);
entityraider1.setPositionRotation(blockposition, 0.0F, 0.0F);
entityraider1.startRiding(entityraider);
@@ -105,7 +105,7 @@
}
}
}
-@@ -496,6 +518,7 @@
+@@ -538,6 +560,7 @@
++this.groupsSpawned;
this.updateProgress();
this.H();
@@ -113,7 +113,7 @@
}
public void a(int i, EntityRaider entityraider, @Nullable BlockPosition blockposition, boolean flag) {
-@@ -511,7 +534,7 @@
+@@ -553,7 +576,7 @@
entityraider.prepare(this.world, this.world.getDamageScaler(blockposition), EnumMobSpawn.EVENT, (GroupDataEntity) null, (NBTTagCompound) null);
entityraider.a(i, false);
entityraider.setOnGround(true);
@@ -122,7 +122,7 @@
}
}
-@@ -756,6 +779,12 @@
+@@ -798,6 +821,12 @@
this.heroes.add(entity.getUniqueID());
}
diff --git a/nms-patches/net/minecraft/world/entity/vehicle/EntityBoat.patch b/nms-patches/net/minecraft/world/entity/vehicle/EntityBoat.patch
index ce60e757a..d500f4f2b 100644
--- a/nms-patches/net/minecraft/world/entity/vehicle/EntityBoat.patch
+++ b/nms-patches/net/minecraft/world/entity/vehicle/EntityBoat.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntityBoat.java
-+++ b/net/minecraft/server/EntityBoat.java
-@@ -4,6 +4,15 @@
- import java.util.List;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/vehicle/EntityBoat.java
++++ b/net/minecraft/world/entity/vehicle/EntityBoat.java
+@@ -48,6 +48,15 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapes;
+// CraftBukkit start
+import org.bukkit.Location;
@@ -16,7 +16,7 @@
public class EntityBoat extends Entity {
private static final DataWatcherObject b = DataWatcher.a(EntityBoat.class, DataWatcherRegistry.b);
-@@ -38,6 +47,14 @@
+@@ -82,6 +91,14 @@
private float aD;
private float aE;
@@ -31,7 +31,7 @@
public EntityBoat(EntityTypes extends EntityBoat> entitytypes, World world) {
super(entitytypes, world);
this.ah = new float[2];
-@@ -108,6 +125,19 @@
+@@ -152,6 +169,19 @@
if (this.isInvulnerable(damagesource)) {
return false;
} else if (!this.world.isClientSide && !this.dead) {
@@ -51,7 +51,7 @@
this.c(-this.o());
this.b(10);
this.setDamage(this.getDamage() + f * 10.0F);
-@@ -115,6 +145,15 @@
+@@ -159,6 +189,15 @@
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
if (flag || this.getDamage() > 40.0F) {
@@ -67,7 +67,7 @@
if (!flag && this.world.getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) {
this.a((IMaterial) this.g());
}
-@@ -149,9 +188,29 @@
+@@ -193,9 +232,29 @@
public void collide(Entity entity) {
if (entity instanceof EntityBoat) {
if (entity.getBoundingBox().minY < this.getBoundingBox().maxY) {
@@ -97,7 +97,7 @@
super.collide(entity);
}
-@@ -185,6 +244,7 @@
+@@ -229,6 +288,7 @@
return this.getDirection().g();
}
@@ -105,7 +105,7 @@
@Override
public void tick() {
this.ay = this.ax;
-@@ -225,6 +285,22 @@
+@@ -269,6 +329,22 @@
this.setMot(Vec3D.ORIGIN);
}
@@ -128,7 +128,7 @@
this.q();
for (int i = 0; i <= 1; ++i) {
-@@ -709,6 +785,11 @@
+@@ -753,6 +829,11 @@
this.b(this.fallDistance, 1.0F);
if (!this.world.isClientSide && !this.dead) {
@@ -140,7 +140,7 @@
this.die();
if (this.world.getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) {
int i;
-@@ -722,6 +803,7 @@
+@@ -766,6 +847,7 @@
}
}
}
diff --git a/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.patch b/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.patch
index 6e6a88a0f..d4de38ff2 100644
--- a/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.patch
+++ b/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntityMinecartAbstract.java
-+++ b/net/minecraft/server/EntityMinecartAbstract.java
-@@ -10,6 +10,15 @@
- import java.util.Map;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
++++ b/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java
+@@ -48,6 +48,15 @@
+ import net.minecraft.world.phys.AxisAlignedBB;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.Location;
@@ -16,7 +16,7 @@
public abstract class EntityMinecartAbstract extends Entity {
private static final DataWatcherObject b = DataWatcher.a(EntityMinecartAbstract.class, DataWatcherRegistry.b);
-@@ -20,7 +29,7 @@
+@@ -58,7 +67,7 @@
private static final DataWatcherObject g = DataWatcher.a(EntityMinecartAbstract.class, DataWatcherRegistry.i);
private static final ImmutableMap> ag = ImmutableMap.of(EntityPose.STANDING, ImmutableList.of(0, 1, -1), EntityPose.CROUCHING, ImmutableList.of(0, 1, -1), EntityPose.SWIMMING, ImmutableList.of(0, 1));
private boolean ah;
@@ -25,7 +25,7 @@
BaseBlockPosition baseblockposition = EnumDirection.WEST.p();
BaseBlockPosition baseblockposition1 = EnumDirection.EAST.p();
BaseBlockPosition baseblockposition2 = EnumDirection.NORTH.p();
-@@ -48,6 +57,17 @@
+@@ -86,6 +95,17 @@
private double an;
private double ao;
@@ -43,7 +43,7 @@
protected EntityMinecartAbstract(EntityTypes> entitytypes, World world) {
super(entitytypes, world);
this.i = true;
-@@ -175,6 +195,19 @@
+@@ -213,6 +233,19 @@
if (this.isInvulnerable(damagesource)) {
return false;
} else {
@@ -63,7 +63,7 @@
this.d(-this.n());
this.c(10);
this.velocityChanged();
-@@ -182,6 +215,15 @@
+@@ -220,6 +253,15 @@
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
if (flag || this.getDamage() > 40.0F) {
@@ -79,7 +79,7 @@
this.ejectPassengers();
if (flag && !this.hasCustomName()) {
this.die();
-@@ -234,6 +276,14 @@
+@@ -272,6 +314,14 @@
@Override
public void tick() {
@@ -94,7 +94,7 @@
if (this.getType() > 0) {
this.c(this.getType() - 1);
}
-@@ -246,7 +296,7 @@
+@@ -284,7 +334,7 @@
this.an();
}
@@ -103,7 +103,7 @@
if (this.world.isClientSide) {
if (this.aj > 0) {
double d0 = this.locX() + (this.ak - this.locX()) / (double) this.aj;
-@@ -309,6 +359,18 @@
+@@ -347,6 +397,18 @@
}
this.setYawPitch(this.yaw, this.pitch);
@@ -122,7 +122,7 @@
if (this.getMinecartType() == EntityMinecartAbstract.EnumMinecartType.RIDEABLE && c(this.getMot()) > 0.01D) {
List list = this.world.getEntities(this, this.getBoundingBox().grow(0.20000000298023224D, 0.0D, 0.20000000298023224D), IEntitySelector.a(this));
-@@ -317,8 +379,26 @@
+@@ -355,8 +417,26 @@
Entity entity = (Entity) list.get(l);
if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) {
@@ -149,7 +149,7 @@
entity.collide(this);
}
}
-@@ -330,6 +410,14 @@
+@@ -368,6 +448,14 @@
Entity entity1 = (Entity) iterator.next();
if (!this.w(entity1) && entity1.isCollidable() && entity1 instanceof EntityMinecartAbstract) {
@@ -164,7 +164,7 @@
entity1.collide(this);
}
}
-@@ -346,7 +434,7 @@
+@@ -384,7 +472,7 @@
}
protected double getMaxSpeed() {
@@ -173,7 +173,7 @@
}
public void a(int i, int j, int k, boolean flag) {}
-@@ -357,12 +445,16 @@
+@@ -395,12 +483,16 @@
this.setMot(MathHelper.a(vec3d.x, -d0, d0), vec3d.y, MathHelper.a(vec3d.z, -d0, d0));
if (this.onGround) {
@@ -192,7 +192,7 @@
}
}
-@@ -549,7 +641,7 @@
+@@ -587,7 +679,7 @@
}
protected void decelerate() {
@@ -201,7 +201,7 @@
this.setMot(this.getMot().d(d0, 0.0D, d0));
}
-@@ -632,6 +724,14 @@
+@@ -670,6 +762,14 @@
if (!this.world.isClientSide) {
if (!entity.noclip && !this.noclip) {
if (!this.w(entity)) {
@@ -216,7 +216,7 @@
double d0 = entity.locX() - this.locX();
double d1 = entity.locZ() - this.locZ();
double d2 = d0 * d0 + d1 * d1;
-@@ -767,4 +867,26 @@
+@@ -805,4 +905,26 @@
private EnumMinecartType() {}
}
diff --git a/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartCommandBlock.patch b/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartCommandBlock.patch
index b9590a622..c1ac735e0 100644
--- a/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartCommandBlock.patch
+++ b/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartCommandBlock.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EntityMinecartCommandBlock.java
-+++ b/net/minecraft/server/EntityMinecartCommandBlock.java
-@@ -103,5 +103,12 @@
+--- a/net/minecraft/world/entity/vehicle/EntityMinecartCommandBlock.java
++++ b/net/minecraft/world/entity/vehicle/EntityMinecartCommandBlock.java
+@@ -120,5 +120,12 @@
public CommandListenerWrapper getWrapper() {
return new CommandListenerWrapper(this, EntityMinecartCommandBlock.this.getPositionVector(), EntityMinecartCommandBlock.this.bi(), this.d(), 2, this.getName().getString(), EntityMinecartCommandBlock.this.getScoreboardDisplayName(), this.d().getMinecraftServer(), EntityMinecartCommandBlock.this);
}
diff --git a/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartContainer.patch b/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartContainer.patch
index de105add0..3955811ea 100644
--- a/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartContainer.patch
+++ b/nms-patches/net/minecraft/world/entity/vehicle/EntityMinecartContainer.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/EntityMinecartContainer.java
-+++ b/net/minecraft/server/EntityMinecartContainer.java
-@@ -3,6 +3,14 @@
- import java.util.Iterator;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/entity/vehicle/EntityMinecartContainer.java
++++ b/net/minecraft/world/entity/vehicle/EntityMinecartContainer.java
+@@ -29,6 +29,14 @@
+ import net.minecraft.world.level.storage.loot.parameters.LootContextParameterSets;
+ import net.minecraft.world.level.storage.loot.parameters.LootContextParameters;
+// CraftBukkit start
+import java.util.List;
@@ -15,7 +15,7 @@
public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements IInventory, ITileInventory {
private NonNullList items;
-@@ -11,15 +19,56 @@
+@@ -37,15 +45,56 @@
public MinecraftKey lootTable;
public long lootTableSeed;
diff --git a/nms-patches/net/minecraft/world/food/FoodMetaData.patch b/nms-patches/net/minecraft/world/food/FoodMetaData.patch
index 178068a8e..4b174f7aa 100644
--- a/nms-patches/net/minecraft/world/food/FoodMetaData.patch
+++ b/nms-patches/net/minecraft/world/food/FoodMetaData.patch
@@ -1,6 +1,17 @@
---- a/net/minecraft/server/FoodMetaData.java
-+++ b/net/minecraft/server/FoodMetaData.java
-@@ -6,9 +6,22 @@
+--- a/net/minecraft/world/food/FoodMetaData.java
++++ b/net/minecraft/world/food/FoodMetaData.java
+@@ -8,15 +8,33 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.level.GameRules;
+
++// CraftBukkit start
++import net.minecraft.network.protocol.game.PacketPlayOutUpdateHealth;
++import net.minecraft.server.level.EntityPlayer;
++// CraftBukkit end
++
+ public class FoodMetaData {
+
+ public int foodLevel = 20;
public float saturationLevel = 5.0F;
public float exhaustionLevel;
private int foodTickTimer;
@@ -24,26 +35,26 @@
public void eat(int i, float f) {
this.foodLevel = Math.min(i + this.foodLevel, 20);
-@@ -18,8 +31,17 @@
+@@ -26,8 +44,17 @@
public void a(Item item, ItemStack itemstack) {
if (item.isFood()) {
FoodInfo foodinfo = item.getFoodInfo();
+ // CraftBukkit start
+ int oldFoodLevel = foodLevel;
-+
+
+- this.eat(foodinfo.getNutrition(), foodinfo.getSaturationModifier());
+ org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callFoodLevelChangeEvent(entityhuman, foodinfo.getNutrition() + oldFoodLevel, itemstack);
+
+ if (!event.isCancelled()) {
+ this.eat(event.getFoodLevel() - oldFoodLevel, foodinfo.getSaturationModifier());
+ }
-
-- this.eat(foodinfo.getNutrition(), foodinfo.getSaturationModifier());
++
+ ((EntityPlayer) entityhuman).getBukkitEntity().sendHealthUpdate();
+ // CraftBukkit end
}
}
-@@ -33,7 +55,15 @@
+@@ -41,7 +68,15 @@
if (this.saturationLevel > 0.0F) {
this.saturationLevel = Math.max(this.saturationLevel - 1.0F, 0.0F);
} else if (enumdifficulty != EnumDifficulty.PEACEFUL) {
@@ -60,7 +71,7 @@
}
}
-@@ -41,23 +71,25 @@
+@@ -49,23 +84,25 @@
if (flag && this.saturationLevel > 0.0F && entityhuman.eJ() && this.foodLevel >= 20) {
++this.foodTickTimer;
diff --git a/nms-patches/net/minecraft/world/inventory/Container.patch b/nms-patches/net/minecraft/world/inventory/Container.patch
index e422011b5..25cf789a5 100644
--- a/nms-patches/net/minecraft/world/inventory/Container.patch
+++ b/nms-patches/net/minecraft/world/inventory/Container.patch
@@ -1,13 +1,15 @@
---- a/net/minecraft/server/Container.java
-+++ b/net/minecraft/server/Container.java
-@@ -7,6 +7,18 @@
- import java.util.Set;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/inventory/Container.java
++++ b/net/minecraft/world/inventory/Container.java
+@@ -21,6 +21,20 @@
+ import net.minecraft.world.level.block.Block;
+ import net.minecraft.world.level.block.entity.TileEntity;
+// CraftBukkit start
+import com.google.common.base.Preconditions;
+import java.util.HashMap;
+import java.util.Map;
++import net.minecraft.network.chat.IChatBaseComponent;
++import net.minecraft.network.protocol.game.PacketPlayOutSetSlot;
+import org.bukkit.craftbukkit.inventory.CraftInventory;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.event.Event.Result;
@@ -19,7 +21,7 @@
public abstract class Container {
public NonNullList items = NonNullList.a();
-@@ -21,6 +33,27 @@
+@@ -35,6 +49,27 @@
private final List listeners = Lists.newArrayList();
private final Set k = Sets.newHashSet();
@@ -47,7 +49,7 @@
protected Container(@Nullable Containers> containers, int i) {
this.e = containers;
this.windowId = i;
-@@ -202,6 +235,7 @@
+@@ -216,6 +251,7 @@
k = playerinventory.getCarried().getCount();
Iterator iterator = this.i.iterator();
@@ -55,7 +57,7 @@
while (iterator.hasNext()) {
Slot slot1 = (Slot) iterator.next();
ItemStack itemstack3 = playerinventory.getCarried();
-@@ -217,12 +251,48 @@
+@@ -231,12 +267,48 @@
}
k -= itemstack4.getCount() - j1;
@@ -107,7 +109,7 @@
}
this.d();
-@@ -239,8 +309,11 @@
+@@ -253,8 +325,11 @@
if (i == -999) {
if (!playerinventory.getCarried().isEmpty()) {
if (j == 0) {
@@ -120,7 +122,7 @@
}
if (j == 1) {
-@@ -328,6 +401,15 @@
+@@ -342,6 +417,15 @@
}
slot2.d();
@@ -136,7 +138,7 @@
}
}
} else if (inventoryclicktype == InventoryClickType.SWAP) {
-@@ -430,8 +512,11 @@
+@@ -444,8 +528,11 @@
PlayerInventory playerinventory = entityhuman.inventory;
if (!playerinventory.getCarried().isEmpty()) {
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerAccess.patch b/nms-patches/net/minecraft/world/inventory/ContainerAccess.patch
index a07ee3132..08dcb2564 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerAccess.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerAccess.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ContainerAccess.java
-+++ b/net/minecraft/server/ContainerAccess.java
-@@ -6,6 +6,20 @@
+--- a/net/minecraft/world/inventory/ContainerAccess.java
++++ b/net/minecraft/world/inventory/ContainerAccess.java
+@@ -8,6 +8,20 @@
public interface ContainerAccess {
@@ -21,7 +21,7 @@
ContainerAccess a = new ContainerAccess() {
@Override
public Optional a(BiFunction bifunction) {
-@@ -15,6 +29,18 @@
+@@ -17,6 +31,18 @@
static ContainerAccess at(final World world, final BlockPosition blockposition) {
return new ContainerAccess() {
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerAnvil.patch b/nms-patches/net/minecraft/world/inventory/ContainerAnvil.patch
index e6dea0437..779aa7ff0 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerAnvil.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerAnvil.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ContainerAnvil.java
-+++ b/net/minecraft/server/ContainerAnvil.java
-@@ -6,12 +6,20 @@
+--- a/net/minecraft/world/inventory/ContainerAnvil.java
++++ b/net/minecraft/world/inventory/ContainerAnvil.java
+@@ -19,12 +19,20 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -21,7 +21,7 @@
public ContainerAnvil(int i, PlayerInventory playerinventory) {
this(i, playerinventory, ContainerAccess.a);
-@@ -85,7 +93,7 @@
+@@ -98,7 +106,7 @@
byte b1 = 0;
if (itemstack.isEmpty()) {
@@ -30,7 +30,7 @@
this.levelCost.set(0);
} else {
ItemStack itemstack1 = itemstack.cloneItemStack();
-@@ -103,7 +111,7 @@
+@@ -116,7 +124,7 @@
if (itemstack1.e() && itemstack1.getItem().a(itemstack, itemstack2)) {
k = Math.min(itemstack1.getDamage(), itemstack1.h() / 4);
if (k <= 0) {
@@ -39,7 +39,7 @@
this.levelCost.set(0);
return;
}
-@@ -118,7 +126,7 @@
+@@ -131,7 +139,7 @@
this.h = i1;
} else {
if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.e())) {
@@ -48,7 +48,7 @@
this.levelCost.set(0);
return;
}
-@@ -208,7 +216,7 @@
+@@ -221,7 +229,7 @@
}
if (flag2 && !flag1) {
@@ -57,7 +57,7 @@
this.levelCost.set(0);
return;
}
-@@ -232,11 +240,11 @@
+@@ -245,11 +253,11 @@
itemstack1 = ItemStack.b;
}
@@ -72,7 +72,7 @@
itemstack1 = ItemStack.b;
}
-@@ -255,7 +263,7 @@
+@@ -268,7 +276,7 @@
EnchantmentManager.a(map, itemstack1);
}
@@ -81,7 +81,7 @@
this.c();
}
}
-@@ -278,4 +286,18 @@
+@@ -291,4 +299,18 @@
this.e();
}
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerAnvilAbstract.patch b/nms-patches/net/minecraft/world/inventory/ContainerAnvilAbstract.patch
index eadec44f6..422886eaf 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerAnvilAbstract.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerAnvilAbstract.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ContainerAnvilAbstract.java
-+++ b/net/minecraft/server/ContainerAnvilAbstract.java
-@@ -79,6 +79,7 @@
+--- a/net/minecraft/world/inventory/ContainerAnvilAbstract.java
++++ b/net/minecraft/world/inventory/ContainerAnvilAbstract.java
+@@ -85,6 +85,7 @@
@Override
public boolean canUse(EntityHuman entityhuman) {
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerBeacon.patch b/nms-patches/net/minecraft/world/inventory/ContainerBeacon.patch
index 2e0b86f2b..96c61a448 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerBeacon.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerBeacon.patch
@@ -1,9 +1,13 @@
---- a/net/minecraft/server/ContainerBeacon.java
-+++ b/net/minecraft/server/ContainerBeacon.java
-@@ -1,11 +1,17 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/inventory/ContainerBeacon.java
++++ b/net/minecraft/world/inventory/ContainerBeacon.java
+@@ -8,12 +8,21 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.level.block.Blocks;
-+import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit
++// CraftBukkit start
++import net.minecraft.world.entity.player.PlayerInventory;
++import org.bukkit.craftbukkit.inventory.CraftInventoryView;
++// CraftBukkit end
+
public class ContainerBeacon extends Container {
@@ -18,7 +22,7 @@
public ContainerBeacon(int i, IInventory iinventory) {
this(i, iinventory, new ContainerProperties(3), ContainerAccess.a);
-@@ -13,6 +19,7 @@
+@@ -21,6 +30,7 @@
public ContainerBeacon(int i, IInventory iinventory, IContainerProperties icontainerproperties, ContainerAccess containeraccess) {
super(Containers.BEACON, i);
@@ -26,7 +30,7 @@
this.beacon = new InventorySubcontainer(1) {
@Override
public boolean b(int j, ItemStack itemstack) {
-@@ -62,6 +69,7 @@
+@@ -70,6 +80,7 @@
@Override
public boolean canUse(EntityHuman entityhuman) {
@@ -34,7 +38,7 @@
return a(this.containerAccess, entityhuman, Blocks.BEACON);
}
-@@ -143,4 +151,17 @@
+@@ -151,4 +162,17 @@
return 1;
}
}
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerBrewingStand.patch b/nms-patches/net/minecraft/world/inventory/ContainerBrewingStand.patch
index a10f4faa2..d51714d29 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerBrewingStand.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerBrewingStand.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/ContainerBrewingStand.java
-+++ b/net/minecraft/server/ContainerBrewingStand.java
-@@ -1,17 +1,28 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/inventory/ContainerBrewingStand.java
++++ b/net/minecraft/world/inventory/ContainerBrewingStand.java
+@@ -13,18 +13,29 @@
+ import net.minecraft.world.item.alchemy.PotionRegistry;
+ import net.minecraft.world.item.alchemy.PotionUtil;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventoryBrewer;
@@ -29,7 +30,7 @@
a(iinventory, 5);
a(icontainerproperties, 2);
this.brewingStand = iinventory;
-@@ -39,6 +50,7 @@
+@@ -52,6 +63,7 @@
@Override
public boolean canUse(EntityHuman entityhuman) {
@@ -37,7 +38,7 @@
return this.brewingStand.a(entityhuman);
}
-@@ -171,4 +183,17 @@
+@@ -184,4 +196,17 @@
return item == Items.POTION || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION || item == Items.GLASS_BOTTLE;
}
}
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerCartography.patch b/nms-patches/net/minecraft/world/inventory/ContainerCartography.patch
index 86b965eb9..a3553e1fa 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerCartography.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerCartography.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/ContainerCartography.java
-+++ b/net/minecraft/server/ContainerCartography.java
-@@ -1,7 +1,29 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/inventory/ContainerCartography.java
++++ b/net/minecraft/world/inventory/ContainerCartography.java
+@@ -13,8 +13,30 @@
+ import net.minecraft.world.level.block.Blocks;
+ import net.minecraft.world.level.saveddata.maps.WorldMap;
+// CraftBukkit start
+import org.bukkit.Location;
@@ -30,7 +31,7 @@
private final ContainerAccess containerAccess;
private long e;
public final IInventory inventory;
-@@ -19,6 +41,13 @@
+@@ -32,6 +54,13 @@
ContainerCartography.this.a((IInventory) this);
super.update();
}
@@ -44,7 +45,7 @@
};
this.resultInventory = new InventoryCraftResult() {
@Override
-@@ -26,6 +55,13 @@
+@@ -39,6 +68,13 @@
ContainerCartography.this.a((IInventory) this);
super.update();
}
@@ -58,7 +59,7 @@
};
this.containerAccess = containeraccess;
this.a(new Slot(this.inventory, 0, 15, 15) {
-@@ -78,10 +114,12 @@
+@@ -91,10 +127,12 @@
this.a(new Slot(playerinventory, j, 8 + j * 18, 142));
}
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerChest.patch b/nms-patches/net/minecraft/world/inventory/ContainerChest.patch
index 0387d3c5f..9e7c02ef4 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerChest.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerChest.patch
@@ -1,9 +1,11 @@
---- a/net/minecraft/server/ContainerChest.java
-+++ b/net/minecraft/server/ContainerChest.java
-@@ -1,9 +1,37 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/inventory/ContainerChest.java
++++ b/net/minecraft/world/inventory/ContainerChest.java
+@@ -6,10 +6,39 @@
+ import net.minecraft.world.entity.player.PlayerInventory;
+ import net.minecraft.world.item.ItemStack;
+// CraftBukkit start
++import net.minecraft.world.InventoryLargeChest;
+import org.bukkit.craftbukkit.inventory.CraftInventory;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+// CraftBukkit end
@@ -38,7 +40,7 @@
private ContainerChest(Containers> containers, int i, PlayerInventory playerinventory, int j) {
this(containers, i, playerinventory, new InventorySubcontainer(9 * j), j);
-@@ -49,6 +77,10 @@
+@@ -55,6 +84,10 @@
iinventory.startOpen(playerinventory.player);
int k = (this.d - 4) * 18;
@@ -49,7 +51,7 @@
int l;
int i1;
-@@ -72,6 +104,7 @@
+@@ -78,6 +111,7 @@
@Override
public boolean canUse(EntityHuman entityhuman) {
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerDispenser.patch b/nms-patches/net/minecraft/world/inventory/ContainerDispenser.patch
index 5c5283c83..7d2faa60a 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerDispenser.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerDispenser.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/ContainerDispenser.java
-+++ b/net/minecraft/server/ContainerDispenser.java
-@@ -1,8 +1,17 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/inventory/ContainerDispenser.java
++++ b/net/minecraft/world/inventory/ContainerDispenser.java
+@@ -6,9 +6,18 @@
+ import net.minecraft.world.entity.player.PlayerInventory;
+ import net.minecraft.world.item.ItemStack;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventory;
@@ -18,7 +19,7 @@
public ContainerDispenser(int i, PlayerInventory playerinventory) {
this(i, playerinventory, new InventorySubcontainer(9));
-@@ -10,6 +19,10 @@
+@@ -16,6 +25,10 @@
public ContainerDispenser(int i, PlayerInventory playerinventory, IInventory iinventory) {
super(Containers.GENERIC_3X3, i);
@@ -29,7 +30,7 @@
a(iinventory, 9);
this.items = iinventory;
iinventory.startOpen(playerinventory.player);
-@@ -37,6 +50,7 @@
+@@ -43,6 +56,7 @@
@Override
public boolean canUse(EntityHuman entityhuman) {
@@ -37,7 +38,7 @@
return this.items.a(entityhuman);
}
-@@ -78,4 +92,17 @@
+@@ -84,4 +98,17 @@
super.b(entityhuman);
this.items.closeContainer(entityhuman);
}
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerEnchantTable.patch b/nms-patches/net/minecraft/world/inventory/ContainerEnchantTable.patch
index c5710cede..c2e6b5ead 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerEnchantTable.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerEnchantTable.patch
@@ -1,11 +1,12 @@
---- a/net/minecraft/server/ContainerEnchantTable.java
-+++ b/net/minecraft/server/ContainerEnchantTable.java
-@@ -3,6 +3,20 @@
- import java.util.List;
- import java.util.Random;
+--- a/net/minecraft/world/inventory/ContainerEnchantTable.java
++++ b/net/minecraft/world/inventory/ContainerEnchantTable.java
+@@ -20,6 +20,21 @@
+ import net.minecraft.world.item.enchantment.WeightedRandomEnchant;
+ import net.minecraft.world.level.block.Blocks;
+// CraftBukkit start
+import java.util.Map;
++import net.minecraft.world.item.enchantment.Enchantment;
+import org.bukkit.Location;
+import org.bukkit.NamespacedKey;
+import org.bukkit.craftbukkit.inventory.CraftInventoryEnchanting;
@@ -21,7 +22,7 @@
public class ContainerEnchantTable extends Container {
private final IInventory enchantSlots;
-@@ -12,6 +26,10 @@
+@@ -29,6 +44,10 @@
public final int[] costs;
public final int[] enchantments;
public final int[] levels;
@@ -32,7 +33,7 @@
public ContainerEnchantTable(int i, PlayerInventory playerinventory) {
this(i, playerinventory, ContainerAccess.a);
-@@ -25,6 +43,13 @@
+@@ -42,6 +61,13 @@
super.update();
ContainerEnchantTable.this.a((IInventory) this);
}
@@ -46,7 +47,7 @@
};
this.h = new Random();
this.i = ContainerProperty.a();
-@@ -72,6 +97,9 @@
+@@ -89,6 +115,9 @@
this.a(ContainerProperty.a(this.levels, 0));
this.a(ContainerProperty.a(this.levels, 1));
this.a(ContainerProperty.a(this.levels, 2));
@@ -56,7 +57,7 @@
}
@Override
-@@ -79,7 +107,7 @@
+@@ -96,7 +125,7 @@
if (iinventory == this.enchantSlots) {
ItemStack itemstack = iinventory.getItem(0);
@@ -65,7 +66,7 @@
this.containerAccess.a((world, blockposition) -> {
int i = 0;
-@@ -135,12 +163,47 @@
+@@ -152,12 +181,47 @@
if (list != null && !list.isEmpty()) {
WeightedRandomEnchant weightedrandomenchant = (WeightedRandomEnchant) list.get(this.h.nextInt(list.size()));
@@ -114,7 +115,7 @@
this.c();
});
} else {
-@@ -167,9 +230,24 @@
+@@ -184,9 +248,24 @@
ItemStack itemstack2 = itemstack;
List list = this.a(itemstack, i, this.costs[i]);
@@ -141,7 +142,7 @@
if (flag) {
itemstack2 = new ItemStack(Items.ENCHANTED_BOOK);
-@@ -182,16 +260,29 @@
+@@ -199,16 +278,29 @@
this.enchantSlots.setItem(0, itemstack2);
}
@@ -177,7 +178,7 @@
if (!entityhuman.abilities.canInstantlyBuild) {
itemstack1.subtract(j);
if (itemstack1.isEmpty()) {
-@@ -238,6 +329,7 @@
+@@ -255,6 +347,7 @@
@Override
public boolean canUse(EntityHuman entityhuman) {
@@ -185,7 +186,7 @@
return a(this.containerAccess, entityhuman, Blocks.ENCHANTING_TABLE);
}
-@@ -289,4 +381,17 @@
+@@ -306,4 +399,17 @@
return itemstack;
}
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerFurnace.patch b/nms-patches/net/minecraft/world/inventory/ContainerFurnace.patch
index 5c6c8c83a..23ad45e6b 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerFurnace.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerFurnace.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/ContainerFurnace.java
-+++ b/net/minecraft/server/ContainerFurnace.java
-@@ -1,5 +1,10 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/inventory/ContainerFurnace.java
++++ b/net/minecraft/world/inventory/ContainerFurnace.java
+@@ -14,6 +14,11 @@
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.level.block.entity.TileEntityFurnace;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace;
@@ -11,7 +12,7 @@
public abstract class ContainerFurnace extends ContainerRecipeBook {
private final IInventory furnace;
-@@ -8,6 +13,22 @@
+@@ -22,6 +27,22 @@
private final Recipes extends RecipeCooking> f;
private final RecipeBookType g;
@@ -34,7 +35,7 @@
protected ContainerFurnace(Containers> containers, Recipes extends RecipeCooking> recipes, RecipeBookType recipebooktype, int i, PlayerInventory playerinventory) {
this(containers, recipes, recipebooktype, i, playerinventory, new InventorySubcontainer(3), new ContainerProperties(4));
}
-@@ -24,6 +45,7 @@
+@@ -38,6 +59,7 @@
this.a(new Slot(iinventory, 0, 56, 17));
this.a((Slot) (new SlotFurnaceFuel(this, iinventory, 1, 56, 53)));
this.a((Slot) (new SlotFurnaceResult(playerinventory.player, iinventory, 2, 116, 35)));
@@ -42,7 +43,7 @@
int j;
-@@ -55,7 +77,7 @@
+@@ -69,7 +91,7 @@
@Override
public void a(boolean flag, IRecipe> irecipe, EntityPlayer entityplayer) {
@@ -51,7 +52,7 @@
}
@Override
-@@ -80,6 +102,7 @@
+@@ -94,6 +116,7 @@
@Override
public boolean canUse(EntityHuman entityhuman) {
@@ -59,7 +60,7 @@
return this.furnace.a(entityhuman);
}
-@@ -135,7 +158,7 @@
+@@ -149,7 +172,7 @@
}
protected boolean a(ItemStack itemstack) {
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerGrindstone.patch b/nms-patches/net/minecraft/world/inventory/ContainerGrindstone.patch
index 69f9a45a5..d0a8ff735 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerGrindstone.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerGrindstone.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/ContainerGrindstone.java
-+++ b/net/minecraft/server/ContainerGrindstone.java
-@@ -5,8 +5,30 @@
- import java.util.Map.Entry;
- import java.util.stream.Collectors;
+--- a/net/minecraft/world/inventory/ContainerGrindstone.java
++++ b/net/minecraft/world/inventory/ContainerGrindstone.java
+@@ -17,8 +17,30 @@
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.level.block.Blocks;
+// CraftBukkit start
+import org.bukkit.Location;
@@ -31,7 +31,7 @@
private final IInventory resultInventory;
private final IInventory craftInventory;
private final ContainerAccess containerAccess;
-@@ -24,6 +46,13 @@
+@@ -36,6 +58,13 @@
super.update();
ContainerGrindstone.this.a((IInventory) this);
}
@@ -45,7 +45,7 @@
};
this.containerAccess = containeraccess;
this.a(new Slot(this.craftInventory, 0, 49, 19) {
-@@ -108,6 +137,7 @@
+@@ -120,6 +149,7 @@
this.a(new Slot(playerinventory, j, 8 + j * 18, 142));
}
@@ -53,7 +53,7 @@
}
@Override
-@@ -235,6 +265,7 @@
+@@ -247,6 +277,7 @@
@Override
public boolean canUse(EntityHuman entityhuman) {
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerHopper.patch b/nms-patches/net/minecraft/world/inventory/ContainerHopper.patch
index f125e0ec5..614add7d6 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerHopper.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerHopper.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/ContainerHopper.java
-+++ b/net/minecraft/server/ContainerHopper.java
-@@ -1,9 +1,30 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/inventory/ContainerHopper.java
++++ b/net/minecraft/world/inventory/ContainerHopper.java
+@@ -6,10 +6,31 @@
+ import net.minecraft.world.entity.player.PlayerInventory;
+ import net.minecraft.world.item.ItemStack;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventory;
@@ -31,7 +32,7 @@
public ContainerHopper(int i, PlayerInventory playerinventory) {
this(i, playerinventory, new InventorySubcontainer(5));
}
-@@ -11,6 +32,7 @@
+@@ -17,6 +38,7 @@
public ContainerHopper(int i, PlayerInventory playerinventory, IInventory iinventory) {
super(Containers.HOPPER, i);
this.hopper = iinventory;
@@ -39,7 +40,7 @@
a(iinventory, 5);
iinventory.startOpen(playerinventory.player);
boolean flag = true;
-@@ -35,6 +57,7 @@
+@@ -41,6 +63,7 @@
@Override
public boolean canUse(EntityHuman entityhuman) {
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerHorse.patch b/nms-patches/net/minecraft/world/inventory/ContainerHorse.patch
index 9294487a2..5b8a1202a 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerHorse.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerHorse.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/ContainerHorse.java
-+++ b/net/minecraft/server/ContainerHorse.java
-@@ -1,12 +1,32 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/inventory/ContainerHorse.java
++++ b/net/minecraft/world/inventory/ContainerHorse.java
+@@ -9,13 +9,33 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.item.Items;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerLectern.patch b/nms-patches/net/minecraft/world/inventory/ContainerLectern.patch
index c0468cf79..40fbba3d6 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerLectern.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerLectern.patch
@@ -1,9 +1,11 @@
---- a/net/minecraft/server/ContainerLectern.java
-+++ b/net/minecraft/server/ContainerLectern.java
-@@ -1,15 +1,40 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/inventory/ContainerLectern.java
++++ b/net/minecraft/world/inventory/ContainerLectern.java
+@@ -5,16 +5,42 @@
+ import net.minecraft.world.entity.player.EntityHuman;
+ import net.minecraft.world.item.ItemStack;
+// CraftBukkit start
++import net.minecraft.world.entity.player.PlayerInventory;
+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.inventory.CraftInventoryLectern;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
@@ -44,7 +46,7 @@
super(Containers.LECTERN, i);
a(iinventory, 1);
a(icontainerproperties, 1);
-@@ -23,6 +48,7 @@
+@@ -28,6 +54,7 @@
}
});
this.a(icontainerproperties);
@@ -52,7 +54,7 @@
}
@Override
-@@ -48,6 +74,13 @@
+@@ -53,6 +80,13 @@
return false;
}
@@ -66,7 +68,7 @@
ItemStack itemstack = this.inventory.splitWithoutUpdate(0);
this.inventory.update();
-@@ -70,6 +103,7 @@
+@@ -75,6 +109,7 @@
@Override
public boolean canUse(EntityHuman entityhuman) {
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerLoom.patch b/nms-patches/net/minecraft/world/inventory/ContainerLoom.patch
index 0b0f1f1f2..1c6fb8761 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerLoom.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerLoom.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/ContainerLoom.java
-+++ b/net/minecraft/server/ContainerLoom.java
-@@ -1,7 +1,29 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/inventory/ContainerLoom.java
++++ b/net/minecraft/world/inventory/ContainerLoom.java
+@@ -16,8 +16,30 @@
+ import net.minecraft.world.level.block.Blocks;
+ import net.minecraft.world.level.block.entity.EnumBannerPatternType;
+// CraftBukkit start
+import org.bukkit.Location;
@@ -30,7 +31,7 @@
private final ContainerAccess containerAccess;
private final ContainerProperty d;
private Runnable e;
-@@ -29,6 +51,13 @@
+@@ -45,6 +67,13 @@
ContainerLoom.this.a((IInventory) this);
ContainerLoom.this.e.run();
}
@@ -44,7 +45,7 @@
};
this.resultInventory = new InventorySubcontainer(1) {
@Override
-@@ -36,6 +65,13 @@
+@@ -52,6 +81,13 @@
super.update();
ContainerLoom.this.e.run();
}
@@ -58,7 +59,7 @@
};
this.containerAccess = containeraccess;
this.f = this.a(new Slot(this.craftInventory, 0, 13, 26) {
-@@ -96,10 +132,12 @@
+@@ -112,10 +148,12 @@
}
this.a(this.d);
@@ -71,7 +72,7 @@
return a(this.containerAccess, entityhuman, Blocks.LOOM);
}
-@@ -218,6 +256,11 @@
+@@ -234,6 +272,11 @@
if (nbttagcompound.hasKeyOfType("Patterns", 9)) {
nbttaglist = nbttagcompound.getList("Patterns", 10);
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerMerchant.patch b/nms-patches/net/minecraft/world/inventory/ContainerMerchant.patch
index 1d4f7f529..7aacac9a8 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerMerchant.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerMerchant.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/ContainerMerchant.java
-+++ b/net/minecraft/server/ContainerMerchant.java
-@@ -1,10 +1,25 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/inventory/ContainerMerchant.java
++++ b/net/minecraft/world/inventory/ContainerMerchant.java
+@@ -12,11 +12,26 @@
+ import net.minecraft.world.item.trading.MerchantRecipe;
+ import net.minecraft.world.item.trading.MerchantRecipeList;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit
+
@@ -26,7 +27,7 @@
public ContainerMerchant(int i, PlayerInventory playerinventory) {
this(i, playerinventory, new MerchantWrapper(playerinventory.player));
}
-@@ -16,6 +31,7 @@
+@@ -28,6 +43,7 @@
this.a(new Slot(this.inventoryMerchant, 0, 136, 37));
this.a(new Slot(this.inventoryMerchant, 1, 162, 37));
this.a((Slot) (new SlotMerchantResult(playerinventory.player, imerchant, this.inventoryMerchant, 2, 220, 37)));
@@ -34,7 +35,7 @@
int j;
-@@ -96,7 +112,7 @@
+@@ -108,7 +124,7 @@
}
private void k() {
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerPlayer.patch b/nms-patches/net/minecraft/world/inventory/ContainerPlayer.patch
index e24a97afc..5b38fc924 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerPlayer.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerPlayer.patch
@@ -1,9 +1,11 @@
---- a/net/minecraft/server/ContainerPlayer.java
-+++ b/net/minecraft/server/ContainerPlayer.java
-@@ -1,5 +1,10 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/inventory/ContainerPlayer.java
++++ b/net/minecraft/world/inventory/ContainerPlayer.java
+@@ -11,6 +11,12 @@
+ import net.minecraft.world.item.crafting.IRecipe;
+ import net.minecraft.world.item.enchantment.EnchantmentManager;
+// CraftBukkit start
++import net.minecraft.network.chat.ChatMessage;
+import org.bukkit.craftbukkit.inventory.CraftInventoryCrafting;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView;
+// CraftBukkit end
@@ -11,7 +13,7 @@
public class ContainerPlayer extends ContainerRecipeBook {
public static final MinecraftKey c = new MinecraftKey("textures/atlas/blocks.png");
-@@ -10,15 +15,28 @@
+@@ -21,15 +27,28 @@
public static final MinecraftKey h = new MinecraftKey("item/empty_armor_slot_shield");
private static final MinecraftKey[] j = new MinecraftKey[]{ContainerPlayer.g, ContainerPlayer.f, ContainerPlayer.e, ContainerPlayer.d};
private static final EnumItemSlot[] k = new EnumItemSlot[]{EnumItemSlot.HEAD, EnumItemSlot.CHEST, EnumItemSlot.LEGS, EnumItemSlot.FEET};
@@ -42,7 +44,7 @@
this.a((Slot) (new SlotResult(playerinventory.player, this.craftInventory, this.resultInventory, 0, 154, 28)));
int i;
-@@ -85,7 +103,7 @@
+@@ -96,7 +115,7 @@
@Override
public void a(IInventory iinventory) {
@@ -51,7 +53,7 @@
}
@Override
-@@ -192,4 +210,17 @@
+@@ -203,4 +222,17 @@
public InventoryCrafting j() {
return this.craftInventory;
}
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerShulkerBox.patch b/nms-patches/net/minecraft/world/inventory/ContainerShulkerBox.patch
index 1c59f08b2..da36899a1 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerShulkerBox.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerShulkerBox.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/ContainerShulkerBox.java
-+++ b/net/minecraft/server/ContainerShulkerBox.java
-@@ -1,8 +1,27 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/inventory/ContainerShulkerBox.java
++++ b/net/minecraft/world/inventory/ContainerShulkerBox.java
+@@ -6,9 +6,28 @@
+ import net.minecraft.world.entity.player.PlayerInventory;
+ import net.minecraft.world.item.ItemStack;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventory;
@@ -28,7 +29,7 @@
public ContainerShulkerBox(int i, PlayerInventory playerinventory) {
this(i, playerinventory, new InventorySubcontainer(27));
-@@ -12,6 +31,7 @@
+@@ -18,6 +37,7 @@
super(Containers.SHULKER_BOX, i);
a(iinventory, 27);
this.c = iinventory;
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerSmithing.patch b/nms-patches/net/minecraft/world/inventory/ContainerSmithing.patch
index d9dd6db03..92550150f 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerSmithing.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerSmithing.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/ContainerSmithing.java
-+++ b/net/minecraft/server/ContainerSmithing.java
-@@ -3,12 +3,17 @@
- import java.util.List;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/inventory/ContainerSmithing.java
++++ b/net/minecraft/world/inventory/ContainerSmithing.java
+@@ -12,12 +12,17 @@
+ import net.minecraft.world.level.block.Blocks;
+ import net.minecraft.world.level.block.state.IBlockData;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit
+
@@ -18,7 +18,7 @@
public ContainerSmithing(int i, PlayerInventory playerinventory) {
this(i, playerinventory, ContainerAccess.a);
-@@ -54,13 +59,13 @@
+@@ -63,13 +68,13 @@
List list = this.g.getCraftingManager().b(Recipes.SMITHING, this.repairInventory, this.g);
if (list.isEmpty()) {
@@ -34,7 +34,7 @@
}
}
-@@ -76,4 +81,18 @@
+@@ -85,4 +90,18 @@
public boolean a(ItemStack itemstack, Slot slot) {
return slot.inventory != this.resultInventory && super.a(itemstack, slot);
}
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerStonecutter.patch b/nms-patches/net/minecraft/world/inventory/ContainerStonecutter.patch
index 8897fd625..1a577f672 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerStonecutter.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerStonecutter.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/ContainerStonecutter.java
-+++ b/net/minecraft/server/ContainerStonecutter.java
-@@ -3,6 +3,13 @@
- import com.google.common.collect.Lists;
- import java.util.List;
+--- a/net/minecraft/world/inventory/ContainerStonecutter.java
++++ b/net/minecraft/world/inventory/ContainerStonecutter.java
+@@ -16,6 +16,13 @@
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.level.block.Blocks;
+// CraftBukkit start
+import org.bukkit.Location;
@@ -14,7 +14,7 @@
public class ContainerStonecutter extends Container {
private final ContainerAccess containerAccess;
-@@ -16,6 +23,21 @@
+@@ -29,6 +36,21 @@
private Runnable l;
public final IInventory inventory;
private final InventoryCraftResult resultInventory;
@@ -36,7 +36,7 @@
public ContainerStonecutter(int i, PlayerInventory playerinventory) {
this(i, playerinventory, ContainerAccess.a);
-@@ -35,6 +57,13 @@
+@@ -48,6 +70,13 @@
ContainerStonecutter.this.a((IInventory) this);
ContainerStonecutter.this.l.run();
}
@@ -50,7 +50,7 @@
};
this.resultInventory = new InventoryCraftResult();
this.containerAccess = containeraccess;
-@@ -82,10 +111,12 @@
+@@ -95,10 +124,12 @@
}
this.a(this.containerProperty);
diff --git a/nms-patches/net/minecraft/world/inventory/ContainerWorkbench.patch b/nms-patches/net/minecraft/world/inventory/ContainerWorkbench.patch
index a338ab568..655755765 100644
--- a/nms-patches/net/minecraft/world/inventory/ContainerWorkbench.patch
+++ b/nms-patches/net/minecraft/world/inventory/ContainerWorkbench.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/ContainerWorkbench.java
-+++ b/net/minecraft/server/ContainerWorkbench.java
-@@ -2,12 +2,21 @@
-
- import java.util.Optional;
+--- a/net/minecraft/world/inventory/ContainerWorkbench.java
++++ b/net/minecraft/world/inventory/ContainerWorkbench.java
+@@ -14,12 +14,21 @@
+ import net.minecraft.world.level.World;
+ import net.minecraft.world.level.block.Blocks;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftInventoryCrafting;
@@ -22,7 +22,7 @@
public ContainerWorkbench(int i, PlayerInventory playerinventory) {
this(i, playerinventory, ContainerAccess.a);
-@@ -15,8 +24,12 @@
+@@ -27,8 +36,12 @@
public ContainerWorkbench(int i, PlayerInventory playerinventory, ContainerAccess containeraccess) {
super(Containers.CRAFTING, i);
@@ -36,7 +36,7 @@
this.containerAccess = containeraccess;
this.f = playerinventory.player;
this.a((Slot) (new SlotResult(playerinventory.player, this.craftInventory, this.resultInventory, 0, 124, 35)));
-@@ -42,7 +55,7 @@
+@@ -54,7 +67,7 @@
}
@@ -45,7 +45,7 @@
if (!world.isClientSide) {
EntityPlayer entityplayer = (EntityPlayer) entityhuman;
ItemStack itemstack = ItemStack.b;
-@@ -55,6 +68,7 @@
+@@ -67,6 +80,7 @@
itemstack = recipecrafting.a(inventorycrafting);
}
}
@@ -53,7 +53,7 @@
inventorycraftresult.setItem(0, itemstack);
entityplayer.playerConnection.sendPacket(new PacketPlayOutSetSlot(i, 0, itemstack));
-@@ -64,7 +78,7 @@
+@@ -76,7 +90,7 @@
@Override
public void a(IInventory iinventory) {
this.containerAccess.a((world, blockposition) -> {
@@ -62,7 +62,7 @@
});
}
-@@ -94,6 +108,7 @@
+@@ -106,6 +120,7 @@
@Override
public boolean canUse(EntityHuman entityhuman) {
@@ -70,7 +70,7 @@
return a(this.containerAccess, entityhuman, Blocks.CRAFTING_TABLE);
}
-@@ -168,4 +183,17 @@
+@@ -180,4 +195,17 @@
public int h() {
return this.craftInventory.f();
}
diff --git a/nms-patches/net/minecraft/world/inventory/Containers.patch b/nms-patches/net/minecraft/world/inventory/Containers.patch
index 60a5b5b4b..2e6d88167 100644
--- a/nms-patches/net/minecraft/world/inventory/Containers.patch
+++ b/nms-patches/net/minecraft/world/inventory/Containers.patch
@@ -1,6 +1,17 @@
---- a/net/minecraft/server/Containers.java
-+++ b/net/minecraft/server/Containers.java
-@@ -19,7 +19,7 @@
+--- a/net/minecraft/world/inventory/Containers.java
++++ b/net/minecraft/world/inventory/Containers.java
+@@ -2,6 +2,10 @@
+
+ import net.minecraft.core.IRegistry;
+
++// CraftBukkit start
++import net.minecraft.world.entity.player.PlayerInventory;
++// CraftBukkit end
++
+ public class Containers {
+
+ public static final Containers GENERIC_9X1 = a("generic_9x1", ContainerChest::a);
+@@ -21,7 +25,7 @@
public static final Containers GRINDSTONE = a("grindstone", ContainerGrindstone::new);
public static final Containers HOPPER = a("hopper", ContainerHopper::new);
public static final Containers LECTERN = a("lectern", (i, playerinventory) -> {
@@ -9,7 +20,7 @@
});
public static final Containers LOOM = a("loom", ContainerLoom::new);
public static final Containers MERCHANT = a("merchant", ContainerMerchant::new);
-@@ -31,12 +31,17 @@
+@@ -33,12 +37,17 @@
private final Containers.Supplier y;
private static Containers a(String s, Containers.Supplier containers_supplier) {
diff --git a/nms-patches/net/minecraft/world/inventory/InventoryCraftResult.patch b/nms-patches/net/minecraft/world/inventory/InventoryCraftResult.patch
index b2a2198b9..5deafc65f 100644
--- a/nms-patches/net/minecraft/world/inventory/InventoryCraftResult.patch
+++ b/nms-patches/net/minecraft/world/inventory/InventoryCraftResult.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/InventoryCraftResult.java
-+++ b/net/minecraft/server/InventoryCraftResult.java
-@@ -3,12 +3,51 @@
- import java.util.Iterator;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/inventory/InventoryCraftResult.java
++++ b/net/minecraft/world/inventory/InventoryCraftResult.java
+@@ -9,12 +9,51 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.item.crafting.IRecipe;
+// CraftBukkit start
+import org.bukkit.Location;
diff --git a/nms-patches/net/minecraft/world/inventory/InventoryCrafting.patch b/nms-patches/net/minecraft/world/inventory/InventoryCrafting.patch
index 3d8ece0c4..a772db826 100644
--- a/nms-patches/net/minecraft/world/inventory/InventoryCrafting.patch
+++ b/nms-patches/net/minecraft/world/inventory/InventoryCrafting.patch
@@ -1,13 +1,13 @@
---- a/net/minecraft/server/InventoryCrafting.java
-+++ b/net/minecraft/server/InventoryCrafting.java
-@@ -2,6 +2,15 @@
-
- import java.util.Iterator;
+--- a/net/minecraft/world/inventory/InventoryCrafting.java
++++ b/net/minecraft/world/inventory/InventoryCrafting.java
+@@ -8,6 +8,15 @@
+ import net.minecraft.world.entity.player.EntityHuman;
+ import net.minecraft.world.item.ItemStack;
+// CraftBukkit start
+import java.util.List;
++import net.minecraft.world.item.crafting.IRecipe;
+import org.bukkit.Location;
-+
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.entity.HumanEntity;
+import org.bukkit.event.inventory.InventoryType;
@@ -16,7 +16,7 @@
public class InventoryCrafting implements IInventory, AutoRecipeOutput {
private final NonNullList items;
-@@ -9,6 +18,68 @@
+@@ -15,6 +24,68 @@
private final int c;
public final Container container;
diff --git a/nms-patches/net/minecraft/world/inventory/InventoryEnderChest.patch b/nms-patches/net/minecraft/world/inventory/InventoryEnderChest.patch
index 753c934b5..3ff6e1883 100644
--- a/nms-patches/net/minecraft/world/inventory/InventoryEnderChest.patch
+++ b/nms-patches/net/minecraft/world/inventory/InventoryEnderChest.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/InventoryEnderChest.java
-+++ b/net/minecraft/server/InventoryEnderChest.java
-@@ -1,11 +1,29 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/inventory/InventoryEnderChest.java
++++ b/net/minecraft/world/inventory/InventoryEnderChest.java
+@@ -7,12 +7,30 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.level.block.entity.TileEntityEnderChest;
+// CraftBukkit start
+import org.bukkit.Location;
diff --git a/nms-patches/net/minecraft/world/inventory/InventoryMerchant.patch b/nms-patches/net/minecraft/world/inventory/InventoryMerchant.patch
index 0319be933..d362b99ce 100644
--- a/nms-patches/net/minecraft/world/inventory/InventoryMerchant.patch
+++ b/nms-patches/net/minecraft/world/inventory/InventoryMerchant.patch
@@ -1,11 +1,13 @@
---- a/net/minecraft/server/InventoryMerchant.java
-+++ b/net/minecraft/server/InventoryMerchant.java
-@@ -3,6 +3,14 @@
- import java.util.Iterator;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/inventory/InventoryMerchant.java
++++ b/net/minecraft/world/inventory/InventoryMerchant.java
+@@ -11,6 +11,16 @@
+ import net.minecraft.world.item.trading.MerchantRecipe;
+ import net.minecraft.world.item.trading.MerchantRecipeList;
+// CraftBukkit start
+import java.util.List;
++import net.minecraft.world.entity.npc.EntityVillager;
++import net.minecraft.world.entity.npc.EntityVillagerAbstract;
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.craftbukkit.entity.CraftAbstractVillager;
@@ -15,7 +17,7 @@
public class InventoryMerchant implements IInventory {
private final IMerchant merchant;
-@@ -12,6 +20,46 @@
+@@ -20,6 +30,46 @@
public int selectedIndex;
private int e;
diff --git a/nms-patches/net/minecraft/world/inventory/SlotFurnaceResult.patch b/nms-patches/net/minecraft/world/inventory/SlotFurnaceResult.patch
index 59777958c..08d3badc3 100644
--- a/nms-patches/net/minecraft/world/inventory/SlotFurnaceResult.patch
+++ b/nms-patches/net/minecraft/world/inventory/SlotFurnaceResult.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/SlotFurnaceResult.java
-+++ b/net/minecraft/server/SlotFurnaceResult.java
-@@ -41,7 +41,7 @@
+--- a/net/minecraft/world/inventory/SlotFurnaceResult.java
++++ b/net/minecraft/world/inventory/SlotFurnaceResult.java
+@@ -46,7 +46,7 @@
protected void c(ItemStack itemstack) {
itemstack.a(this.a.world, this.a, this.b);
if (!this.a.world.isClientSide && this.inventory instanceof TileEntityFurnace) {
diff --git a/nms-patches/net/minecraft/world/item/ItemArmor.patch b/nms-patches/net/minecraft/world/item/ItemArmor.patch
index ea82db9e7..cc0ce2b7d 100644
--- a/nms-patches/net/minecraft/world/item/ItemArmor.patch
+++ b/nms-patches/net/minecraft/world/item/ItemArmor.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/ItemArmor.java
-+++ b/net/minecraft/server/ItemArmor.java
-@@ -6,6 +6,11 @@
- import java.util.List;
- import java.util.UUID;
+--- a/net/minecraft/world/item/ItemArmor.java
++++ b/net/minecraft/world/item/ItemArmor.java
+@@ -25,6 +25,11 @@
+ import net.minecraft.world.level.block.BlockDispenser;
+ import net.minecraft.world.phys.AxisAlignedBB;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
@@ -12,7 +12,7 @@
public class ItemArmor extends Item implements ItemWearable {
private static final UUID[] j = new UUID[]{UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"), UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"), UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"), UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150")};
-@@ -32,6 +37,32 @@
+@@ -51,6 +56,32 @@
EntityLiving entityliving = (EntityLiving) list.get(0);
EnumItemSlot enumitemslot = EntityInsentient.j(itemstack);
ItemStack itemstack1 = itemstack.cloneAndSubtract(1);
diff --git a/nms-patches/net/minecraft/world/item/ItemArmorStand.patch b/nms-patches/net/minecraft/world/item/ItemArmorStand.patch
index 08a1a16f6..8dd2db508 100644
--- a/nms-patches/net/minecraft/world/item/ItemArmorStand.patch
+++ b/nms-patches/net/minecraft/world/item/ItemArmorStand.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemArmorStand.java
-+++ b/net/minecraft/server/ItemArmorStand.java
-@@ -38,6 +38,11 @@
+--- a/net/minecraft/world/item/ItemArmorStand.java
++++ b/net/minecraft/world/item/ItemArmorStand.java
+@@ -58,6 +58,11 @@
entityarmorstand.setPositionRotation(entityarmorstand.locX(), entityarmorstand.locY(), entityarmorstand.locZ(), f, 0.0F);
this.a(entityarmorstand, world.random);
diff --git a/nms-patches/net/minecraft/world/item/ItemBlock.patch b/nms-patches/net/minecraft/world/item/ItemBlock.patch
index 5cd83d6f7..9dca71cec 100644
--- a/nms-patches/net/minecraft/world/item/ItemBlock.patch
+++ b/nms-patches/net/minecraft/world/item/ItemBlock.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/ItemBlock.java
-+++ b/net/minecraft/server/ItemBlock.java
-@@ -4,6 +4,12 @@
- import java.util.Map;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/item/ItemBlock.java
++++ b/net/minecraft/world/item/ItemBlock.java
+@@ -25,6 +25,13 @@
+ import net.minecraft.world.level.block.state.properties.IBlockState;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
++import net.minecraft.server.level.WorldServer;
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.craftbukkit.block.data.CraftBlockData;
+import org.bukkit.event.block.BlockCanBuildEvent;
@@ -13,7 +14,7 @@
public class ItemBlock extends Item {
@Deprecated
-@@ -31,6 +37,12 @@
+@@ -52,6 +59,12 @@
return EnumInteractionResult.FAIL;
} else {
IBlockData iblockdata = this.c(blockactioncontext1);
@@ -26,7 +27,7 @@
if (iblockdata == null) {
return EnumInteractionResult.FAIL;
-@@ -48,6 +60,15 @@
+@@ -69,6 +82,15 @@
iblockdata1 = this.a(blockposition, world, itemstack, iblockdata1);
this.a(blockposition, world, entityhuman, itemstack, iblockdata1);
block.postPlace(world, blockposition, iblockdata1, entityhuman, itemstack);
@@ -42,7 +43,7 @@
if (entityhuman instanceof EntityPlayer) {
CriterionTriggers.y.a((EntityPlayer) entityhuman, blockposition, itemstack);
}
-@@ -55,8 +76,8 @@
+@@ -76,8 +98,8 @@
SoundEffectType soundeffecttype = iblockdata1.getStepSound();
@@ -53,7 +54,7 @@
itemstack.subtract(1);
}
-@@ -92,6 +113,21 @@
+@@ -113,6 +135,21 @@
if (nbttagcompound != null) {
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("BlockStateTag");
@@ -75,7 +76,7 @@
BlockStateList blockstatelist = iblockdata.getBlock().getStates();
Iterator iterator = nbttagcompound1.getKeys().iterator();
-@@ -106,11 +142,6 @@
+@@ -127,11 +164,6 @@
}
}
}
@@ -87,7 +88,7 @@
return iblockdata1;
}
-@@ -123,8 +154,15 @@
+@@ -144,8 +176,15 @@
protected boolean b(BlockActionContext blockactioncontext, IBlockData iblockdata) {
EntityHuman entityhuman = blockactioncontext.getEntity();
VoxelShapeCollision voxelshapecollision = entityhuman == null ? VoxelShapeCollision.a() : VoxelShapeCollision.a((Entity) entityhuman);
diff --git a/nms-patches/net/minecraft/world/item/ItemBoat.patch b/nms-patches/net/minecraft/world/item/ItemBoat.patch
index c8556d1bf..374169f7b 100644
--- a/nms-patches/net/minecraft/world/item/ItemBoat.patch
+++ b/nms-patches/net/minecraft/world/item/ItemBoat.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemBoat.java
-+++ b/net/minecraft/server/ItemBoat.java
-@@ -41,6 +41,13 @@
+--- a/net/minecraft/world/item/ItemBoat.java
++++ b/net/minecraft/world/item/ItemBoat.java
+@@ -54,6 +54,13 @@
}
if (movingobjectpositionblock.getType() == MovingObjectPosition.EnumMovingObjectType.BLOCK) {
@@ -8,13 +8,13 @@
+ org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityhuman, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, movingobjectpositionblock.getBlockPosition(), movingobjectpositionblock.getDirection(), itemstack, enumhand);
+
+ if (event.isCancelled()) {
-+ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
++ return InteractionResultWrapper.pass(itemstack);
+ }
+ // CraftBukkit end
EntityBoat entityboat = new EntityBoat(world, movingobjectpositionblock.getPos().x, movingobjectpositionblock.getPos().y, movingobjectpositionblock.getPos().z);
entityboat.setType(this.b);
-@@ -49,7 +56,15 @@
+@@ -62,7 +69,15 @@
return InteractionResultWrapper.fail(itemstack);
} else {
if (!world.isClientSide) {
@@ -25,7 +25,7 @@
+ }
+
+ if (!world.addEntity(entityboat)) {
-+ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
++ return InteractionResultWrapper.pass(itemstack);
+ }
+ // CraftBukkit end
if (!entityhuman.abilities.canInstantlyBuild) {
diff --git a/nms-patches/net/minecraft/world/item/ItemBoneMeal.patch b/nms-patches/net/minecraft/world/item/ItemBoneMeal.patch
index cae44479a..c53009f8f 100644
--- a/nms-patches/net/minecraft/world/item/ItemBoneMeal.patch
+++ b/nms-patches/net/minecraft/world/item/ItemBoneMeal.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemBoneMeal.java
-+++ b/net/minecraft/server/ItemBoneMeal.java
-@@ -12,6 +12,12 @@
+--- a/net/minecraft/world/item/ItemBoneMeal.java
++++ b/net/minecraft/world/item/ItemBoneMeal.java
+@@ -28,6 +28,12 @@
@Override
public EnumInteractionResult a(ItemActionContext itemactioncontext) {
diff --git a/nms-patches/net/minecraft/world/item/ItemBow.patch b/nms-patches/net/minecraft/world/item/ItemBow.patch
index 4589cf710..74780fa95 100644
--- a/nms-patches/net/minecraft/world/item/ItemBow.patch
+++ b/nms-patches/net/minecraft/world/item/ItemBow.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemBow.java
-+++ b/net/minecraft/server/ItemBow.java
-@@ -50,6 +50,14 @@
+--- a/net/minecraft/world/item/ItemBow.java
++++ b/net/minecraft/world/item/ItemBow.java
+@@ -61,6 +61,14 @@
if (EnchantmentManager.getEnchantmentLevel(Enchantments.ARROW_FIRE, itemstack) > 0) {
entityarrow.setOnFire(100);
}
@@ -15,7 +15,7 @@
itemstack.damage(1, entityhuman, (entityhuman1) -> {
entityhuman1.broadcastItemBreak(entityhuman.getRaisedHand());
-@@ -58,7 +66,16 @@
+@@ -69,7 +77,16 @@
entityarrow.fromPlayer = EntityArrow.PickupStatus.CREATIVE_ONLY;
}
@@ -23,8 +23,8 @@
+ // CraftBukkit start
+ if (event.getProjectile() == entityarrow.getBukkitEntity()) {
+ if (!world.addEntity(entityarrow)) {
-+ if (entityhuman instanceof EntityPlayer) {
-+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
++ if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
++ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
+ }
+ return;
+ }
diff --git a/nms-patches/net/minecraft/world/item/ItemBucket.patch b/nms-patches/net/minecraft/world/item/ItemBucket.patch
index 9a4a1a9fb..48ddfaeb4 100644
--- a/nms-patches/net/minecraft/world/item/ItemBucket.patch
+++ b/nms-patches/net/minecraft/world/item/ItemBucket.patch
@@ -1,10 +1,12 @@
---- a/net/minecraft/server/ItemBucket.java
-+++ b/net/minecraft/server/ItemBucket.java
-@@ -2,6 +2,14 @@
-
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/item/ItemBucket.java
++++ b/net/minecraft/world/item/ItemBucket.java
+@@ -29,6 +29,16 @@
+ import net.minecraft.world.phys.MovingObjectPosition;
+ import net.minecraft.world.phys.MovingObjectPositionBlock;
+// CraftBukkit start
++import net.minecraft.network.protocol.game.PacketPlayOutBlockChange;
++import net.minecraft.server.level.WorldServer;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.craftbukkit.util.DummyGeneratorAccess;
@@ -15,7 +17,7 @@
public class ItemBucket extends Item {
public final FluidType fluidType;
-@@ -32,12 +40,22 @@
+@@ -59,12 +69,22 @@
if (this.fluidType == FluidTypes.EMPTY) {
iblockdata = world.getType(blockposition);
if (iblockdata.getBlock() instanceof IFluidSource) {
@@ -26,7 +28,7 @@
+ if (event.isCancelled()) {
+ ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition)); // SPIGOT-5163 (see PlayerInteractManager)
+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541
-+ return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack);
++ return InteractionResultWrapper.fail(itemstack);
+ }
+ // CraftBukkit end
FluidType fluidtype = ((IFluidSource) iblockdata.getBlock()).removeFluid(world, blockposition, iblockdata);
@@ -39,7 +41,7 @@
if (!world.isClientSide) {
CriterionTriggers.j.a((EntityPlayer) entityhuman, new ItemStack(fluidtype.a()));
-@@ -52,7 +70,7 @@
+@@ -79,7 +99,7 @@
iblockdata = world.getType(blockposition);
BlockPosition blockposition2 = iblockdata.getBlock() instanceof IFluidContainer && this.fluidType == FluidTypes.WATER ? blockposition : blockposition1;
@@ -48,7 +50,7 @@
this.a(world, itemstack, blockposition2);
if (entityhuman instanceof EntityPlayer) {
CriterionTriggers.y.a((EntityPlayer) entityhuman, blockposition2, itemstack);
-@@ -77,6 +95,11 @@
+@@ -104,6 +124,11 @@
public void a(World world, ItemStack itemstack, BlockPosition blockposition) {}
public boolean a(@Nullable EntityHuman entityhuman, World world, BlockPosition blockposition, @Nullable MovingObjectPositionBlock movingobjectpositionblock) {
@@ -60,7 +62,7 @@
if (!(this.fluidType instanceof FluidTypeFlowing)) {
return false;
} else {
-@@ -86,8 +109,18 @@
+@@ -113,8 +138,18 @@
boolean flag = iblockdata.a(this.fluidType);
boolean flag1 = iblockdata.isAir() || flag || block instanceof IFluidContainer && ((IFluidContainer) block).canPlace(world, blockposition, iblockdata, this.fluidType);
diff --git a/nms-patches/net/minecraft/world/item/ItemChorusFruit.patch b/nms-patches/net/minecraft/world/item/ItemChorusFruit.patch
index 5991670c6..1a296a4db 100644
--- a/nms-patches/net/minecraft/world/item/ItemChorusFruit.patch
+++ b/nms-patches/net/minecraft/world/item/ItemChorusFruit.patch
@@ -1,9 +1,11 @@
---- a/net/minecraft/server/ItemChorusFruit.java
-+++ b/net/minecraft/server/ItemChorusFruit.java
-@@ -1,5 +1,11 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/item/ItemChorusFruit.java
++++ b/net/minecraft/world/item/ItemChorusFruit.java
+@@ -9,6 +9,13 @@
+ import net.minecraft.world.entity.player.EntityHuman;
+ import net.minecraft.world.level.World;
+// CraftBukkit start
++import net.minecraft.server.level.EntityPlayer;
+import org.bukkit.Location;
+import org.bukkit.entity.Player;
+import org.bukkit.event.player.PlayerTeleportEvent;
@@ -12,7 +14,7 @@
public class ItemChorusFruit extends Item {
public ItemChorusFruit(Item.Info item_info) {
-@@ -20,6 +26,20 @@
+@@ -29,6 +36,20 @@
double d4 = MathHelper.a(entityliving.locY() + (double) (entityliving.getRandom().nextInt(16) - 8), 0.0D, (double) (world.getHeight() - 1));
double d5 = entityliving.locZ() + (entityliving.getRandom().nextDouble() - 0.5D) * 16.0D;
diff --git a/nms-patches/net/minecraft/world/item/ItemCrossbow.patch b/nms-patches/net/minecraft/world/item/ItemCrossbow.patch
index a5e932b4e..09dc5d865 100644
--- a/nms-patches/net/minecraft/world/item/ItemCrossbow.patch
+++ b/nms-patches/net/minecraft/world/item/ItemCrossbow.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemCrossbow.java
-+++ b/net/minecraft/server/ItemCrossbow.java
-@@ -74,6 +74,10 @@
+--- a/net/minecraft/world/item/ItemCrossbow.java
++++ b/net/minecraft/world/item/ItemCrossbow.java
+@@ -97,6 +97,10 @@
if (itemstack1.isEmpty() && flag) {
itemstack1 = new ItemStack(Items.ARROW);
itemstack2 = itemstack1.cloneItemStack();
@@ -11,7 +11,7 @@
}
if (!a(entityliving, itemstack, itemstack1, k > 0, flag)) {
-@@ -198,11 +202,27 @@
+@@ -221,11 +225,27 @@
vector3fa.a(quaternion);
((IProjectile) object).shoot((double) vector3fa.a(), (double) vector3fa.b(), (double) vector3fa.c(), f1, f2);
}
diff --git a/nms-patches/net/minecraft/world/item/ItemDye.patch b/nms-patches/net/minecraft/world/item/ItemDye.patch
index cf5da62a5..dea43b22f 100644
--- a/nms-patches/net/minecraft/world/item/ItemDye.patch
+++ b/nms-patches/net/minecraft/world/item/ItemDye.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/ItemDye.java
-+++ b/net/minecraft/server/ItemDye.java
-@@ -3,6 +3,8 @@
- import com.google.common.collect.Maps;
- import java.util.Map;
+--- a/net/minecraft/world/item/ItemDye.java
++++ b/net/minecraft/world/item/ItemDye.java
+@@ -8,6 +8,8 @@
+ import net.minecraft.world.entity.animal.EntitySheep;
+ import net.minecraft.world.entity.player.EntityHuman;
+import org.bukkit.event.entity.SheepDyeWoolEvent; // CraftBukkit
+
public class ItemDye extends Item {
private static final Map a = Maps.newEnumMap(EnumColor.class);
-@@ -21,7 +23,17 @@
+@@ -26,7 +28,17 @@
if (entitysheep.isAlive() && !entitysheep.isSheared() && entitysheep.getColor() != this.b) {
if (!entityhuman.world.isClientSide) {
diff --git a/nms-patches/net/minecraft/world/item/ItemEgg.patch b/nms-patches/net/minecraft/world/item/ItemEgg.patch
index f72b75a5e..722779baa 100644
--- a/nms-patches/net/minecraft/world/item/ItemEgg.patch
+++ b/nms-patches/net/minecraft/world/item/ItemEgg.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemEgg.java
-+++ b/net/minecraft/server/ItemEgg.java
-@@ -10,14 +10,22 @@
+--- a/net/minecraft/world/item/ItemEgg.java
++++ b/net/minecraft/world/item/ItemEgg.java
+@@ -19,14 +19,22 @@
public InteractionResultWrapper a(World world, EntityHuman entityhuman, EnumHand enumhand) {
ItemStack itemstack = entityhuman.b(enumhand);
@@ -14,8 +14,8 @@
- world.addEntity(entityegg);
+ // CraftBukkit start
+ if (!world.addEntity(entityegg)) {
-+ if (entityhuman instanceof EntityPlayer) {
-+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
++ if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
++ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
+ }
+ return InteractionResultWrapper.fail(itemstack);
+ }
diff --git a/nms-patches/net/minecraft/world/item/ItemEndCrystal.patch b/nms-patches/net/minecraft/world/item/ItemEndCrystal.patch
index 7007204f4..d2ebf7402 100644
--- a/nms-patches/net/minecraft/world/item/ItemEndCrystal.patch
+++ b/nms-patches/net/minecraft/world/item/ItemEndCrystal.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemEndCrystal.java
-+++ b/net/minecraft/server/ItemEndCrystal.java
-@@ -34,6 +34,11 @@
+--- a/net/minecraft/world/item/ItemEndCrystal.java
++++ b/net/minecraft/world/item/ItemEndCrystal.java
+@@ -45,6 +45,11 @@
EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(world, d0 + 0.5D, d1, d2 + 0.5D);
entityendercrystal.setShowingBottom(false);
diff --git a/nms-patches/net/minecraft/world/item/ItemEnderEye.patch b/nms-patches/net/minecraft/world/item/ItemEnderEye.patch
index 70a234cc1..cbe435bc1 100644
--- a/nms-patches/net/minecraft/world/item/ItemEnderEye.patch
+++ b/nms-patches/net/minecraft/world/item/ItemEnderEye.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemEnderEye.java
-+++ b/net/minecraft/server/ItemEnderEye.java
-@@ -61,7 +61,11 @@
+--- a/net/minecraft/world/item/ItemEnderEye.java
++++ b/net/minecraft/world/item/ItemEnderEye.java
+@@ -85,7 +85,11 @@
entityendersignal.setItem(itemstack);
entityendersignal.a(blockposition);
diff --git a/nms-patches/net/minecraft/world/item/ItemEnderPearl.patch b/nms-patches/net/minecraft/world/item/ItemEnderPearl.patch
index 7bac2c2e3..63c7e2387 100644
--- a/nms-patches/net/minecraft/world/item/ItemEnderPearl.patch
+++ b/nms-patches/net/minecraft/world/item/ItemEnderPearl.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemEnderPearl.java
-+++ b/net/minecraft/server/ItemEnderPearl.java
-@@ -10,16 +10,24 @@
+--- a/net/minecraft/world/item/ItemEnderPearl.java
++++ b/net/minecraft/world/item/ItemEnderPearl.java
+@@ -19,16 +19,24 @@
public InteractionResultWrapper a(World world, EntityHuman entityhuman, EnumHand enumhand) {
ItemStack itemstack = entityhuman.b(enumhand);
@@ -14,10 +14,10 @@
entityenderpearl.a(entityhuman, entityhuman.pitch, entityhuman.yaw, 0.0F, 1.5F, 1.0F);
- world.addEntity(entityenderpearl);
+ if (!world.addEntity(entityenderpearl)) {
-+ if (entityhuman instanceof EntityPlayer) {
-+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
++ if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
++ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
+ }
-+ return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack);
++ return InteractionResultWrapper.fail(itemstack);
+ }
}
diff --git a/nms-patches/net/minecraft/world/item/ItemFireball.patch b/nms-patches/net/minecraft/world/item/ItemFireball.patch
index c25dce95d..b4a3e5083 100644
--- a/nms-patches/net/minecraft/world/item/ItemFireball.patch
+++ b/nms-patches/net/minecraft/world/item/ItemFireball.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemFireball.java
-+++ b/net/minecraft/server/ItemFireball.java
-@@ -14,12 +14,28 @@
+--- a/net/minecraft/world/item/ItemFireball.java
++++ b/net/minecraft/world/item/ItemFireball.java
+@@ -26,12 +26,28 @@
boolean flag = false;
if (BlockCampfire.h(iblockdata)) {
diff --git a/nms-patches/net/minecraft/world/item/ItemFishingRod.patch b/nms-patches/net/minecraft/world/item/ItemFishingRod.patch
index 99bf8f9f2..e2e63aa8d 100644
--- a/nms-patches/net/minecraft/world/item/ItemFishingRod.patch
+++ b/nms-patches/net/minecraft/world/item/ItemFishingRod.patch
@@ -1,14 +1,15 @@
---- a/net/minecraft/server/ItemFishingRod.java
-+++ b/net/minecraft/server/ItemFishingRod.java
-@@ -1,5 +1,7 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/item/ItemFishingRod.java
++++ b/net/minecraft/world/item/ItemFishingRod.java
+@@ -10,6 +10,8 @@
+ import net.minecraft.world.item.enchantment.EnchantmentManager;
+ import net.minecraft.world.level.World;
+import org.bukkit.event.player.PlayerFishEvent; // CraftBukkit
+
public class ItemFishingRod extends Item implements ItemVanishable {
public ItemFishingRod(Item.Info item_info) {
-@@ -21,12 +23,23 @@
+@@ -31,12 +33,23 @@
world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_FISHING_BOBBER_RETRIEVE, SoundCategory.NEUTRAL, 1.0F, 0.4F / (ItemFishingRod.RANDOM.nextFloat() * 0.4F + 0.8F));
} else {
@@ -26,7 +27,7 @@
+
+ if (playerFishEvent.isCancelled()) {
+ entityhuman.hookedFish = null;
-+ return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack);
++ return InteractionResultWrapper.pass(itemstack);
+ }
+ world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_FISHING_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemFishingRod.RANDOM.nextFloat() * 0.4F + 0.8F));
+ world.addEntity(entityfishinghook);
diff --git a/nms-patches/net/minecraft/world/item/ItemFlintAndSteel.patch b/nms-patches/net/minecraft/world/item/ItemFlintAndSteel.patch
index 967252e11..597328422 100644
--- a/nms-patches/net/minecraft/world/item/ItemFlintAndSteel.patch
+++ b/nms-patches/net/minecraft/world/item/ItemFlintAndSteel.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemFlintAndSteel.java
-+++ b/net/minecraft/server/ItemFlintAndSteel.java
-@@ -13,7 +13,7 @@
+--- a/net/minecraft/world/item/ItemFlintAndSteel.java
++++ b/net/minecraft/world/item/ItemFlintAndSteel.java
+@@ -28,7 +28,7 @@
BlockPosition blockposition = itemactioncontext.getClickPosition();
IBlockData iblockdata = world.getType(blockposition);
@@ -9,7 +9,7 @@
world.playSound(entityhuman, blockposition, SoundEffects.ITEM_FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, ItemFlintAndSteel.RANDOM.nextFloat() * 0.4F + 0.8F);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockProperties.r, true), 11);
if (entityhuman != null) {
-@@ -27,6 +27,14 @@
+@@ -42,6 +42,14 @@
BlockPosition blockposition1 = blockposition.shift(itemactioncontext.getClickedFace());
if (BlockFireAbstract.a(world, blockposition1, itemactioncontext.f())) {
diff --git a/nms-patches/net/minecraft/world/item/ItemHanging.patch b/nms-patches/net/minecraft/world/item/ItemHanging.patch
index 82cc9e758..596a13bed 100644
--- a/nms-patches/net/minecraft/world/item/ItemHanging.patch
+++ b/nms-patches/net/minecraft/world/item/ItemHanging.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/ItemHanging.java
-+++ b/net/minecraft/server/ItemHanging.java
-@@ -1,5 +1,10 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/item/ItemHanging.java
++++ b/net/minecraft/world/item/ItemHanging.java
+@@ -13,6 +13,11 @@
+ import net.minecraft.world.item.context.ItemActionContext;
+ import net.minecraft.world.level.World;
+// CraftBukkit start
+import org.bukkit.entity.Player;
@@ -11,7 +12,7 @@
public class ItemHanging extends Item {
private final EntityTypes extends EntityHanging> a;
-@@ -41,6 +46,18 @@
+@@ -54,6 +59,18 @@
if (((EntityHanging) object).survives()) {
if (!world.isClientSide) {
diff --git a/nms-patches/net/minecraft/world/item/ItemLeash.patch b/nms-patches/net/minecraft/world/item/ItemLeash.patch
index 0f7293f52..c1920256e 100644
--- a/nms-patches/net/minecraft/world/item/ItemLeash.patch
+++ b/nms-patches/net/minecraft/world/item/ItemLeash.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/ItemLeash.java
-+++ b/net/minecraft/server/ItemLeash.java
-@@ -3,6 +3,8 @@
- import java.util.Iterator;
- import java.util.List;
+--- a/net/minecraft/world/item/ItemLeash.java
++++ b/net/minecraft/world/item/ItemLeash.java
+@@ -14,6 +14,8 @@
+ import net.minecraft.world.level.block.Block;
+ import net.minecraft.world.phys.AxisAlignedBB;
+import org.bukkit.event.hanging.HangingPlaceEvent; // CraftBukkit
+
public class ItemLeash extends Item {
public ItemLeash(Item.Info item_info) {
-@@ -44,7 +46,23 @@
+@@ -55,7 +57,23 @@
if (entityinsentient.getLeashHolder() == entityhuman) {
if (entityleash == null) {
entityleash = EntityLeash.a(world, blockposition);
diff --git a/nms-patches/net/minecraft/world/item/ItemMilkBucket.patch b/nms-patches/net/minecraft/world/item/ItemMilkBucket.patch
index ee96e15bc..b3a9cca20 100644
--- a/nms-patches/net/minecraft/world/item/ItemMilkBucket.patch
+++ b/nms-patches/net/minecraft/world/item/ItemMilkBucket.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemMilkBucket.java
-+++ b/net/minecraft/server/ItemMilkBucket.java
-@@ -20,7 +20,7 @@
+--- a/net/minecraft/world/item/ItemMilkBucket.java
++++ b/net/minecraft/world/item/ItemMilkBucket.java
+@@ -29,7 +29,7 @@
}
if (!world.isClientSide) {
diff --git a/nms-patches/net/minecraft/world/item/ItemMinecart.patch b/nms-patches/net/minecraft/world/item/ItemMinecart.patch
index 8d59fb0f7..c22672a62 100644
--- a/nms-patches/net/minecraft/world/item/ItemMinecart.patch
+++ b/nms-patches/net/minecraft/world/item/ItemMinecart.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/ItemMinecart.java
-+++ b/net/minecraft/server/ItemMinecart.java
-@@ -1,5 +1,10 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/item/ItemMinecart.java
++++ b/net/minecraft/world/item/ItemMinecart.java
+@@ -18,6 +18,11 @@
+ import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.level.block.state.properties.BlockPropertyTrackPosition;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
@@ -11,7 +12,7 @@
public class ItemMinecart extends Item {
private static final IDispenseBehavior a = new DispenseBehaviorItem() {
-@@ -38,14 +43,43 @@
+@@ -56,14 +61,43 @@
}
}
@@ -58,7 +59,7 @@
return itemstack;
}
-@@ -87,7 +121,12 @@
+@@ -105,7 +139,12 @@
entityminecartabstract.setCustomName(itemstack.getName());
}
diff --git a/nms-patches/net/minecraft/world/item/ItemMonsterEgg.patch b/nms-patches/net/minecraft/world/item/ItemMonsterEgg.patch
index 7bec16728..274272aa6 100644
--- a/nms-patches/net/minecraft/world/item/ItemMonsterEgg.patch
+++ b/nms-patches/net/minecraft/world/item/ItemMonsterEgg.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemMonsterEgg.java
-+++ b/net/minecraft/server/ItemMonsterEgg.java
-@@ -141,7 +141,7 @@
+--- a/net/minecraft/world/item/ItemMonsterEgg.java
++++ b/net/minecraft/world/item/ItemMonsterEgg.java
+@@ -167,7 +167,7 @@
return Optional.empty();
} else {
((EntityInsentient) object).setPositionRotation(vec3d.getX(), vec3d.getY(), vec3d.getZ(), 0.0F, 0.0F);
@@ -9,7 +9,7 @@
if (itemstack.hasName()) {
((EntityInsentient) object).setCustomName(itemstack.getName());
}
-@@ -150,7 +150,7 @@
+@@ -176,7 +176,7 @@
itemstack.subtract(1);
}
diff --git a/nms-patches/net/minecraft/world/item/ItemPotion.patch b/nms-patches/net/minecraft/world/item/ItemPotion.patch
index aba701ca9..4039a8c57 100644
--- a/nms-patches/net/minecraft/world/item/ItemPotion.patch
+++ b/nms-patches/net/minecraft/world/item/ItemPotion.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemPotion.java
-+++ b/net/minecraft/server/ItemPotion.java
-@@ -32,7 +32,7 @@
+--- a/net/minecraft/world/item/ItemPotion.java
++++ b/net/minecraft/world/item/ItemPotion.java
+@@ -46,7 +46,7 @@
if (mobeffect.getMobEffect().isInstant()) {
mobeffect.getMobEffect().applyInstantEffect(entityhuman, entityhuman, entityliving, mobeffect.getAmplifier(), 1.0D);
} else {
diff --git a/nms-patches/net/minecraft/world/item/ItemRecord.patch b/nms-patches/net/minecraft/world/item/ItemRecord.patch
index 692fdf0eb..fac390b5a 100644
--- a/nms-patches/net/minecraft/world/item/ItemRecord.patch
+++ b/nms-patches/net/minecraft/world/item/ItemRecord.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemRecord.java
-+++ b/net/minecraft/server/ItemRecord.java
-@@ -26,6 +26,7 @@
+--- a/net/minecraft/world/item/ItemRecord.java
++++ b/net/minecraft/world/item/ItemRecord.java
+@@ -37,6 +37,7 @@
ItemStack itemstack = itemactioncontext.getItemStack();
if (!world.isClientSide) {
diff --git a/nms-patches/net/minecraft/world/item/ItemSign.patch b/nms-patches/net/minecraft/world/item/ItemSign.patch
index ea5b6ece5..77bbfd61f 100644
--- a/nms-patches/net/minecraft/world/item/ItemSign.patch
+++ b/nms-patches/net/minecraft/world/item/ItemSign.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemSign.java
-+++ b/net/minecraft/server/ItemSign.java
-@@ -4,6 +4,8 @@
+--- a/net/minecraft/world/item/ItemSign.java
++++ b/net/minecraft/world/item/ItemSign.java
+@@ -10,6 +10,8 @@
public class ItemSign extends ItemBlockWallable {
@@ -9,7 +9,7 @@
public ItemSign(Item.Info item_info, Block block, Block block1) {
super(block, block1, item_info);
}
-@@ -13,7 +15,10 @@
+@@ -19,7 +21,10 @@
boolean flag = super.a(blockposition, world, entityhuman, itemstack, iblockdata);
if (!world.isClientSide && !flag && entityhuman != null) {
diff --git a/nms-patches/net/minecraft/world/item/ItemSkullPlayer.patch b/nms-patches/net/minecraft/world/item/ItemSkullPlayer.patch
index 292509cbe..706caa4df 100644
--- a/nms-patches/net/minecraft/world/item/ItemSkullPlayer.patch
+++ b/nms-patches/net/minecraft/world/item/ItemSkullPlayer.patch
@@ -1,11 +1,11 @@
---- a/net/minecraft/server/ItemSkullPlayer.java
-+++ b/net/minecraft/server/ItemSkullPlayer.java
-@@ -44,6 +44,15 @@
+--- a/net/minecraft/world/item/ItemSkullPlayer.java
++++ b/net/minecraft/world/item/ItemSkullPlayer.java
+@@ -50,6 +50,15 @@
nbttagcompound.set("SkullOwner", GameProfileSerializer.serialize(new NBTTagCompound(), gameprofile));
return true;
} else {
+ // CraftBukkit start
-+ NBTTagList textures = nbttagcompound.getCompound("SkullOwner").getCompound("Properties").getList("textures", 10); // Safe due to method contracts
++ net.minecraft.nbt.NBTTagList textures = nbttagcompound.getCompound("SkullOwner").getCompound("Properties").getList("textures", 10); // Safe due to method contracts
+ for (int i = 0; i < textures.size(); i++) {
+ if (textures.get(i) instanceof NBTTagCompound && !((NBTTagCompound) textures.get(i)).hasKeyOfType("Signature", 8) && ((NBTTagCompound) textures.get(i)).getString("Value").trim().isEmpty()) {
+ nbttagcompound.remove("SkullOwner");
diff --git a/nms-patches/net/minecraft/world/item/ItemSnowball.patch b/nms-patches/net/minecraft/world/item/ItemSnowball.patch
index f8e1d4a11..96a1ac206 100644
--- a/nms-patches/net/minecraft/world/item/ItemSnowball.patch
+++ b/nms-patches/net/minecraft/world/item/ItemSnowball.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemSnowball.java
-+++ b/net/minecraft/server/ItemSnowball.java
-@@ -10,19 +10,32 @@
+--- a/net/minecraft/world/item/ItemSnowball.java
++++ b/net/minecraft/world/item/ItemSnowball.java
+@@ -19,19 +19,32 @@
public InteractionResultWrapper a(World world, EntityHuman entityhuman, EnumHand enumhand) {
ItemStack itemstack = entityhuman.b(enumhand);
@@ -19,8 +19,8 @@
+ }
+
+ world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.RANDOM.nextFloat() * 0.4F + 0.8F));
-+ } else if (entityhuman instanceof EntityPlayer) {
-+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
++ } else if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
++ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
+ }
}
+ // CraftBukkit end
diff --git a/nms-patches/net/minecraft/world/item/ItemStack.patch b/nms-patches/net/minecraft/world/item/ItemStack.patch
index 52f41aa5e..d8177dd8a 100644
--- a/nms-patches/net/minecraft/world/item/ItemStack.patch
+++ b/nms-patches/net/minecraft/world/item/ItemStack.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemStack.java
-+++ b/net/minecraft/server/ItemStack.java
-@@ -19,6 +19,24 @@
+--- a/net/minecraft/world/item/ItemStack.java
++++ b/net/minecraft/world/item/ItemStack.java
+@@ -58,6 +58,39 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -8,7 +8,22 @@
+import com.mojang.serialization.Dynamic;
+import java.util.List;
+import java.util.Map;
-+
++import net.minecraft.core.EnumDirection;
++import net.minecraft.nbt.DynamicOpsNBT;
++import net.minecraft.network.protocol.game.PacketPlayOutBlockChange;
++import net.minecraft.server.MinecraftServer;
++import net.minecraft.server.level.WorldServer;
++import net.minecraft.sounds.SoundCategory;
++import net.minecraft.util.datafix.fixes.DataConverterTypes;
++import net.minecraft.world.level.block.BlockJukeBox;
++import net.minecraft.world.level.block.BlockSapling;
++import net.minecraft.world.level.block.BlockTileEntity;
++import net.minecraft.world.level.block.BlockWitherSkull;
++import net.minecraft.world.level.block.Blocks;
++import net.minecraft.world.level.block.SoundEffectType;
++import net.minecraft.world.level.block.entity.TileEntity;
++import net.minecraft.world.level.block.entity.TileEntitySign;
++import net.minecraft.world.level.block.entity.TileEntitySkull;
+import org.bukkit.Location;
+import org.bukkit.TreeType;
+import org.bukkit.block.BlockState;
@@ -25,7 +40,7 @@
public final class ItemStack {
public static final Codec a = RecordCodecBuilder.create((instance) -> {
-@@ -32,7 +50,7 @@
+@@ -71,7 +104,7 @@
});
private static final Logger LOGGER = LogManager.getLogger();
public static final ItemStack b = new ItemStack((Item) null);
@@ -34,7 +49,7 @@
decimalformat.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(Locale.ROOT));
});
private static final ChatModifier e = ChatModifier.a.setColor(EnumChatFormat.DARK_PURPLE).setItalic(true);
-@@ -67,23 +85,42 @@
+@@ -106,23 +139,42 @@
this.checkEmpty();
}
@@ -80,7 +95,7 @@
this.checkEmpty();
}
-@@ -113,7 +150,7 @@
+@@ -152,7 +204,7 @@
return this.j ? Items.AIR : this.item;
}
@@ -89,7 +104,7 @@
EntityHuman entityhuman = itemactioncontext.getEntity();
BlockPosition blockposition = itemactioncontext.getClickPosition();
ShapeDetectorBlock shapedetectorblock = new ShapeDetectorBlock(itemactioncontext.getWorld(), blockposition, false);
-@@ -121,12 +158,153 @@
+@@ -160,12 +212,153 @@
if (entityhuman != null && !entityhuman.abilities.mayBuild && !this.b(itemactioncontext.getWorld().p(), shapedetectorblock)) {
return EnumInteractionResult.PASS;
} else {
@@ -231,7 +246,7 @@
+
+ // SPIGOT-1288 - play sound stripped from ItemBlock
+ if (this.item instanceof ItemBlock) {
-+ SoundEffectType soundeffecttype = ((ItemBlock) this.item).getBlock().stepSound;
++ SoundEffectType soundeffecttype = ((ItemBlock) this.item).getBlock().getStepSound(null);
+ world.playSound(entityhuman, blockposition, soundeffecttype.getPlaceSound(), SoundCategory.BLOCKS, (soundeffecttype.getVolume() + 1.0F) / 2.0F, soundeffecttype.getPitch() * 0.8F);
+ }
+
@@ -244,7 +259,7 @@
return enuminteractionresult;
}
-@@ -207,6 +385,21 @@
+@@ -246,6 +439,21 @@
}
i -= k;
@@ -266,7 +281,7 @@
if (i <= 0) {
return false;
}
-@@ -228,6 +421,11 @@
+@@ -267,6 +475,11 @@
if (this.isDamaged(i, t0.getRandom(), t0 instanceof EntityPlayer ? (EntityPlayer) t0 : null)) {
consumer.accept(t0);
Item item = this.getItem();
@@ -278,7 +293,7 @@
this.subtract(1);
if (t0 instanceof EntityHuman) {
-@@ -359,6 +557,17 @@
+@@ -398,6 +611,17 @@
return this.tag;
}
@@ -296,7 +311,7 @@
public NBTTagCompound getOrCreateTag() {
if (this.tag == null) {
this.setTag(new NBTTagCompound());
-@@ -522,6 +731,12 @@
+@@ -561,6 +785,12 @@
}
public void setRepairCost(int i) {
@@ -309,7 +324,7 @@
this.getOrCreateTag().setInt("RepairCost", i);
}
-@@ -571,6 +786,13 @@
+@@ -610,6 +840,13 @@
nbttaglist.add(nbttagcompound);
}
diff --git a/nms-patches/net/minecraft/world/item/ItemTrident.patch b/nms-patches/net/minecraft/world/item/ItemTrident.patch
index 1620a9751..f094ea688 100644
--- a/nms-patches/net/minecraft/world/item/ItemTrident.patch
+++ b/nms-patches/net/minecraft/world/item/ItemTrident.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ItemTrident.java
-+++ b/net/minecraft/server/ItemTrident.java
-@@ -43,9 +43,12 @@
+--- a/net/minecraft/world/item/ItemTrident.java
++++ b/net/minecraft/world/item/ItemTrident.java
+@@ -65,9 +65,12 @@
if (k <= 0 || entityhuman.isInWaterOrRain()) {
if (!world.isClientSide) {
@@ -13,15 +13,15 @@
if (k == 0) {
EntityThrownTrident entitythrowntrident = new EntityThrownTrident(world, entityhuman, itemstack);
-@@ -54,16 +57,39 @@
+@@ -76,16 +79,39 @@
entitythrowntrident.fromPlayer = EntityArrow.PickupStatus.CREATIVE_ONLY;
}
- world.addEntity(entitythrowntrident);
+ // CraftBukkit start
+ if (!world.addEntity(entitythrowntrident)) {
-+ if (entityhuman instanceof EntityPlayer) {
-+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
++ if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) {
++ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
+ }
+ return;
+ }
diff --git a/nms-patches/net/minecraft/world/item/ItemWorldMap.patch b/nms-patches/net/minecraft/world/item/ItemWorldMap.patch
index 290a65e5f..b796d7087 100644
--- a/nms-patches/net/minecraft/world/item/ItemWorldMap.patch
+++ b/nms-patches/net/minecraft/world/item/ItemWorldMap.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/ItemWorldMap.java
-+++ b/net/minecraft/server/ItemWorldMap.java
-@@ -6,6 +6,11 @@
- import com.google.common.collect.Multisets;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/item/ItemWorldMap.java
++++ b/net/minecraft/world/item/ItemWorldMap.java
+@@ -30,6 +30,11 @@
+ import net.minecraft.world.level.material.MaterialMapColor;
+ import net.minecraft.world.level.saveddata.maps.WorldMap;
+// CraftBukkit start
+import org.bukkit.Bukkit;
@@ -12,7 +12,7 @@
public class ItemWorldMap extends ItemWorldMapBase {
public ItemWorldMap(Item.Info item_info) {
-@@ -38,7 +43,7 @@
+@@ -62,7 +67,7 @@
public static int d(ItemStack itemstack) {
NBTTagCompound nbttagcompound = itemstack.getTag();
@@ -21,7 +21,7 @@
}
private static WorldMap a(ItemStack itemstack, World world, int i, int j, int k, boolean flag, boolean flag1, ResourceKey resourcekey) {
-@@ -48,6 +53,11 @@
+@@ -72,6 +77,11 @@
worldmap.a(i, j, k, flag, flag1, resourcekey);
world.a(worldmap);
itemstack.getOrCreateTag().setInt("map", l);
diff --git a/nms-patches/net/minecraft/world/item/crafting/CraftingManager.patch b/nms-patches/net/minecraft/world/item/crafting/CraftingManager.patch
index 73dc06120..7dafb9148 100644
--- a/nms-patches/net/minecraft/world/item/crafting/CraftingManager.patch
+++ b/nms-patches/net/minecraft/world/item/crafting/CraftingManager.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/CraftingManager.java
-+++ b/net/minecraft/server/CraftingManager.java
-@@ -23,11 +23,13 @@
+--- a/net/minecraft/world/item/crafting/CraftingManager.java
++++ b/net/minecraft/world/item/crafting/CraftingManager.java
+@@ -34,11 +34,13 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -15,7 +15,7 @@
private boolean d;
public CraftingManager() {
-@@ -36,7 +38,12 @@
+@@ -47,7 +49,12 @@
protected void a(Map map, IResourceManager iresourcemanager, GameProfilerFiller gameprofilerfiller) {
this.d = false;
@@ -29,7 +29,7 @@
Iterator iterator = map.entrySet().iterator();
while (iterator.hasNext()) {
-@@ -46,24 +53,42 @@
+@@ -57,24 +64,42 @@
try {
IRecipe> irecipe = a(minecraftkey, ChatDeserializer.m((JsonElement) entry.getValue(), "top element"));
@@ -77,7 +77,7 @@
}
public > List a(Recipes recipes) {
-@@ -81,7 +106,7 @@
+@@ -92,7 +117,7 @@
}
private > Map> b(Recipes recipes) {
@@ -86,7 +86,7 @@
}
public > NonNullList c(Recipes recipes, C c0, World world) {
-@@ -102,7 +127,7 @@
+@@ -113,7 +138,7 @@
public Optional extends IRecipe>> getRecipe(MinecraftKey minecraftkey) {
return this.recipes.values().stream().map((map) -> {
@@ -95,7 +95,7 @@
}).filter(Objects::nonNull).findFirst();
}
-@@ -125,4 +150,14 @@
+@@ -136,4 +161,14 @@
return new JsonSyntaxException("Invalid or unsupported recipe type '" + s + "'");
})).a(minecraftkey, jsonobject);
}
diff --git a/nms-patches/net/minecraft/world/item/crafting/FurnaceRecipe.patch b/nms-patches/net/minecraft/world/item/crafting/FurnaceRecipe.patch
index 3f1a15ae4..af5b89606 100644
--- a/nms-patches/net/minecraft/world/item/crafting/FurnaceRecipe.patch
+++ b/nms-patches/net/minecraft/world/item/crafting/FurnaceRecipe.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/FurnaceRecipe.java
-+++ b/net/minecraft/server/FurnaceRecipe.java
-@@ -1,5 +1,13 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/item/crafting/FurnaceRecipe.java
++++ b/net/minecraft/world/item/crafting/FurnaceRecipe.java
+@@ -3,6 +3,14 @@
+ import net.minecraft.resources.MinecraftKey;
+ import net.minecraft.world.item.ItemStack;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftFurnaceRecipe;
@@ -14,7 +15,7 @@
public class FurnaceRecipe extends RecipeCooking {
public FurnaceRecipe(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
-@@ -10,4 +18,14 @@
+@@ -13,4 +21,14 @@
public RecipeSerializer> getRecipeSerializer() {
return RecipeSerializer.p;
}
diff --git a/nms-patches/net/minecraft/world/item/crafting/IRecipe.patch b/nms-patches/net/minecraft/world/item/crafting/IRecipe.patch
index 7dc7ba4bd..c9f4d01a8 100644
--- a/nms-patches/net/minecraft/world/item/crafting/IRecipe.patch
+++ b/nms-patches/net/minecraft/world/item/crafting/IRecipe.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/IRecipe.java
-+++ b/net/minecraft/server/IRecipe.java
-@@ -35,4 +35,6 @@
+--- a/net/minecraft/world/item/crafting/IRecipe.java
++++ b/net/minecraft/world/item/crafting/IRecipe.java
+@@ -42,4 +42,6 @@
RecipeSerializer> getRecipeSerializer();
Recipes> g();
diff --git a/nms-patches/net/minecraft/world/item/crafting/IRecipeComplex.patch b/nms-patches/net/minecraft/world/item/crafting/IRecipeComplex.patch
index 87925e273..560745f40 100644
--- a/nms-patches/net/minecraft/world/item/crafting/IRecipeComplex.patch
+++ b/nms-patches/net/minecraft/world/item/crafting/IRecipeComplex.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/IRecipeComplex.java
-+++ b/net/minecraft/server/IRecipeComplex.java
-@@ -22,4 +22,11 @@
+--- a/net/minecraft/world/item/crafting/IRecipeComplex.java
++++ b/net/minecraft/world/item/crafting/IRecipeComplex.java
+@@ -25,4 +25,11 @@
public ItemStack getResult() {
return ItemStack.b;
}
diff --git a/nms-patches/net/minecraft/world/item/crafting/RecipeBlasting.patch b/nms-patches/net/minecraft/world/item/crafting/RecipeBlasting.patch
index 396c1111b..f8d6acfcb 100644
--- a/nms-patches/net/minecraft/world/item/crafting/RecipeBlasting.patch
+++ b/nms-patches/net/minecraft/world/item/crafting/RecipeBlasting.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/RecipeBlasting.java
-+++ b/net/minecraft/server/RecipeBlasting.java
-@@ -1,5 +1,13 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/item/crafting/RecipeBlasting.java
++++ b/net/minecraft/world/item/crafting/RecipeBlasting.java
+@@ -3,6 +3,14 @@
+ import net.minecraft.resources.MinecraftKey;
+ import net.minecraft.world.item.ItemStack;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftBlastingRecipe;
@@ -14,7 +15,7 @@
public class RecipeBlasting extends RecipeCooking {
public RecipeBlasting(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
-@@ -10,4 +18,16 @@
+@@ -13,4 +21,16 @@
public RecipeSerializer> getRecipeSerializer() {
return RecipeSerializer.q;
}
diff --git a/nms-patches/net/minecraft/world/item/crafting/RecipeCampfire.patch b/nms-patches/net/minecraft/world/item/crafting/RecipeCampfire.patch
index 3339152ef..10010627b 100644
--- a/nms-patches/net/minecraft/world/item/crafting/RecipeCampfire.patch
+++ b/nms-patches/net/minecraft/world/item/crafting/RecipeCampfire.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/RecipeCampfire.java
-+++ b/net/minecraft/server/RecipeCampfire.java
-@@ -1,5 +1,13 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/item/crafting/RecipeCampfire.java
++++ b/net/minecraft/world/item/crafting/RecipeCampfire.java
+@@ -3,6 +3,14 @@
+ import net.minecraft.resources.MinecraftKey;
+ import net.minecraft.world.item.ItemStack;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftCampfireRecipe;
@@ -14,7 +15,7 @@
public class RecipeCampfire extends RecipeCooking {
public RecipeCampfire(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
-@@ -10,4 +18,16 @@
+@@ -13,4 +21,16 @@
public RecipeSerializer> getRecipeSerializer() {
return RecipeSerializer.s;
}
diff --git a/nms-patches/net/minecraft/world/item/crafting/RecipeItemStack.patch b/nms-patches/net/minecraft/world/item/crafting/RecipeItemStack.patch
index c1857a0f9..2d4edf4b5 100644
--- a/nms-patches/net/minecraft/world/item/crafting/RecipeItemStack.patch
+++ b/nms-patches/net/minecraft/world/item/crafting/RecipeItemStack.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/RecipeItemStack.java
-+++ b/net/minecraft/server/RecipeItemStack.java
-@@ -25,6 +25,7 @@
+--- a/net/minecraft/world/item/crafting/RecipeItemStack.java
++++ b/net/minecraft/world/item/crafting/RecipeItemStack.java
+@@ -35,6 +35,7 @@
private final RecipeItemStack.Provider[] b;
public ItemStack[] choices;
private IntList d;
@@ -8,7 +8,7 @@
public RecipeItemStack(Stream extends RecipeItemStack.Provider> stream) {
this.b = (RecipeItemStack.Provider[]) stream.toArray((i) -> {
-@@ -57,6 +58,15 @@
+@@ -67,6 +68,15 @@
for (int j = 0; j < i; ++j) {
ItemStack itemstack1 = aitemstack[j];
diff --git a/nms-patches/net/minecraft/world/item/crafting/RecipeSmithing.patch b/nms-patches/net/minecraft/world/item/crafting/RecipeSmithing.patch
index 09955e723..3bc533f53 100644
--- a/nms-patches/net/minecraft/world/item/crafting/RecipeSmithing.patch
+++ b/nms-patches/net/minecraft/world/item/crafting/RecipeSmithing.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/RecipeSmithing.java
-+++ b/net/minecraft/server/RecipeSmithing.java
-@@ -3,6 +3,14 @@
- import com.google.gson.JsonElement;
- import com.google.gson.JsonObject;
+--- a/net/minecraft/world/item/crafting/RecipeSmithing.java
++++ b/net/minecraft/world/item/crafting/RecipeSmithing.java
+@@ -10,6 +10,14 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.level.World;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
@@ -15,7 +15,7 @@
public class RecipeSmithing implements IRecipe {
private final RecipeItemStack a;
-@@ -58,6 +66,17 @@
+@@ -65,6 +73,17 @@
return Recipes.SMITHING;
}
diff --git a/nms-patches/net/minecraft/world/item/crafting/RecipeSmoking.patch b/nms-patches/net/minecraft/world/item/crafting/RecipeSmoking.patch
index 7cb2caf77..4debf4927 100644
--- a/nms-patches/net/minecraft/world/item/crafting/RecipeSmoking.patch
+++ b/nms-patches/net/minecraft/world/item/crafting/RecipeSmoking.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/RecipeSmoking.java
-+++ b/net/minecraft/server/RecipeSmoking.java
-@@ -1,5 +1,13 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/item/crafting/RecipeSmoking.java
++++ b/net/minecraft/world/item/crafting/RecipeSmoking.java
+@@ -3,6 +3,14 @@
+ import net.minecraft.resources.MinecraftKey;
+ import net.minecraft.world.item.ItemStack;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
@@ -14,7 +15,7 @@
public class RecipeSmoking extends RecipeCooking {
public RecipeSmoking(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack, float f, int i) {
-@@ -10,4 +18,16 @@
+@@ -13,4 +21,16 @@
public RecipeSerializer> getRecipeSerializer() {
return RecipeSerializer.r;
}
diff --git a/nms-patches/net/minecraft/world/item/crafting/RecipeStonecutting.patch b/nms-patches/net/minecraft/world/item/crafting/RecipeStonecutting.patch
index 02bbcb157..bb994f7c0 100644
--- a/nms-patches/net/minecraft/world/item/crafting/RecipeStonecutting.patch
+++ b/nms-patches/net/minecraft/world/item/crafting/RecipeStonecutting.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/RecipeStonecutting.java
-+++ b/net/minecraft/server/RecipeStonecutting.java
-@@ -1,5 +1,13 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/item/crafting/RecipeStonecutting.java
++++ b/net/minecraft/world/item/crafting/RecipeStonecutting.java
+@@ -5,6 +5,14 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.level.World;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
@@ -14,7 +15,7 @@
public class RecipeStonecutting extends RecipeSingleItem {
public RecipeStonecutting(MinecraftKey minecraftkey, String s, RecipeItemStack recipeitemstack, ItemStack itemstack) {
-@@ -10,4 +18,16 @@
+@@ -15,4 +23,16 @@
public boolean a(IInventory iinventory, World world) {
return this.ingredient.test(iinventory.getItem(0));
}
diff --git a/nms-patches/net/minecraft/world/item/crafting/ShapedRecipes.patch b/nms-patches/net/minecraft/world/item/crafting/ShapedRecipes.patch
index e7c698880..cc580fa99 100644
--- a/nms-patches/net/minecraft/world/item/crafting/ShapedRecipes.patch
+++ b/nms-patches/net/minecraft/world/item/crafting/ShapedRecipes.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/ShapedRecipes.java
-+++ b/net/minecraft/server/ShapedRecipes.java
-@@ -13,6 +13,13 @@
- import java.util.Map.Entry;
- import java.util.Set;
+--- a/net/minecraft/world/item/crafting/ShapedRecipes.java
++++ b/net/minecraft/world/item/crafting/ShapedRecipes.java
+@@ -22,6 +22,13 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.level.World;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
@@ -14,7 +14,7 @@
public class ShapedRecipes implements RecipeCrafting {
private final int width;
-@@ -31,6 +38,66 @@
+@@ -40,6 +47,66 @@
this.result = itemstack;
}
diff --git a/nms-patches/net/minecraft/world/item/crafting/ShapelessRecipes.patch b/nms-patches/net/minecraft/world/item/crafting/ShapelessRecipes.patch
index 7d59fd42c..1de17e0cd 100644
--- a/nms-patches/net/minecraft/world/item/crafting/ShapelessRecipes.patch
+++ b/nms-patches/net/minecraft/world/item/crafting/ShapelessRecipes.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/ShapelessRecipes.java
-+++ b/net/minecraft/server/ShapelessRecipes.java
-@@ -6,6 +6,12 @@
- import it.unimi.dsi.fastutil.ints.IntList;
- import java.util.Iterator;
+--- a/net/minecraft/world/item/crafting/ShapelessRecipes.java
++++ b/net/minecraft/world/item/crafting/ShapelessRecipes.java
+@@ -14,6 +14,12 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.level.World;
+// CraftBukkit start
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
@@ -13,7 +13,7 @@
public class ShapelessRecipes implements RecipeCrafting {
private final MinecraftKey key;
-@@ -20,6 +26,20 @@
+@@ -28,6 +34,20 @@
this.ingredients = nonnulllist;
}
diff --git a/nms-patches/net/minecraft/world/item/enchantment/EnchantmentFrostWalker.patch b/nms-patches/net/minecraft/world/item/enchantment/EnchantmentFrostWalker.patch
index 635d3443c..8d5271751 100644
--- a/nms-patches/net/minecraft/world/item/enchantment/EnchantmentFrostWalker.patch
+++ b/nms-patches/net/minecraft/world/item/enchantment/EnchantmentFrostWalker.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EnchantmentFrostWalker.java
-+++ b/net/minecraft/server/EnchantmentFrostWalker.java
-@@ -46,8 +46,11 @@
+--- a/net/minecraft/world/item/enchantment/EnchantmentFrostWalker.java
++++ b/net/minecraft/world/item/enchantment/EnchantmentFrostWalker.java
+@@ -57,8 +57,11 @@
IBlockData iblockdata2 = world.getType(blockposition1);
if (iblockdata2.getMaterial() == Material.WATER && (Integer) iblockdata2.get(BlockFluids.LEVEL) == 0 && iblockdata.canPlace(world, blockposition1) && world.a(iblockdata, blockposition1, VoxelShapeCollision.a())) {
diff --git a/nms-patches/net/minecraft/world/item/enchantment/EnchantmentWeaponDamage.patch b/nms-patches/net/minecraft/world/item/enchantment/EnchantmentWeaponDamage.patch
index c0e2bfca0..397d05ec4 100644
--- a/nms-patches/net/minecraft/world/item/enchantment/EnchantmentWeaponDamage.patch
+++ b/nms-patches/net/minecraft/world/item/enchantment/EnchantmentWeaponDamage.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/EnchantmentWeaponDamage.java
-+++ b/net/minecraft/server/EnchantmentWeaponDamage.java
-@@ -51,7 +51,7 @@
+--- a/net/minecraft/world/item/enchantment/EnchantmentWeaponDamage.java
++++ b/net/minecraft/world/item/enchantment/EnchantmentWeaponDamage.java
+@@ -60,7 +60,7 @@
if (this.a == 2 && entityliving1.getMonsterType() == EnumMonsterType.ARTHROPOD) {
int j = 20 + entityliving.getRandom().nextInt(10 * i);
diff --git a/nms-patches/net/minecraft/world/item/enchantment/Enchantments.patch b/nms-patches/net/minecraft/world/item/enchantment/Enchantments.patch
index db3493ea0..84cff388e 100644
--- a/nms-patches/net/minecraft/world/item/enchantment/Enchantments.patch
+++ b/nms-patches/net/minecraft/world/item/enchantment/Enchantments.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/Enchantments.java
-+++ b/net/minecraft/server/Enchantments.java
-@@ -42,7 +42,15 @@
+--- a/net/minecraft/world/item/enchantment/Enchantments.java
++++ b/net/minecraft/world/item/enchantment/Enchantments.java
+@@ -45,7 +45,15 @@
public static final Enchantment MENDING = a("mending", new EnchantmentMending(Enchantment.Rarity.RARE, EnumItemSlot.values()));
public static final Enchantment VANISHING_CURSE = a("vanishing_curse", new EnchantmentVanishing(Enchantment.Rarity.VERY_RARE, EnumItemSlot.values()));
diff --git a/nms-patches/net/minecraft/world/item/trading/IMerchant.patch b/nms-patches/net/minecraft/world/item/trading/IMerchant.patch
index 60513a4c1..869aef8f6 100644
--- a/nms-patches/net/minecraft/world/item/trading/IMerchant.patch
+++ b/nms-patches/net/minecraft/world/item/trading/IMerchant.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/IMerchant.java
-+++ b/net/minecraft/server/IMerchant.java
-@@ -44,4 +44,6 @@
+--- a/net/minecraft/world/item/trading/IMerchant.java
++++ b/net/minecraft/world/item/trading/IMerchant.java
+@@ -51,4 +51,6 @@
}
}
diff --git a/nms-patches/net/minecraft/world/item/trading/MerchantRecipe.patch b/nms-patches/net/minecraft/world/item/trading/MerchantRecipe.patch
index cc3d1256e..7223cdc7b 100644
--- a/nms-patches/net/minecraft/world/item/trading/MerchantRecipe.patch
+++ b/nms-patches/net/minecraft/world/item/trading/MerchantRecipe.patch
@@ -1,14 +1,15 @@
---- a/net/minecraft/server/MerchantRecipe.java
-+++ b/net/minecraft/server/MerchantRecipe.java
-@@ -1,5 +1,7 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/item/trading/MerchantRecipe.java
++++ b/net/minecraft/world/item/trading/MerchantRecipe.java
+@@ -5,6 +5,8 @@
+ import net.minecraft.util.MathHelper;
+ import net.minecraft.world.item.ItemStack;
+import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe; // CraftBukkit
+
public class MerchantRecipe {
public ItemStack buyingItem1;
-@@ -12,6 +14,18 @@
+@@ -17,6 +19,18 @@
private int demand;
public float priceMultiplier;
public int xp;
@@ -27,7 +28,7 @@
public MerchantRecipe(NBTTagCompound nbttagcompound) {
this.rewardExp = true;
-@@ -73,6 +87,7 @@
+@@ -78,6 +92,7 @@
public ItemStack getBuyItem1() {
int i = this.buyingItem1.getCount();
diff --git a/nms-patches/net/minecraft/world/level/CommandBlockListenerAbstract.patch b/nms-patches/net/minecraft/world/level/CommandBlockListenerAbstract.patch
index 9c9947619..5d492152f 100644
--- a/nms-patches/net/minecraft/world/level/CommandBlockListenerAbstract.patch
+++ b/nms-patches/net/minecraft/world/level/CommandBlockListenerAbstract.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/CommandBlockListenerAbstract.java
-+++ b/net/minecraft/server/CommandBlockListenerAbstract.java
-@@ -17,6 +17,10 @@
+--- a/net/minecraft/world/level/CommandBlockListenerAbstract.java
++++ b/net/minecraft/world/level/CommandBlockListenerAbstract.java
+@@ -30,6 +30,10 @@
private IChatBaseComponent lastOutput;
private String command = "";
private IChatBaseComponent customName;
@@ -11,7 +11,7 @@
public CommandBlockListenerAbstract() {
this.customName = CommandBlockListenerAbstract.c;
-@@ -113,7 +117,7 @@
+@@ -126,7 +130,7 @@
});
diff --git a/nms-patches/net/minecraft/world/level/Explosion.patch b/nms-patches/net/minecraft/world/level/Explosion.patch
index dda314e9a..eec5ebbc1 100644
--- a/nms-patches/net/minecraft/world/level/Explosion.patch
+++ b/nms-patches/net/minecraft/world/level/Explosion.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/Explosion.java
-+++ b/net/minecraft/server/Explosion.java
-@@ -15,6 +15,13 @@
- import java.util.Set;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/Explosion.java
++++ b/net/minecraft/world/level/Explosion.java
+@@ -42,6 +42,14 @@
+ import net.minecraft.world.phys.MovingObjectPosition;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
++import net.minecraft.world.entity.item.EntityFallingBlock;
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.EntityExplodeEvent;
+import org.bukkit.Location;
@@ -14,7 +15,7 @@
public class Explosion {
private static final ExplosionDamageCalculator a = new ExplosionDamageCalculator();
-@@ -32,11 +39,12 @@
+@@ -59,11 +67,12 @@
private final ExplosionDamageCalculator l;
private final List blocks = Lists.newArrayList();
private final Map n = Maps.newHashMap();
@@ -28,7 +29,7 @@
this.posX = d0;
this.posY = d1;
this.posZ = d2;
-@@ -86,6 +94,11 @@
+@@ -113,6 +122,11 @@
}
public void a() {
@@ -40,7 +41,7 @@
Set set = Sets.newHashSet();
boolean flag = true;
-@@ -119,7 +132,7 @@
+@@ -146,7 +160,7 @@
f -= ((Float) optional.get() + 0.3F) * 0.3F;
}
@@ -49,7 +50,7 @@
set.add(blockposition);
}
-@@ -163,7 +176,16 @@
+@@ -190,7 +204,16 @@
double d12 = (double) a(vec3d, entity);
double d13 = (1.0D - d7) * d12;
@@ -67,7 +68,7 @@
double d14 = d13;
if (entity instanceof EntityLiving) {
-@@ -205,6 +227,51 @@
+@@ -232,6 +255,51 @@
Collections.shuffle(this.blocks, this.world.random);
Iterator iterator = this.blocks.iterator();
@@ -119,7 +120,7 @@
while (iterator.hasNext()) {
BlockPosition blockposition = (BlockPosition) iterator.next();
-@@ -219,8 +286,8 @@
+@@ -246,8 +314,8 @@
TileEntity tileentity = block.isTileEntity() ? this.world.getTileEntity(blockposition) : null;
LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.world)).a(this.world.random).set(LootContextParameters.ORIGIN, Vec3D.a((BaseBlockPosition) blockposition)).set(LootContextParameters.TOOL, ItemStack.b).setOptional(LootContextParameters.BLOCK_ENTITY, tileentity).setOptional(LootContextParameters.THIS_ENTITY, this.source);
@@ -130,7 +131,7 @@
}
iblockdata.a(loottableinfo_builder).forEach((itemstack) -> {
-@@ -250,7 +317,11 @@
+@@ -277,7 +345,11 @@
BlockPosition blockposition2 = (BlockPosition) iterator1.next();
if (this.d.nextInt(3) == 0 && this.world.getType(blockposition2).isAir() && this.world.getType(blockposition2.down()).i(this.world, blockposition2.down())) {
@@ -143,7 +144,7 @@
}
}
}
-@@ -258,6 +329,7 @@
+@@ -285,6 +357,7 @@
}
private static void a(ObjectArrayList> objectarraylist, ItemStack itemstack, BlockPosition blockposition) {
diff --git a/nms-patches/net/minecraft/world/level/GameRules.patch b/nms-patches/net/minecraft/world/level/GameRules.patch
index 4a345e0de..bfb8f210b 100644
--- a/nms-patches/net/minecraft/world/level/GameRules.patch
+++ b/nms-patches/net/minecraft/world/level/GameRules.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/GameRules.java
-+++ b/net/minecraft/server/GameRules.java
-@@ -106,7 +106,7 @@
+--- a/net/minecraft/world/level/GameRules.java
++++ b/net/minecraft/world/level/GameRules.java
+@@ -113,7 +113,7 @@
}
public > T get(GameRules.GameRuleKey gamerules_gamerulekey) {
@@ -9,7 +9,7 @@
}
public NBTTagCompound a() {
-@@ -137,8 +137,8 @@
+@@ -144,8 +144,8 @@
}
private static > void a(GameRules.GameRuleVisitor gamerules_gamerulevisitor, GameRules.GameRuleKey> gamerules_gamerulekey, GameRules.GameRuleDefinition> gamerules_gameruledefinition) {
@@ -20,7 +20,7 @@
}
public boolean getBoolean(GameRules.GameRuleKey gamerules_gamerulekey) {
-@@ -189,7 +189,7 @@
+@@ -196,7 +196,7 @@
}
@Override
@@ -29,7 +29,7 @@
this.b = Boolean.parseBoolean(s);
}
-@@ -244,7 +244,7 @@
+@@ -251,7 +251,7 @@
}
@Override
@@ -38,7 +38,7 @@
this.b = c(s);
}
-@@ -298,7 +298,7 @@
+@@ -305,7 +305,7 @@
}
@@ -47,7 +47,7 @@
public abstract String getValue();
-@@ -332,7 +332,7 @@
+@@ -339,7 +339,7 @@
}
public T getValue() {
diff --git a/nms-patches/net/minecraft/world/level/GeneratorAccess.patch b/nms-patches/net/minecraft/world/level/GeneratorAccess.patch
index 4b64d5166..5373af994 100644
--- a/nms-patches/net/minecraft/world/level/GeneratorAccess.patch
+++ b/nms-patches/net/minecraft/world/level/GeneratorAccess.patch
@@ -1,9 +1,9 @@
---- a/net/minecraft/server/GeneratorAccess.java
-+++ b/net/minecraft/server/GeneratorAccess.java
-@@ -46,4 +46,6 @@
+--- a/net/minecraft/world/level/GeneratorAccess.java
++++ b/net/minecraft/world/level/GeneratorAccess.java
+@@ -57,4 +57,6 @@
default void triggerEffect(int i, BlockPosition blockposition, int j) {
this.a((EntityHuman) null, i, blockposition, j);
}
+
-+ WorldServer getMinecraftWorld(); // CraftBukkit
++ net.minecraft.server.level.WorldServer getMinecraftWorld(); // CraftBukkit
}
diff --git a/nms-patches/net/minecraft/world/level/IBlockAccess.patch b/nms-patches/net/minecraft/world/level/IBlockAccess.patch
index bb7470bb8..e430a7b02 100644
--- a/nms-patches/net/minecraft/world/level/IBlockAccess.patch
+++ b/nms-patches/net/minecraft/world/level/IBlockAccess.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/IBlockAccess.java
-+++ b/net/minecraft/server/IBlockAccess.java
-@@ -31,8 +31,8 @@
+--- a/net/minecraft/world/level/IBlockAccess.java
++++ b/net/minecraft/world/level/IBlockAccess.java
+@@ -41,8 +41,8 @@
return BlockPosition.a(axisalignedbb).map(this::getType);
}
@@ -11,7 +11,7 @@
IBlockData iblockdata = this.getType(blockposition);
Fluid fluid = this.getFluid(blockposition);
Vec3D vec3d = raytrace1.b();
-@@ -45,6 +45,12 @@
+@@ -55,6 +55,12 @@
double d1 = movingobjectpositionblock1 == null ? Double.MAX_VALUE : raytrace1.b().distanceSquared(movingobjectpositionblock1.getPos());
return d0 <= d1 ? movingobjectpositionblock : movingobjectpositionblock1;
@@ -24,7 +24,7 @@
}, (raytrace1) -> {
Vec3D vec3d = raytrace1.b().d(raytrace1.a());
-@@ -120,7 +126,7 @@
+@@ -130,7 +136,7 @@
double d13 = d10 * (i1 > 0 ? 1.0D - MathHelper.h(d4) : MathHelper.h(d4));
double d14 = d11 * (j1 > 0 ? 1.0D - MathHelper.h(d5) : MathHelper.h(d5));
diff --git a/nms-patches/net/minecraft/world/level/IWorldWriter.patch b/nms-patches/net/minecraft/world/level/IWorldWriter.patch
index af2348e0f..dbd5bdf32 100644
--- a/nms-patches/net/minecraft/world/level/IWorldWriter.patch
+++ b/nms-patches/net/minecraft/world/level/IWorldWriter.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/IWorldWriter.java
-+++ b/net/minecraft/server/IWorldWriter.java
-@@ -25,4 +25,10 @@
+--- a/net/minecraft/world/level/IWorldWriter.java
++++ b/net/minecraft/world/level/IWorldWriter.java
+@@ -28,4 +28,10 @@
default boolean addEntity(Entity entity) {
return false;
}
diff --git a/nms-patches/net/minecraft/world/level/MobSpawnerAbstract.patch b/nms-patches/net/minecraft/world/level/MobSpawnerAbstract.patch
index 7f76c8bab..019f49758 100644
--- a/nms-patches/net/minecraft/world/level/MobSpawnerAbstract.patch
+++ b/nms-patches/net/minecraft/world/level/MobSpawnerAbstract.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/MobSpawnerAbstract.java
-+++ b/net/minecraft/server/MobSpawnerAbstract.java
-@@ -43,6 +43,7 @@
+--- a/net/minecraft/world/level/MobSpawnerAbstract.java
++++ b/net/minecraft/world/level/MobSpawnerAbstract.java
+@@ -60,6 +60,7 @@
public void setMobName(EntityTypes> entitytypes) {
this.spawnData.getEntity().setString("id", IRegistry.ENTITY_TYPE.getKey(entitytypes).toString());
@@ -8,7 +8,7 @@
}
private boolean h() {
-@@ -132,7 +133,7 @@
+@@ -149,7 +150,7 @@
}
}
diff --git a/nms-patches/net/minecraft/world/level/RayTrace.patch b/nms-patches/net/minecraft/world/level/RayTrace.patch
index 3afeb800c..81b83b7c7 100644
--- a/nms-patches/net/minecraft/world/level/RayTrace.patch
+++ b/nms-patches/net/minecraft/world/level/RayTrace.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/RayTrace.java
-+++ b/net/minecraft/server/RayTrace.java
-@@ -15,7 +15,7 @@
+--- a/net/minecraft/world/level/RayTrace.java
++++ b/net/minecraft/world/level/RayTrace.java
+@@ -24,7 +24,7 @@
this.b = vec3d1;
this.c = raytrace_blockcollisionoption;
this.d = raytrace_fluidcollisionoption;
@@ -9,7 +9,7 @@
}
public Vec3D a() {
-@@ -44,7 +44,7 @@
+@@ -53,7 +53,7 @@
private final Predicate predicate;
diff --git a/nms-patches/net/minecraft/world/level/SpawnerCreature.patch b/nms-patches/net/minecraft/world/level/SpawnerCreature.patch
index 6d9d50e0f..ff1af9c53 100644
--- a/nms-patches/net/minecraft/world/level/SpawnerCreature.patch
+++ b/nms-patches/net/minecraft/world/level/SpawnerCreature.patch
@@ -1,17 +1,18 @@
---- a/net/minecraft/server/SpawnerCreature.java
-+++ b/net/minecraft/server/SpawnerCreature.java
-@@ -13,6 +13,10 @@
+--- a/net/minecraft/world/level/SpawnerCreature.java
++++ b/net/minecraft/world/level/SpawnerCreature.java
+@@ -45,6 +45,11 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
++import net.minecraft.world.level.storage.WorldData;
+import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
+// CraftBukkit end
+
public final class SpawnerCreature {
private static final Logger LOGGER = LogManager.getLogger();
-@@ -34,7 +38,8 @@
+@@ -66,7 +71,8 @@
if (entity instanceof EntityInsentient) {
EntityInsentient entityinsentient = (EntityInsentient) entity;
@@ -21,7 +22,7 @@
continue;
}
}
-@@ -69,10 +74,49 @@
+@@ -101,10 +107,49 @@
EnumCreatureType[] aenumcreaturetype = SpawnerCreature.c;
int i = aenumcreaturetype.length;
@@ -72,7 +73,7 @@
a(enumcreaturetype, worldserver, chunk, (entitytypes, blockposition, ichunkaccess) -> {
return spawnercreature_d.a(entitytypes, blockposition, ichunkaccess);
}, (entityinsentient, ichunkaccess) -> {
-@@ -147,10 +191,14 @@
+@@ -179,10 +224,14 @@
entityinsentient.setPositionRotation(d0, (double) i, d1, worldserver.random.nextFloat() * 360.0F, 0.0F);
if (a(worldserver, entityinsentient, d2)) {
groupdataentity = entityinsentient.prepare(worldserver, worldserver.getDamageScaler(entityinsentient.getChunkCoordinates()), EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null);
@@ -91,7 +92,7 @@
if (j >= entityinsentient.getMaxSpawnGroup()) {
return;
}
-@@ -333,7 +381,7 @@
+@@ -365,7 +414,7 @@
if (entityinsentient.a((GeneratorAccess) worldaccess, EnumMobSpawn.CHUNK_GENERATION) && entityinsentient.a((IWorldReader) worldaccess)) {
groupdataentity = entityinsentient.prepare(worldaccess, worldaccess.getDamageScaler(entityinsentient.getChunkCoordinates()), EnumMobSpawn.CHUNK_GENERATION, groupdataentity, (NBTTagCompound) null);
@@ -100,7 +101,7 @@
flag = true;
}
}
-@@ -456,8 +504,10 @@
+@@ -488,8 +537,10 @@
return this.d;
}
diff --git a/nms-patches/net/minecraft/world/level/TickListServer.patch b/nms-patches/net/minecraft/world/level/TickListServer.patch
index 782c66465..3c4f08acd 100644
--- a/nms-patches/net/minecraft/world/level/TickListServer.patch
+++ b/nms-patches/net/minecraft/world/level/TickListServer.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/TickListServer.java
-+++ b/net/minecraft/server/TickListServer.java
-@@ -36,11 +36,17 @@
+--- a/net/minecraft/world/level/TickListServer.java
++++ b/net/minecraft/world/level/TickListServer.java
+@@ -48,11 +48,17 @@
public void b() {
int i = this.nextTickList.size();
@@ -20,7 +20,7 @@
}
ChunkProviderServer chunkproviderserver = this.e.getChunkProvider();
-@@ -79,7 +85,7 @@
+@@ -91,7 +97,7 @@
throw new ReportedException(crashreport);
}
} else {
diff --git a/nms-patches/net/minecraft/world/level/World.patch b/nms-patches/net/minecraft/world/level/World.patch
index 0553b4cd0..08f06d7d0 100644
--- a/nms-patches/net/minecraft/world/level/World.patch
+++ b/nms-patches/net/minecraft/world/level/World.patch
@@ -1,12 +1,16 @@
---- a/net/minecraft/server/World.java
-+++ b/net/minecraft/server/World.java
-@@ -14,6 +14,17 @@
+--- a/net/minecraft/world/level/World.java
++++ b/net/minecraft/world/level/World.java
+@@ -62,6 +62,21 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import java.util.HashMap;
+import java.util.Map;
++import net.minecraft.network.protocol.game.PacketPlayOutWorldBorder;
++import net.minecraft.server.level.WorldServer;
++import net.minecraft.world.entity.item.EntityItem;
++import net.minecraft.world.level.border.IWorldBorderListener;
+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.craftbukkit.CraftWorld;
@@ -18,7 +22,7 @@
public abstract class World implements GeneratorAccess, AutoCloseable {
protected static final Logger LOGGER = LogManager.getLogger();
-@@ -45,7 +56,49 @@
+@@ -93,7 +108,49 @@
private final BiomeManager biomeManager;
private final ResourceKey dimensionKey;
@@ -69,7 +73,7 @@
this.methodProfiler = supplier;
this.worldData = worlddatamutable;
this.x = dimensionmanager;
-@@ -55,12 +108,12 @@
+@@ -103,12 +160,12 @@
this.worldBorder = new WorldBorder() {
@Override
public double getCenterX() {
@@ -84,7 +88,7 @@
}
};
} else {
-@@ -70,6 +123,35 @@
+@@ -118,6 +175,35 @@
this.serverThread = Thread.currentThread();
this.biomeManager = new BiomeManager(this, i, dimensionmanager.getGenLayerZoomer());
this.debugWorld = flag1;
@@ -120,7 +124,7 @@
}
@Override
-@@ -133,6 +215,17 @@
+@@ -181,6 +267,17 @@
@Override
public boolean a(BlockPosition blockposition, IBlockData iblockdata, int i, int j) {
@@ -138,7 +142,7 @@
if (isOutsideWorld(blockposition)) {
return false;
} else if (!this.isClientSide && this.isDebugWorld()) {
-@@ -140,9 +233,24 @@
+@@ -188,9 +285,24 @@
} else {
Chunk chunk = this.getChunkAtWorldCoords(blockposition);
Block block = iblockdata.getBlock();
@@ -164,7 +168,7 @@
return false;
} else {
IBlockData iblockdata2 = this.getType(blockposition);
-@@ -153,6 +261,7 @@
+@@ -201,6 +313,7 @@
this.getMethodProfiler().exit();
}
@@ -172,7 +176,7 @@
if (iblockdata2 == iblockdata) {
if (iblockdata1 != iblockdata2) {
this.b(blockposition, iblockdata1, iblockdata2);
-@@ -179,12 +288,65 @@
+@@ -227,12 +340,65 @@
this.a(blockposition, iblockdata1, iblockdata2);
}
@@ -238,7 +242,7 @@
public void a(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
@Override
-@@ -266,6 +428,17 @@
+@@ -314,6 +480,17 @@
IBlockData iblockdata = this.getType(blockposition);
try {
@@ -256,7 +260,7 @@
iblockdata.doPhysics(this, blockposition, block, blockposition1, false);
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Exception while updating neighbours");
-@@ -308,6 +481,14 @@
+@@ -356,6 +533,14 @@
@Override
public IBlockData getType(BlockPosition blockposition) {
@@ -271,7 +275,7 @@
if (isOutsideWorld(blockposition)) {
return Blocks.VOID_AIR.getBlockData();
} else {
-@@ -455,9 +636,11 @@
+@@ -503,9 +688,11 @@
TileEntity tileentity1 = (TileEntity) this.tileEntityListPending.get(i);
if (!tileentity1.isRemoved()) {
@@ -283,7 +287,7 @@
if (this.isLoaded(tileentity1.getPosition())) {
Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition());
-@@ -465,6 +648,12 @@
+@@ -513,6 +700,12 @@
chunk.setTileEntity(tileentity1.getPosition(), tileentity1);
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
@@ -296,7 +300,7 @@
}
}
}
-@@ -509,12 +698,25 @@
+@@ -557,12 +750,25 @@
@Nullable
@Override
@@ -306,7 +310,7 @@
+ }
+
+ @Nullable
-+ protected TileEntity getTileEntity(BlockPosition blockposition, boolean validate) {
++ public TileEntity getTileEntity(BlockPosition blockposition, boolean validate) {
+ // CraftBukkit end
if (isOutsideWorld(blockposition)) {
return null;
@@ -322,7 +326,7 @@
TileEntity tileentity = null;
if (this.tickingTileEntities) {
-@@ -549,6 +751,13 @@
+@@ -597,6 +803,13 @@
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
if (!isOutsideWorld(blockposition)) {
if (tileentity != null && !tileentity.isRemoved()) {
@@ -336,7 +340,7 @@
if (this.tickingTileEntities) {
tileentity.setLocation(this, blockposition);
Iterator iterator = this.tileEntityListPending.iterator();
-@@ -573,7 +782,7 @@
+@@ -621,7 +834,7 @@
}
public void removeTileEntity(BlockPosition blockposition) {
diff --git a/nms-patches/net/minecraft/world/level/WorldAccess.patch b/nms-patches/net/minecraft/world/level/WorldAccess.patch
index b3f75a9a5..aadedfa99 100644
--- a/nms-patches/net/minecraft/world/level/WorldAccess.patch
+++ b/nms-patches/net/minecraft/world/level/WorldAccess.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/WorldAccess.java
-+++ b/net/minecraft/server/WorldAccess.java
-@@ -5,6 +5,12 @@
+--- a/net/minecraft/world/level/WorldAccess.java
++++ b/net/minecraft/world/level/WorldAccess.java
+@@ -8,6 +8,12 @@
WorldServer getMinecraftWorld();
default void addAllEntities(Entity entity) {
diff --git a/nms-patches/net/minecraft/world/level/block/Block.patch b/nms-patches/net/minecraft/world/level/block/Block.patch
index 9c455095d..fbe12a0f6 100644
--- a/nms-patches/net/minecraft/world/level/block/Block.patch
+++ b/nms-patches/net/minecraft/world/level/block/Block.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/Block.java
-+++ b/net/minecraft/server/Block.java
-@@ -209,7 +209,13 @@
+--- a/net/minecraft/world/level/block/Block.java
++++ b/net/minecraft/world/level/block/Block.java
+@@ -248,7 +248,13 @@
EntityItem entityitem = new EntityItem(world, (double) blockposition.getX() + d0, (double) blockposition.getY() + d1, (double) blockposition.getZ() + d2, itemstack);
entityitem.defaultPickupDelay();
@@ -15,7 +15,7 @@
}
}
-@@ -240,7 +246,7 @@
+@@ -279,7 +285,7 @@
public void a(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, ItemStack itemstack) {
entityhuman.b(StatisticList.BLOCK_MINED.b(this));
@@ -24,7 +24,7 @@
dropItems(iblockdata, world, blockposition, tileentity, entityhuman, itemstack);
}
-@@ -336,6 +342,12 @@
+@@ -375,6 +381,12 @@
return this;
}
diff --git a/nms-patches/net/minecraft/world/level/block/BlockBamboo.patch b/nms-patches/net/minecraft/world/level/block/BlockBamboo.patch
index af220d3a5..8df53fccd 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockBamboo.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockBamboo.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockBamboo.java
-+++ b/net/minecraft/server/BlockBamboo.java
-@@ -170,14 +170,18 @@
+--- a/net/minecraft/world/level/block/BlockBamboo.java
++++ b/net/minecraft/world/level/block/BlockBamboo.java
+@@ -195,14 +195,18 @@
BlockPosition blockposition1 = blockposition.down(2);
IBlockData iblockdata2 = world.getType(blockposition1);
BlockPropertyBambooSize blockpropertybamboosize = BlockPropertyBambooSize.NONE;
@@ -21,7 +21,7 @@
}
}
} else {
-@@ -188,7 +192,14 @@
+@@ -213,7 +217,14 @@
int j = (Integer) iblockdata.get(BlockBamboo.d) != 1 && !iblockdata2.a(Blocks.BAMBOO) ? 0 : 1;
int k = (i < 11 || random.nextFloat() >= 0.25F) && i != 15 ? 0 : 1;
diff --git a/nms-patches/net/minecraft/world/level/block/BlockBambooSapling.patch b/nms-patches/net/minecraft/world/level/block/BlockBambooSapling.patch
index 675272f11..6b36c0b07 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockBambooSapling.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockBambooSapling.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockBambooSapling.java
-+++ b/net/minecraft/server/BlockBambooSapling.java
-@@ -69,6 +69,6 @@
+--- a/net/minecraft/world/level/block/BlockBambooSapling.java
++++ b/net/minecraft/world/level/block/BlockBambooSapling.java
+@@ -86,6 +86,6 @@
}
protected void a(World world, BlockPosition blockposition) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockBed.patch b/nms-patches/net/minecraft/world/level/block/BlockBed.patch
index 9b349be8b..37b882839 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockBed.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockBed.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockBed.java
-+++ b/net/minecraft/server/BlockBed.java
-@@ -39,7 +39,8 @@
+--- a/net/minecraft/world/level/block/BlockBed.java
++++ b/net/minecraft/world/level/block/BlockBed.java
+@@ -78,7 +78,8 @@
}
}
@@ -10,7 +10,7 @@
world.a(blockposition, false);
BlockPosition blockposition1 = blockposition.shift(((EnumDirection) iblockdata.get(BlockBed.FACING)).opposite());
-@@ -56,7 +57,16 @@
+@@ -95,7 +96,16 @@
return EnumInteractionResult.SUCCESS;
} else {
@@ -27,7 +27,7 @@
if (entityhuman_enumbedresult != null) {
entityhuman.a(entityhuman_enumbedresult.a(), true);
}
-@@ -67,8 +77,27 @@
+@@ -106,8 +116,27 @@
}
}
diff --git a/nms-patches/net/minecraft/world/level/block/BlockBeehive.patch b/nms-patches/net/minecraft/world/level/block/BlockBeehive.patch
index 63532d638..ef95ba6ea 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockBeehive.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockBeehive.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockBeehive.java
-+++ b/net/minecraft/server/BlockBeehive.java
-@@ -55,7 +55,7 @@
+--- a/net/minecraft/world/level/block/BlockBeehive.java
++++ b/net/minecraft/world/level/block/BlockBeehive.java
+@@ -97,7 +97,7 @@
EntityBee entitybee = (EntityBee) iterator.next();
if (entitybee.getGoalTarget() == null) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockButtonAbstract.patch b/nms-patches/net/minecraft/world/level/block/BlockButtonAbstract.patch
index 4a5c6abd6..0ef1b4f20 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockButtonAbstract.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockButtonAbstract.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BlockButtonAbstract.java
-+++ b/net/minecraft/server/BlockButtonAbstract.java
-@@ -4,6 +4,11 @@
- import java.util.Random;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/BlockButtonAbstract.java
++++ b/net/minecraft/world/level/block/BlockButtonAbstract.java
+@@ -26,6 +26,11 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
+import org.bukkit.event.block.BlockRedstoneEvent;
@@ -12,7 +12,7 @@
public abstract class BlockButtonAbstract extends BlockAttachable {
public static final BlockStateBoolean POWERED = BlockProperties.w;
-@@ -70,6 +75,19 @@
+@@ -92,6 +97,19 @@
if ((Boolean) iblockdata.get(BlockButtonAbstract.POWERED)) {
return EnumInteractionResult.CONSUME;
} else {
@@ -32,7 +32,7 @@
this.d(iblockdata, world, blockposition);
this.a(entityhuman, world, blockposition, true);
return EnumInteractionResult.a(world.isClientSide);
-@@ -120,6 +138,16 @@
+@@ -142,6 +160,16 @@
if (this.v) {
this.e(iblockdata, (World) worldserver, blockposition);
} else {
@@ -49,7 +49,7 @@
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockButtonAbstract.POWERED, false), 3);
this.f(iblockdata, (World) worldserver, blockposition);
this.a((EntityHuman) null, worldserver, blockposition, false);
-@@ -140,7 +168,44 @@
+@@ -162,7 +190,44 @@
boolean flag = !list.isEmpty();
boolean flag1 = (Boolean) iblockdata.get(BlockButtonAbstract.POWERED);
diff --git a/nms-patches/net/minecraft/world/level/block/BlockCactus.patch b/nms-patches/net/minecraft/world/level/block/BlockCactus.patch
index 462566bbd..d1cae0e5a 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockCactus.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockCactus.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockCactus.java
-+++ b/net/minecraft/server/BlockCactus.java
-@@ -3,6 +3,8 @@
- import java.util.Iterator;
- import java.util.Random;
+--- a/net/minecraft/world/level/block/BlockCactus.java
++++ b/net/minecraft/world/level/block/BlockCactus.java
+@@ -23,6 +23,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockCactus extends Block {
public static final BlockStateInteger AGE = BlockProperties.aj;
-@@ -37,7 +39,7 @@
+@@ -57,7 +59,7 @@
int j = (Integer) iblockdata.get(BlockCactus.AGE);
if (j == 15) {
@@ -18,7 +18,7 @@
IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockCactus.AGE, 0);
worldserver.setTypeAndData(blockposition, iblockdata1, 4);
-@@ -94,7 +96,9 @@
+@@ -114,7 +116,9 @@
@Override
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockCake.patch b/nms-patches/net/minecraft/world/level/block/BlockCake.patch
index 3241a6ba9..9fdae4f3d 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockCake.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockCake.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockCake.java
-+++ b/net/minecraft/server/BlockCake.java
-@@ -37,7 +37,18 @@
+--- a/net/minecraft/world/level/block/BlockCake.java
++++ b/net/minecraft/world/level/block/BlockCake.java
+@@ -58,7 +58,18 @@
return EnumInteractionResult.PASS;
} else {
entityhuman.a(StatisticList.EAT_CAKE_SLICE);
@@ -15,7 +15,7 @@
+ entityhuman.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, 0.1F);
+ }
+
-+ ((EntityPlayer) entityhuman).getBukkitEntity().sendHealthUpdate();
++ ((net.minecraft.server.level.EntityPlayer) entityhuman).getBukkitEntity().sendHealthUpdate();
+ // CraftBukkit end
int i = (Integer) iblockdata.get(BlockCake.BITES);
diff --git a/nms-patches/net/minecraft/world/level/block/BlockCampfire.patch b/nms-patches/net/minecraft/world/level/block/BlockCampfire.patch
index eaf134b9f..d643964cf 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockCampfire.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockCampfire.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockCampfire.java
-+++ b/net/minecraft/server/BlockCampfire.java
-@@ -144,6 +144,11 @@
+--- a/net/minecraft/world/level/block/BlockCampfire.java
++++ b/net/minecraft/world/level/block/BlockCampfire.java
+@@ -186,6 +186,11 @@
if (flag && !(Boolean) iblockdata.get(BlockCampfire.LIT) && !(Boolean) iblockdata.get(BlockCampfire.d)) {
BlockPosition blockposition = movingobjectpositionblock.getBlockPosition();
diff --git a/nms-patches/net/minecraft/world/level/block/BlockCauldron.patch b/nms-patches/net/minecraft/world/level/block/BlockCauldron.patch
index 5753283a5..32e66f3f0 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockCauldron.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockCauldron.patch
@@ -1,14 +1,15 @@
---- a/net/minecraft/server/BlockCauldron.java
-+++ b/net/minecraft/server/BlockCauldron.java
-@@ -1,5 +1,7 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/level/block/BlockCauldron.java
++++ b/net/minecraft/world/level/block/BlockCauldron.java
+@@ -34,6 +34,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+ import net.minecraft.world.phys.shapes.VoxelShapes;
+import org.bukkit.event.block.CauldronLevelChangeEvent; // CraftBukkit
+
public class BlockCauldron extends Block {
public static final BlockStateInteger LEVEL = BlockProperties.ar;
-@@ -27,8 +29,13 @@
+@@ -61,8 +63,13 @@
float f = (float) blockposition.getY() + (6.0F + (float) (3 * i)) / 16.0F;
if (!world.isClientSide && entity.isBurning() && i > 0 && entity.locY() <= (double) f) {
@@ -23,7 +24,7 @@
}
}
-@@ -45,18 +52,27 @@
+@@ -79,18 +86,27 @@
if (item == Items.WATER_BUCKET) {
if (i < 3 && !world.isClientSide) {
@@ -52,7 +53,7 @@
if (!entityhuman.abilities.canInstantlyBuild) {
itemstack.subtract(1);
if (itemstack.isEmpty()) {
-@@ -67,7 +83,8 @@
+@@ -101,7 +117,8 @@
}
entityhuman.a(StatisticList.USE_CAULDRON);
@@ -62,7 +63,7 @@
world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BUCKET_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
}
-@@ -77,6 +94,10 @@
+@@ -111,6 +128,10 @@
if (item == Items.GLASS_BOTTLE) {
if (i > 0 && !world.isClientSide) {
@@ -73,7 +74,7 @@
if (!entityhuman.abilities.canInstantlyBuild) {
itemstack1 = PotionUtil.a(new ItemStack(Items.POTION), Potions.WATER);
entityhuman.a(StatisticList.USE_CAULDRON);
-@@ -91,12 +112,17 @@
+@@ -125,12 +146,17 @@
}
world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BOTTLE_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
@@ -92,7 +93,7 @@
if (!entityhuman.abilities.canInstantlyBuild) {
itemstack1 = new ItemStack(Items.GLASS_BOTTLE);
entityhuman.a(StatisticList.USE_CAULDRON);
-@@ -107,7 +133,8 @@
+@@ -141,7 +167,8 @@
}
world.playSound((EntityHuman) null, blockposition, SoundEffects.ITEM_BOTTLE_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F);
@@ -102,7 +103,7 @@
}
return EnumInteractionResult.a(world.isClientSide);
-@@ -116,8 +143,13 @@
+@@ -150,8 +177,13 @@
IDyeable idyeable = (IDyeable) item;
if (idyeable.a(itemstack) && !world.isClientSide) {
@@ -117,7 +118,7 @@
entityhuman.a(StatisticList.CLEAN_ARMOR);
return EnumInteractionResult.SUCCESS;
}
-@@ -125,13 +157,18 @@
+@@ -159,13 +191,18 @@
if (i > 0 && item instanceof ItemBanner) {
if (TileEntityBanner.b(itemstack) > 0 && !world.isClientSide) {
@@ -137,7 +138,7 @@
}
if (itemstack.isEmpty()) {
-@@ -169,9 +206,25 @@
+@@ -203,9 +240,25 @@
}
}
@@ -164,7 +165,7 @@
}
@Override
-@@ -183,7 +236,7 @@
+@@ -217,7 +270,7 @@
IBlockData iblockdata = world.getType(blockposition);
if ((Integer) iblockdata.get(BlockCauldron.LEVEL) < 3) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockChest.patch b/nms-patches/net/minecraft/world/level/block/BlockChest.patch
index cb10e7948..52364050e 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockChest.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockChest.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockChest.java
-+++ b/net/minecraft/server/BlockChest.java
-@@ -35,24 +35,7 @@
+--- a/net/minecraft/world/level/block/BlockChest.java
++++ b/net/minecraft/world/level/block/BlockChest.java
+@@ -79,24 +79,7 @@
public Optional a(final TileEntityChest tileentitychest, final TileEntityChest tileentitychest1) {
final InventoryLargeChest inventorylargechest = new InventoryLargeChest(tileentitychest, tileentitychest1);
@@ -26,7 +26,7 @@
}
public Optional a(TileEntityChest tileentitychest) {
-@@ -65,6 +48,38 @@
+@@ -109,6 +92,38 @@
}
};
@@ -65,7 +65,7 @@
protected BlockChest(BlockBase.Info blockbase_info, Supplier> supplier) {
super(blockbase_info, supplier);
this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockChest.FACING, EnumDirection.NORTH)).set(BlockChest.c, BlockPropertyChestType.SINGLE)).set(BlockChest.d, false));
-@@ -218,7 +233,7 @@
+@@ -262,7 +277,7 @@
}
public DoubleBlockFinder.Result extends TileEntityChest> a(IBlockData iblockdata, World world, BlockPosition blockposition, boolean flag) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockChorusFlower.patch b/nms-patches/net/minecraft/world/level/block/BlockChorusFlower.patch
index 4ca36ec16..2064a4547 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockChorusFlower.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockChorusFlower.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockChorusFlower.java
-+++ b/net/minecraft/server/BlockChorusFlower.java
-@@ -4,6 +4,8 @@
- import java.util.Random;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/BlockChorusFlower.java
++++ b/net/minecraft/world/level/block/BlockChorusFlower.java
+@@ -20,6 +20,8 @@
+ import net.minecraft.world.level.block.state.properties.BlockStateInteger;
+ import net.minecraft.world.phys.MovingObjectPositionBlock;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockChorusFlower extends Block {
public static final BlockStateInteger AGE = BlockProperties.ah;
-@@ -68,8 +70,12 @@
+@@ -84,8 +86,12 @@
}
if (flag && b((IWorldReader) worldserver, blockposition1, (EnumDirection) null) && worldserver.isEmpty(blockposition.up(2))) {
@@ -24,7 +24,7 @@
} else if (i < 4) {
j = random.nextInt(4);
if (flag1) {
-@@ -83,18 +89,30 @@
+@@ -99,18 +105,30 @@
BlockPosition blockposition2 = blockposition.shift(enumdirection);
if (worldserver.isEmpty(blockposition2) && worldserver.isEmpty(blockposition2.down()) && b((IWorldReader) worldserver, blockposition2, enumdirection.opposite())) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockCocoa.patch b/nms-patches/net/minecraft/world/level/block/BlockCocoa.patch
index e6c02c1d3..eeeebbf89 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockCocoa.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockCocoa.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockCocoa.java
-+++ b/net/minecraft/server/BlockCocoa.java
-@@ -3,6 +3,8 @@
- import java.util.Random;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/BlockCocoa.java
++++ b/net/minecraft/world/level/block/BlockCocoa.java
+@@ -21,6 +21,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockCocoa extends BlockFacingHorizontal implements IBlockFragilePlantElement {
public static final BlockStateInteger AGE = BlockProperties.af;
-@@ -27,7 +29,7 @@
+@@ -45,7 +47,7 @@
int i = (Integer) iblockdata.get(BlockCocoa.AGE);
if (i < 2) {
@@ -18,7 +18,7 @@
}
}
-@@ -97,7 +99,7 @@
+@@ -115,7 +117,7 @@
@Override
public void a(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockCommand.patch b/nms-patches/net/minecraft/world/level/block/BlockCommand.patch
index 1f53b56bb..c3ce8f364 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockCommand.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockCommand.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockCommand.java
-+++ b/net/minecraft/server/BlockCommand.java
-@@ -4,6 +4,8 @@
+--- a/net/minecraft/world/level/block/BlockCommand.java
++++ b/net/minecraft/world/level/block/BlockCommand.java
+@@ -27,6 +27,8 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -9,7 +9,7 @@
public class BlockCommand extends BlockTileEntity {
private static final Logger LOGGER = LogManager.getLogger();
-@@ -32,6 +34,15 @@
+@@ -55,6 +57,15 @@
TileEntityCommand tileentitycommand = (TileEntityCommand) tileentity;
boolean flag1 = world.isBlockIndirectlyPowered(blockposition);
boolean flag2 = tileentitycommand.f();
diff --git a/nms-patches/net/minecraft/world/level/block/BlockComposter.patch b/nms-patches/net/minecraft/world/level/block/BlockComposter.patch
index be3e31a1e..f9f6c311f 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockComposter.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockComposter.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/BlockComposter.java
-+++ b/net/minecraft/server/BlockComposter.java
-@@ -5,12 +5,17 @@
- import java.util.Random;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/BlockComposter.java
++++ b/net/minecraft/world/level/block/BlockComposter.java
+@@ -36,12 +36,18 @@
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+ import net.minecraft.world.phys.shapes.VoxelShapes;
+// CraftBukkit start
++import net.minecraft.world.entity.Entity;
+import org.bukkit.craftbukkit.inventory.CraftBlockInventoryHolder;
+import org.bukkit.craftbukkit.util.DummyGeneratorAccess;
+// CraftBukkit end
@@ -19,7 +20,7 @@
for (int i = 0; i < 8; ++i) {
avoxelshape[i] = VoxelShapes.a(BlockComposter.c, Block.a(2.0D, (double) Math.max(2, 1 + i * 2), 2.0D, 14.0D, 16.0D, 14.0D), OperatorBoolean.ONLY_FIRST);
}
-@@ -156,18 +161,25 @@
+@@ -187,18 +193,25 @@
return EnumInteractionResult.a(world.isClientSide);
} else if (i == 8) {
@@ -48,7 +49,7 @@
itemstack.subtract(1);
return iblockdata1;
-@@ -176,7 +188,15 @@
+@@ -207,7 +220,15 @@
}
}
@@ -65,7 +66,7 @@
if (!world.isClientSide) {
float f = 0.7F;
double d0 = (double) (world.random.nextFloat() * 0.7F) + 0.15000000596046448D;
-@@ -202,10 +222,16 @@
+@@ -233,10 +254,16 @@
}
private static IBlockData b(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, ItemStack itemstack) {
@@ -83,7 +84,7 @@
return iblockdata;
} else {
int j = i + 1;
-@@ -253,7 +279,8 @@
+@@ -284,7 +311,8 @@
public IWorldInventory a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
int i = (Integer) iblockdata.get(BlockComposter.a);
@@ -93,7 +94,7 @@
}
static class ContainerInput extends InventorySubcontainer implements IWorldInventory {
-@@ -265,6 +292,7 @@
+@@ -296,6 +324,7 @@
public ContainerInput(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
super(1);
@@ -101,7 +102,7 @@
this.a = iblockdata;
this.b = generatoraccess;
this.c = blockposition;
-@@ -317,6 +345,7 @@
+@@ -348,6 +377,7 @@
this.blockData = iblockdata;
this.generatorAccess = generatoraccess;
this.blockPosition = blockposition;
@@ -109,7 +110,7 @@
}
@Override
-@@ -341,15 +370,23 @@
+@@ -372,15 +402,23 @@
@Override
public void update() {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockConcretePowder.patch b/nms-patches/net/minecraft/world/level/block/BlockConcretePowder.patch
index 802db9bdd..1da36e4f4 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockConcretePowder.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockConcretePowder.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/BlockConcretePowder.java
-+++ b/net/minecraft/server/BlockConcretePowder.java
-@@ -1,5 +1,10 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/level/block/BlockConcretePowder.java
++++ b/net/minecraft/world/level/block/BlockConcretePowder.java
+@@ -13,6 +13,11 @@
+ import net.minecraft.world.level.block.state.BlockBase;
+ import net.minecraft.world.level.block.state.IBlockData;
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlockState;
@@ -11,7 +12,7 @@
public class BlockConcretePowder extends BlockFalling {
private final IBlockData a;
-@@ -12,7 +17,7 @@
+@@ -25,7 +30,7 @@
@Override
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1, EntityFallingBlock entityfallingblock) {
if (canHarden(world, blockposition, iblockdata1)) {
@@ -20,7 +21,7 @@
}
}
-@@ -23,7 +28,24 @@
+@@ -36,7 +41,24 @@
BlockPosition blockposition = blockactioncontext.getClickPosition();
IBlockData iblockdata = world.getType(blockposition);
@@ -46,7 +47,7 @@
}
private static boolean canHarden(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata) {
-@@ -59,6 +81,24 @@
+@@ -72,6 +94,24 @@
@Override
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockCoral.patch b/nms-patches/net/minecraft/world/level/block/BlockCoral.patch
index b9e4ae958..6a1a5843f 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockCoral.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockCoral.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockCoral.java
-+++ b/net/minecraft/server/BlockCoral.java
-@@ -15,6 +15,11 @@
+--- a/net/minecraft/world/level/block/BlockCoral.java
++++ b/net/minecraft/world/level/block/BlockCoral.java
+@@ -26,6 +26,11 @@
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!this.a((IBlockAccess) worldserver, blockposition)) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockCoralFan.patch b/nms-patches/net/minecraft/world/level/block/BlockCoralFan.patch
index 882f91fa3..61a602827 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockCoralFan.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockCoralFan.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockCoralFan.java
-+++ b/net/minecraft/server/BlockCoralFan.java
-@@ -19,6 +19,11 @@
+--- a/net/minecraft/world/level/block/BlockCoralFan.java
++++ b/net/minecraft/world/level/block/BlockCoralFan.java
+@@ -29,6 +29,11 @@
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!c(iblockdata, (IBlockAccess) worldserver, blockposition)) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockCoralFanWall.patch b/nms-patches/net/minecraft/world/level/block/BlockCoralFanWall.patch
index b751a4e46..fe8f568e4 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockCoralFanWall.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockCoralFanWall.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockCoralFanWall.java
-+++ b/net/minecraft/server/BlockCoralFanWall.java
-@@ -19,6 +19,11 @@
+--- a/net/minecraft/world/level/block/BlockCoralFanWall.java
++++ b/net/minecraft/world/level/block/BlockCoralFanWall.java
+@@ -29,6 +29,11 @@
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!c(iblockdata, (IBlockAccess) worldserver, blockposition)) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockCoralPlant.patch b/nms-patches/net/minecraft/world/level/block/BlockCoralPlant.patch
index 2845853b5..f5c84b508 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockCoralPlant.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockCoralPlant.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockCoralPlant.java
-+++ b/net/minecraft/server/BlockCoralPlant.java
-@@ -20,6 +20,11 @@
+--- a/net/minecraft/world/level/block/BlockCoralPlant.java
++++ b/net/minecraft/world/level/block/BlockCoralPlant.java
+@@ -32,6 +32,11 @@
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!c(iblockdata, (IBlockAccess) worldserver, blockposition)) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockCrops.patch b/nms-patches/net/minecraft/world/level/block/BlockCrops.patch
index 5e8e9eb62..1cc918121 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockCrops.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockCrops.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockCrops.java
-+++ b/net/minecraft/server/BlockCrops.java
-@@ -2,6 +2,8 @@
-
- import java.util.Random;
+--- a/net/minecraft/world/level/block/BlockCrops.java
++++ b/net/minecraft/world/level/block/BlockCrops.java
+@@ -18,6 +18,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement {
public static final BlockStateInteger AGE = BlockProperties.ai;
-@@ -56,7 +58,7 @@
+@@ -72,7 +74,7 @@
float f = a((Block) this, (IBlockAccess) worldserver, blockposition);
if (random.nextInt((int) (25.0F / f) + 1) == 0) {
@@ -18,7 +18,7 @@
}
}
}
-@@ -71,7 +73,7 @@
+@@ -87,7 +89,7 @@
i = j;
}
@@ -27,7 +27,7 @@
}
protected int a(World world) {
-@@ -129,7 +131,7 @@
+@@ -145,7 +147,7 @@
@Override
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockDaylightDetector.patch b/nms-patches/net/minecraft/world/level/block/BlockDaylightDetector.patch
index a1263c21d..32e5a8226 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockDaylightDetector.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockDaylightDetector.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockDaylightDetector.java
-+++ b/net/minecraft/server/BlockDaylightDetector.java
-@@ -43,6 +43,7 @@
+--- a/net/minecraft/world/level/block/BlockDaylightDetector.java
++++ b/net/minecraft/world/level/block/BlockDaylightDetector.java
+@@ -65,6 +65,7 @@
i = MathHelper.clamp(i, 0, 15);
if ((Integer) iblockdata.get(BlockDaylightDetector.POWER) != i) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockDiodeAbstract.patch b/nms-patches/net/minecraft/world/level/block/BlockDiodeAbstract.patch
index 7be1c166b..5296f6030 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockDiodeAbstract.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockDiodeAbstract.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockDiodeAbstract.java
-+++ b/net/minecraft/server/BlockDiodeAbstract.java
-@@ -2,6 +2,8 @@
-
- import java.util.Random;
+--- a/net/minecraft/world/level/block/BlockDiodeAbstract.java
++++ b/net/minecraft/world/level/block/BlockDiodeAbstract.java
+@@ -20,6 +20,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public abstract class BlockDiodeAbstract extends BlockFacingHorizontal {
protected static final VoxelShape b = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D);
-@@ -28,8 +30,18 @@
+@@ -46,8 +48,18 @@
boolean flag1 = this.a((World) worldserver, blockposition, iblockdata);
if (flag && !flag1) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockDirtSnowSpreadable.patch b/nms-patches/net/minecraft/world/level/block/BlockDirtSnowSpreadable.patch
index 38dd7143d..1d6fc7b17 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockDirtSnowSpreadable.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockDirtSnowSpreadable.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockDirtSnowSpreadable.java
-+++ b/net/minecraft/server/BlockDirtSnowSpreadable.java
-@@ -32,6 +32,11 @@
+--- a/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
++++ b/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
+@@ -42,6 +42,11 @@
@Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!b(iblockdata, (IWorldReader) worldserver, blockposition)) {
@@ -12,7 +12,7 @@
worldserver.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData());
} else {
if (worldserver.getLightLevel(blockposition.up()) >= 9) {
-@@ -41,7 +46,7 @@
+@@ -51,7 +56,7 @@
BlockPosition blockposition1 = blockposition.b(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
if (worldserver.getType(blockposition1).a(Blocks.DIRT) && c(iblockdata1, (IWorldReader) worldserver, blockposition1)) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockDispenser.patch b/nms-patches/net/minecraft/world/level/block/BlockDispenser.patch
index 196408b0e..db9105998 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockDispenser.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockDispenser.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockDispenser.java
-+++ b/net/minecraft/server/BlockDispenser.java
-@@ -8,9 +8,10 @@
+--- a/net/minecraft/world/level/block/BlockDispenser.java
++++ b/net/minecraft/world/level/block/BlockDispenser.java
+@@ -41,9 +41,10 @@
public static final BlockStateDirection FACING = BlockDirectional.FACING;
public static final BlockStateBoolean TRIGGERED = BlockProperties.A;
@@ -12,7 +12,7 @@
public static void a(IMaterial imaterial, IDispenseBehavior idispensebehavior) {
BlockDispenser.REGISTRY.put(imaterial.getItem(), idispensebehavior);
-@@ -53,6 +54,7 @@
+@@ -86,6 +87,7 @@
IDispenseBehavior idispensebehavior = this.a(itemstack);
if (idispensebehavior != IDispenseBehavior.NONE) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockDoor.patch b/nms-patches/net/minecraft/world/level/block/BlockDoor.patch
index 7e29c5cff..183d8b275 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockDoor.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockDoor.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockDoor.java
-+++ b/net/minecraft/server/BlockDoor.java
-@@ -2,6 +2,8 @@
-
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/BlockDoor.java
++++ b/net/minecraft/world/level/block/BlockDoor.java
+@@ -31,6 +31,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockDoor extends Block {
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
-@@ -157,9 +159,24 @@
+@@ -186,9 +188,24 @@
@Override
public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockDragonEgg.patch b/nms-patches/net/minecraft/world/level/block/BlockDragonEgg.patch
index 5cfda88ff..ed2fb2ce0 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockDragonEgg.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockDragonEgg.patch
@@ -1,14 +1,15 @@
---- a/net/minecraft/server/BlockDragonEgg.java
-+++ b/net/minecraft/server/BlockDragonEgg.java
-@@ -1,5 +1,7 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/level/block/BlockDragonEgg.java
++++ b/net/minecraft/world/level/block/BlockDragonEgg.java
+@@ -15,6 +15,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.event.block.BlockFromToEvent; // CraftBukkit
+
public class BlockDragonEgg extends BlockFalling {
protected static final VoxelShape a = Block.a(1.0D, 0.0D, 1.0D, 15.0D, 16.0D, 15.0D);
-@@ -29,6 +31,18 @@
+@@ -44,6 +46,18 @@
BlockPosition blockposition1 = blockposition.b(world.random.nextInt(16) - world.random.nextInt(16), world.random.nextInt(8) - world.random.nextInt(8), world.random.nextInt(16) - world.random.nextInt(16));
if (world.getType(blockposition1).isAir()) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockDropper.patch b/nms-patches/net/minecraft/world/level/block/BlockDropper.patch
index b29190759..d0bb1f438 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockDropper.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockDropper.patch
@@ -1,9 +1,11 @@
---- a/net/minecraft/server/BlockDropper.java
-+++ b/net/minecraft/server/BlockDropper.java
-@@ -1,5 +1,10 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/level/block/BlockDropper.java
++++ b/net/minecraft/world/level/block/BlockDropper.java
+@@ -16,6 +16,12 @@
+ import net.minecraft.world.level.block.entity.TileEntityHopper;
+ import net.minecraft.world.level.block.state.BlockBase;
+// CraftBukkit start
++import net.minecraft.world.InventoryLargeChest;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.event.inventory.InventoryMoveItemEvent;
+// CraftBukkit end
@@ -11,7 +13,7 @@
public class BlockDropper extends BlockDispenser {
private static final IDispenseBehavior c = new DispenseBehaviorItem();
-@@ -37,8 +42,25 @@
+@@ -53,8 +59,25 @@
if (iinventory == null) {
itemstack1 = BlockDropper.c.dispense(sourceblock, itemstack);
} else {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockEnderPortal.patch b/nms-patches/net/minecraft/world/level/block/BlockEnderPortal.patch
index 3ec8cf18c..8856533be 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockEnderPortal.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockEnderPortal.patch
@@ -1,9 +1,12 @@
---- a/net/minecraft/server/BlockEnderPortal.java
-+++ b/net/minecraft/server/BlockEnderPortal.java
-@@ -1,5 +1,10 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/level/block/BlockEnderPortal.java
++++ b/net/minecraft/world/level/block/BlockEnderPortal.java
+@@ -16,6 +16,13 @@
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+ import net.minecraft.world.phys.shapes.VoxelShapes;
+// CraftBukkit start
++import net.minecraft.server.level.EntityPlayer;
++import net.minecraft.world.level.dimension.DimensionManager;
+import org.bukkit.event.entity.EntityPortalEnterEvent;
+import org.bukkit.event.player.PlayerTeleportEvent;
+// CraftBukkit end
@@ -11,7 +14,7 @@
public class BlockEnderPortal extends BlockTileEntity {
protected static final VoxelShape a = Block.a(0.0D, 0.0D, 0.0D, 16.0D, 12.0D, 16.0D);
-@@ -21,13 +26,22 @@
+@@ -37,13 +44,22 @@
@Override
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
if (world instanceof WorldServer && !entity.isPassenger() && !entity.isVehicle() && entity.canPortal() && VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d((double) (-blockposition.getX()), (double) (-blockposition.getY()), (double) (-blockposition.getZ()))), iblockdata.getShape(world, blockposition), OperatorBoolean.AND)) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockFenceGate.patch b/nms-patches/net/minecraft/world/level/block/BlockFenceGate.patch
index d29e021dd..1f6dccae6 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockFenceGate.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockFenceGate.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockFenceGate.java
-+++ b/net/minecraft/server/BlockFenceGate.java
-@@ -103,6 +103,17 @@
+--- a/net/minecraft/world/level/block/BlockFenceGate.java
++++ b/net/minecraft/world/level/block/BlockFenceGate.java
+@@ -125,6 +125,17 @@
public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {
if (!world.isClientSide) {
boolean flag1 = world.isBlockIndirectlyPowered(blockposition);
diff --git a/nms-patches/net/minecraft/world/level/block/BlockFire.patch b/nms-patches/net/minecraft/world/level/block/BlockFire.patch
index 2788f4cd4..cd886028c 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockFire.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockFire.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BlockFire.java
-+++ b/net/minecraft/server/BlockFire.java
-@@ -8,6 +8,13 @@
- import java.util.function.Function;
- import java.util.stream.Collectors;
+--- a/net/minecraft/world/level/block/BlockFire.java
++++ b/net/minecraft/world/level/block/BlockFire.java
+@@ -28,6 +28,13 @@
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+ import net.minecraft.world.phys.shapes.VoxelShapes;
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlockState;
@@ -14,7 +14,7 @@
public class BlockFire extends BlockFireAbstract {
public static final BlockStateInteger AGE = BlockProperties.aj;
-@@ -64,7 +71,24 @@
+@@ -84,7 +91,24 @@
@Override
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
@@ -40,7 +40,7 @@
}
@Override
-@@ -113,7 +137,7 @@
+@@ -133,7 +157,7 @@
worldserver.getBlockTickList().a(blockposition, this, a(worldserver.random));
if (worldserver.getGameRules().getBoolean(GameRules.DO_FIRE_TICK)) {
if (!iblockdata.canPlace(worldserver, blockposition)) {
@@ -49,7 +49,7 @@
}
IBlockData iblockdata1 = worldserver.getType(blockposition.down());
-@@ -121,7 +145,7 @@
+@@ -141,7 +165,7 @@
int i = (Integer) iblockdata.get(BlockFire.AGE);
if (!flag && worldserver.isRaining() && this.a((World) worldserver, blockposition) && random.nextFloat() < 0.2F + (float) i * 0.03F) {
@@ -58,7 +58,7 @@
} else {
int j = Math.min(15, i + random.nextInt(3) / 2);
-@@ -135,14 +159,14 @@
+@@ -155,14 +179,14 @@
BlockPosition blockposition1 = blockposition.down();
if (!worldserver.getType(blockposition1).d(worldserver, blockposition1, EnumDirection.UP) || i > 3) {
@@ -75,7 +75,7 @@
return;
}
}
-@@ -150,12 +174,14 @@
+@@ -170,12 +194,14 @@
boolean flag1 = worldserver.u(blockposition);
int k = flag1 ? -50 : 0;
@@ -96,7 +96,7 @@
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
for (int l = -1; l <= 1; ++l) {
-@@ -181,7 +207,15 @@
+@@ -201,7 +227,15 @@
if (i2 > 0 && random.nextInt(k1) <= i2 && (!worldserver.isRaining() || !this.a((World) worldserver, (BlockPosition) blockposition_mutableblockposition))) {
int j2 = Math.min(15, i + random.nextInt(5) / 4);
@@ -113,7 +113,7 @@
}
}
}
-@@ -205,12 +239,24 @@
+@@ -225,12 +259,24 @@
return iblockdata.b(BlockProperties.C) && (Boolean) iblockdata.get(BlockProperties.C) ? 0 : this.flameChances.getInt(iblockdata.getBlock());
}
diff --git a/nms-patches/net/minecraft/world/level/block/BlockFireAbstract.patch b/nms-patches/net/minecraft/world/level/block/BlockFireAbstract.patch
index 5e4f7014c..e532aee98 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockFireAbstract.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockFireAbstract.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockFireAbstract.java
-+++ b/net/minecraft/server/BlockFireAbstract.java
-@@ -36,7 +36,14 @@
+--- a/net/minecraft/world/level/block/BlockFireAbstract.java
++++ b/net/minecraft/world/level/block/BlockFireAbstract.java
+@@ -50,7 +50,14 @@
if (!entity.isFireProof()) {
entity.setFireTicks(entity.getFireTicks() + 1);
if (entity.getFireTicks() == 0) {
@@ -16,7 +16,7 @@
}
entity.damageEntity(DamageSource.FIRE, this.b);
-@@ -58,14 +65,14 @@
+@@ -72,14 +79,14 @@
}
if (!iblockdata.canPlace(world, blockposition)) {
@@ -29,11 +29,11 @@
private static boolean a(World world) {
- return world.getDimensionKey() == World.OVERWORLD || world.getDimensionKey() == World.THE_NETHER;
-+ return world.getTypeKey() == DimensionManager.OVERWORLD || world.getTypeKey() == DimensionManager.THE_NETHER; // CraftBukkit - getTypeKey()
++ return world.getTypeKey() == net.minecraft.world.level.dimension.DimensionManager.OVERWORLD || world.getTypeKey() == net.minecraft.world.level.dimension.DimensionManager.THE_NETHER; // CraftBukkit - getTypeKey()
}
@Override
-@@ -109,4 +116,12 @@
+@@ -123,4 +130,12 @@
}
}
}
diff --git a/nms-patches/net/minecraft/world/level/block/BlockFluids.patch b/nms-patches/net/minecraft/world/level/block/BlockFluids.patch
index 68bbc251e..c6a739a81 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockFluids.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockFluids.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockFluids.java
-+++ b/net/minecraft/server/BlockFluids.java
-@@ -113,14 +113,20 @@
+--- a/net/minecraft/world/level/block/BlockFluids.java
++++ b/net/minecraft/world/level/block/BlockFluids.java
+@@ -137,14 +137,20 @@
if (world.getFluid(blockposition1).a((Tag) TagsFluid.WATER)) {
Block block = world.getFluid(blockposition).isSource() ? Blocks.OBSIDIAN : Blocks.COBBLESTONE;
diff --git a/nms-patches/net/minecraft/world/level/block/BlockFungi.patch b/nms-patches/net/minecraft/world/level/block/BlockFungi.patch
index b10cddf1b..fdfbb6d4a 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockFungi.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockFungi.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockFungi.java
-+++ b/net/minecraft/server/BlockFungi.java
-@@ -38,6 +38,13 @@
+--- a/net/minecraft/world/level/block/BlockFungi.java
++++ b/net/minecraft/world/level/block/BlockFungi.java
+@@ -50,6 +50,13 @@
@Override
public void a(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockGrass.patch b/nms-patches/net/minecraft/world/level/block/BlockGrass.patch
index f5eb144de..fb9bc0117 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockGrass.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockGrass.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockGrass.java
-+++ b/net/minecraft/server/BlockGrass.java
-@@ -64,7 +64,7 @@
+--- a/net/minecraft/world/level/block/BlockGrass.java
++++ b/net/minecraft/world/level/block/BlockGrass.java
+@@ -72,7 +72,7 @@
}
if (iblockdata3.canPlace(worldserver, blockposition2)) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockGrassPath.patch b/nms-patches/net/minecraft/world/level/block/BlockGrassPath.patch
index 94bb08c88..d2b8f8292 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockGrassPath.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockGrassPath.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockGrassPath.java
-+++ b/net/minecraft/server/BlockGrassPath.java
-@@ -31,6 +31,11 @@
+--- a/net/minecraft/world/level/block/BlockGrassPath.java
++++ b/net/minecraft/world/level/block/BlockGrassPath.java
+@@ -43,6 +43,11 @@
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockGrowingTop.patch b/nms-patches/net/minecraft/world/level/block/BlockGrowingTop.patch
index 4c565c223..75e697a55 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockGrowingTop.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockGrowingTop.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockGrowingTop.java
-+++ b/net/minecraft/server/BlockGrowingTop.java
-@@ -29,7 +29,7 @@
+--- a/net/minecraft/world/level/block/BlockGrowingTop.java
++++ b/net/minecraft/world/level/block/BlockGrowingTop.java
+@@ -44,7 +44,7 @@
BlockPosition blockposition1 = blockposition.shift(this.a);
if (this.h(worldserver.getType(blockposition1))) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockIce.patch b/nms-patches/net/minecraft/world/level/block/BlockIce.patch
index c4dc62bda..325d1e9ba 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockIce.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockIce.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockIce.java
-+++ b/net/minecraft/server/BlockIce.java
-@@ -36,6 +36,11 @@
+--- a/net/minecraft/world/level/block/BlockIce.java
++++ b/net/minecraft/world/level/block/BlockIce.java
+@@ -50,6 +50,11 @@
}
protected void melt(IBlockData iblockdata, World world, BlockPosition blockposition) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockJukeBox.patch b/nms-patches/net/minecraft/world/level/block/BlockJukeBox.patch
index 5cd550ed1..9f7002ce6 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockJukeBox.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockJukeBox.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockJukeBox.java
-+++ b/net/minecraft/server/BlockJukeBox.java
-@@ -42,7 +42,13 @@
+--- a/net/minecraft/world/level/block/BlockJukeBox.java
++++ b/net/minecraft/world/level/block/BlockJukeBox.java
+@@ -63,7 +63,13 @@
TileEntity tileentity = generatoraccess.getTileEntity(blockposition);
if (tileentity instanceof TileEntityJukeBox) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockLeaves.patch b/nms-patches/net/minecraft/world/level/block/BlockLeaves.patch
index 34c9f2fa5..2d51051cf 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockLeaves.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockLeaves.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockLeaves.java
-+++ b/net/minecraft/server/BlockLeaves.java
-@@ -2,6 +2,8 @@
-
- import java.util.Random;
+--- a/net/minecraft/world/level/block/BlockLeaves.java
++++ b/net/minecraft/world/level/block/BlockLeaves.java
+@@ -19,6 +19,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapes;
+import org.bukkit.event.block.LeavesDecayEvent; // CraftBukkit
+
public class BlockLeaves extends Block {
public static final BlockStateInteger DISTANCE = BlockProperties.an;
-@@ -25,6 +27,14 @@
+@@ -42,6 +44,14 @@
@Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (!(Boolean) iblockdata.get(BlockLeaves.PERSISTENT) && (Integer) iblockdata.get(BlockLeaves.DISTANCE) == 7) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockLectern.patch b/nms-patches/net/minecraft/world/level/block/BlockLectern.patch
index 5c6e10f31..182db2ec5 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockLectern.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockLectern.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockLectern.java
-+++ b/net/minecraft/server/BlockLectern.java
-@@ -165,12 +165,13 @@
+--- a/net/minecraft/world/level/block/BlockLectern.java
++++ b/net/minecraft/world/level/block/BlockLectern.java
+@@ -196,12 +196,13 @@
}
private void d(IBlockData iblockdata, World world, BlockPosition blockposition) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockLever.patch b/nms-patches/net/minecraft/world/level/block/BlockLever.patch
index e507caebb..96472a754 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockLever.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockLever.patch
@@ -1,14 +1,15 @@
---- a/net/minecraft/server/BlockLever.java
-+++ b/net/minecraft/server/BlockLever.java
-@@ -1,5 +1,7 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/level/block/BlockLever.java
++++ b/net/minecraft/world/level/block/BlockLever.java
+@@ -22,6 +22,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockLever extends BlockAttachable {
public static final BlockStateBoolean POWERED = BlockProperties.w;
-@@ -64,6 +66,20 @@
+@@ -86,6 +88,20 @@
return EnumInteractionResult.SUCCESS;
} else {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockMagma.patch b/nms-patches/net/minecraft/world/level/block/BlockMagma.patch
index dae5fe4c5..57ee64aaf 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockMagma.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockMagma.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockMagma.java
-+++ b/net/minecraft/server/BlockMagma.java
-@@ -11,7 +11,9 @@
+--- a/net/minecraft/world/level/block/BlockMagma.java
++++ b/net/minecraft/world/level/block/BlockMagma.java
+@@ -28,7 +28,9 @@
@Override
public void stepOn(World world, BlockPosition blockposition, Entity entity) {
if (!entity.isFireProof() && entity instanceof EntityLiving && !EnchantmentManager.i((EntityLiving) entity)) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockMinecartDetector.patch b/nms-patches/net/minecraft/world/level/block/BlockMinecartDetector.patch
index 4a0f051af..ae590673b 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockMinecartDetector.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockMinecartDetector.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockMinecartDetector.java
-+++ b/net/minecraft/server/BlockMinecartDetector.java
-@@ -6,6 +6,8 @@
- import java.util.function.Predicate;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/BlockMinecartDetector.java
++++ b/net/minecraft/world/level/block/BlockMinecartDetector.java
+@@ -26,6 +26,8 @@
+ import net.minecraft.world.level.block.state.properties.IBlockState;
+ import net.minecraft.world.phys.AxisAlignedBB;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockMinecartDetector extends BlockMinecartTrackAbstract {
public static final BlockStateEnum SHAPE = BlockProperties.ad;
-@@ -58,6 +60,16 @@
+@@ -78,6 +80,16 @@
}
IBlockData iblockdata1;
diff --git a/nms-patches/net/minecraft/world/level/block/BlockMobSpawner.patch b/nms-patches/net/minecraft/world/level/block/BlockMobSpawner.patch
index d93b2c558..7f4ede58d 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockMobSpawner.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockMobSpawner.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockMobSpawner.java
-+++ b/net/minecraft/server/BlockMobSpawner.java
-@@ -14,9 +14,19 @@
+--- a/net/minecraft/world/level/block/BlockMobSpawner.java
++++ b/net/minecraft/world/level/block/BlockMobSpawner.java
+@@ -23,9 +23,19 @@
@Override
public void dropNaturally(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
super.dropNaturally(iblockdata, worldserver, blockposition, itemstack);
diff --git a/nms-patches/net/minecraft/world/level/block/BlockMonsterEggs.patch b/nms-patches/net/minecraft/world/level/block/BlockMonsterEggs.patch
index 74a153063..9ec317fc8 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockMonsterEggs.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockMonsterEggs.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockMonsterEggs.java
-+++ b/net/minecraft/server/BlockMonsterEggs.java
-@@ -3,6 +3,8 @@
- import com.google.common.collect.Maps;
- import java.util.Map;
+--- a/net/minecraft/world/level/block/BlockMonsterEggs.java
++++ b/net/minecraft/world/level/block/BlockMonsterEggs.java
+@@ -15,6 +15,8 @@
+ import net.minecraft.world.level.block.state.BlockBase;
+ import net.minecraft.world.level.block.state.IBlockData;
+import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; // CraftBukkit
+
public class BlockMonsterEggs extends Block {
private final Block a;
-@@ -26,7 +28,7 @@
+@@ -38,7 +40,7 @@
EntitySilverfish entitysilverfish = (EntitySilverfish) EntityTypes.SILVERFISH.a((World) worldserver);
entitysilverfish.setPositionRotation((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, 0.0F, 0.0F);
diff --git a/nms-patches/net/minecraft/world/level/block/BlockMushroom.patch b/nms-patches/net/minecraft/world/level/block/BlockMushroom.patch
index 671f3734a..a50bea1fc 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockMushroom.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockMushroom.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BlockMushroom.java
-+++ b/net/minecraft/server/BlockMushroom.java
-@@ -3,6 +3,10 @@
- import java.util.Iterator;
- import java.util.Random;
+--- a/net/minecraft/world/level/block/BlockMushroom.java
++++ b/net/minecraft/world/level/block/BlockMushroom.java
+@@ -16,6 +16,10 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
+import org.bukkit.TreeType;
@@ -11,7 +11,7 @@
public class BlockMushroom extends BlockPlant implements IBlockFragilePlantElement {
protected static final VoxelShape a = Block.a(5.0D, 0.0D, 5.0D, 11.0D, 6.0D, 11.0D);
-@@ -45,7 +49,7 @@
+@@ -58,7 +62,7 @@
}
if (worldserver.isEmpty(blockposition2) && iblockdata.canPlace(worldserver, blockposition2)) {
@@ -20,7 +20,7 @@
}
}
-@@ -69,6 +73,7 @@
+@@ -82,6 +86,7 @@
WorldGenFeatureConfigured worldgenfeatureconfigured;
if (this == Blocks.BROWN_MUSHROOM) {
@@ -28,7 +28,7 @@
worldgenfeatureconfigured = BiomeDecoratorGroups.HUGE_BROWN_MUSHROOM;
} else {
if (this != Blocks.RED_MUSHROOM) {
-@@ -76,6 +81,7 @@
+@@ -89,6 +94,7 @@
return false;
}
diff --git a/nms-patches/net/minecraft/world/level/block/BlockNetherWart.patch b/nms-patches/net/minecraft/world/level/block/BlockNetherWart.patch
index 65cf73689..be21279b5 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockNetherWart.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockNetherWart.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockNetherWart.java
-+++ b/net/minecraft/server/BlockNetherWart.java
-@@ -33,7 +33,7 @@
+--- a/net/minecraft/world/level/block/BlockNetherWart.java
++++ b/net/minecraft/world/level/block/BlockNetherWart.java
+@@ -43,7 +43,7 @@
if (i < 3 && random.nextInt(10) == 0) {
iblockdata = (IBlockData) iblockdata.set(BlockNetherWart.AGE, i + 1);
diff --git a/nms-patches/net/minecraft/world/level/block/BlockNote.patch b/nms-patches/net/minecraft/world/level/block/BlockNote.patch
index 9a4a1ebcb..c30ddc655 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockNote.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockNote.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockNote.java
-+++ b/net/minecraft/server/BlockNote.java
-@@ -27,7 +27,8 @@
+--- a/net/minecraft/world/level/block/BlockNote.java
++++ b/net/minecraft/world/level/block/BlockNote.java
+@@ -49,7 +49,8 @@
if (flag1 != (Boolean) iblockdata.get(BlockNote.POWERED)) {
if (flag1) {
@@ -10,7 +10,7 @@
}
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockNote.POWERED, flag1), 3);
-@@ -35,9 +36,14 @@
+@@ -57,9 +58,14 @@
}
@@ -27,7 +27,7 @@
}
}
-@@ -49,7 +55,7 @@
+@@ -71,7 +77,7 @@
} else {
iblockdata = (IBlockData) iblockdata.a((IBlockState) BlockNote.NOTE);
world.setTypeAndData(blockposition, iblockdata, 3);
@@ -36,7 +36,7 @@
entityhuman.a(StatisticList.TUNE_NOTEBLOCK);
return EnumInteractionResult.CONSUME;
}
-@@ -58,7 +64,7 @@
+@@ -80,7 +86,7 @@
@Override
public void attack(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman) {
if (!world.isClientSide) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockObserver.patch b/nms-patches/net/minecraft/world/level/block/BlockObserver.patch
index 187a322b6..ab8938468 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockObserver.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockObserver.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockObserver.java
-+++ b/net/minecraft/server/BlockObserver.java
-@@ -2,6 +2,8 @@
-
- import java.util.Random;
+--- a/net/minecraft/world/level/block/BlockObserver.java
++++ b/net/minecraft/world/level/block/BlockObserver.java
+@@ -14,6 +14,8 @@
+ import net.minecraft.world.level.block.state.properties.BlockProperties;
+ import net.minecraft.world.level.block.state.properties.BlockStateBoolean;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockObserver extends BlockDirectional {
public static final BlockStateBoolean b = BlockProperties.w;
-@@ -29,8 +31,18 @@
+@@ -41,8 +43,18 @@
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if ((Boolean) iblockdata.get(BlockObserver.b)) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockOre.patch b/nms-patches/net/minecraft/world/level/block/BlockOre.patch
index 597134ad5..48a495484 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockOre.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockOre.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockOre.java
-+++ b/net/minecraft/server/BlockOre.java
-@@ -15,6 +15,7 @@
+--- a/net/minecraft/world/level/block/BlockOre.java
++++ b/net/minecraft/world/level/block/BlockOre.java
+@@ -23,6 +23,7 @@
@Override
public void dropNaturally(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
super.dropNaturally(iblockdata, worldserver, blockposition, itemstack);
@@ -8,7 +8,7 @@
if (EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
int i = this.a(worldserver.random);
-@@ -22,6 +23,21 @@
+@@ -30,6 +31,21 @@
this.dropExperience(worldserver, blockposition, i);
}
}
diff --git a/nms-patches/net/minecraft/world/level/block/BlockPlant.patch b/nms-patches/net/minecraft/world/level/block/BlockPlant.patch
index 98cafaef1..1a21f2e0f 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockPlant.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockPlant.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockPlant.java
-+++ b/net/minecraft/server/BlockPlant.java
-@@ -12,7 +12,14 @@
+--- a/net/minecraft/world/level/block/BlockPlant.java
++++ b/net/minecraft/world/level/block/BlockPlant.java
+@@ -21,7 +21,14 @@
@Override
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockPortal.patch b/nms-patches/net/minecraft/world/level/block/BlockPortal.patch
index b625ad30b..c3e8cdd1f 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockPortal.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockPortal.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BlockPortal.java
-+++ b/net/minecraft/server/BlockPortal.java
-@@ -2,6 +2,10 @@
-
- import java.util.Random;
+--- a/net/minecraft/world/level/block/BlockPortal.java
++++ b/net/minecraft/world/level/block/BlockPortal.java
+@@ -23,6 +23,10 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
+import org.bukkit.event.entity.EntityPortalEnterEvent;
@@ -11,7 +11,7 @@
public class BlockPortal extends Block {
public static final BlockStateEnum AXIS = BlockProperties.E;
-@@ -32,7 +36,8 @@
+@@ -53,7 +57,8 @@
}
if (worldserver.getType(blockposition).a((IBlockAccess) worldserver, blockposition, EntityTypes.ZOMBIFIED_PIGLIN)) {
@@ -21,7 +21,7 @@
if (entity != null) {
entity.resetPortalCooldown();
-@@ -54,6 +59,10 @@
+@@ -75,6 +80,10 @@
@Override
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
if (!entity.isPassenger() && !entity.isVehicle() && entity.canPortal()) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockPoweredRail.patch b/nms-patches/net/minecraft/world/level/block/BlockPoweredRail.patch
index 0767f6985..36fb21512 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockPoweredRail.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockPoweredRail.patch
@@ -1,14 +1,15 @@
---- a/net/minecraft/server/BlockPoweredRail.java
-+++ b/net/minecraft/server/BlockPoweredRail.java
-@@ -1,5 +1,7 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/level/block/BlockPoweredRail.java
++++ b/net/minecraft/world/level/block/BlockPoweredRail.java
+@@ -11,6 +11,8 @@
+ import net.minecraft.world.level.block.state.properties.BlockStateEnum;
+ import net.minecraft.world.level.block.state.properties.IBlockState;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockPoweredRail extends BlockMinecartTrackAbstract {
public static final BlockStateEnum SHAPE = BlockProperties.ad;
-@@ -102,6 +104,13 @@
+@@ -113,6 +115,13 @@
boolean flag1 = world.isBlockIndirectlyPowered(blockposition) || this.a(world, blockposition, iblockdata, true, 0) || this.a(world, blockposition, iblockdata, false, 0);
if (flag1 != flag) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockPressurePlateAbstract.patch b/nms-patches/net/minecraft/world/level/block/BlockPressurePlateAbstract.patch
index bc1c7cc89..72fc98ef5 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockPressurePlateAbstract.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockPressurePlateAbstract.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockPressurePlateAbstract.java
-+++ b/net/minecraft/server/BlockPressurePlateAbstract.java
-@@ -2,6 +2,8 @@
-
- import java.util.Random;
+--- a/net/minecraft/world/level/block/BlockPressurePlateAbstract.java
++++ b/net/minecraft/world/level/block/BlockPressurePlateAbstract.java
+@@ -16,6 +16,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public abstract class BlockPressurePlateAbstract extends Block {
protected static final VoxelShape a = Block.a(1.0D, 0.0D, 1.0D, 15.0D, 0.5D, 15.0D);
-@@ -65,6 +67,19 @@
+@@ -79,6 +81,19 @@
boolean flag = i > 0;
boolean flag1 = j > 0;
diff --git a/nms-patches/net/minecraft/world/level/block/BlockPressurePlateBinary.patch b/nms-patches/net/minecraft/world/level/block/BlockPressurePlateBinary.patch
index 0d2fc3eef..2e99fd6c1 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockPressurePlateBinary.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockPressurePlateBinary.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockPressurePlateBinary.java
-+++ b/net/minecraft/server/BlockPressurePlateBinary.java
-@@ -3,6 +3,8 @@
- import java.util.Iterator;
- import java.util.List;
+--- a/net/minecraft/world/level/block/BlockPressurePlateBinary.java
++++ b/net/minecraft/world/level/block/BlockPressurePlateBinary.java
+@@ -18,6 +18,8 @@
+ import net.minecraft.world.level.material.Material;
+ import net.minecraft.world.phys.AxisAlignedBB;
+import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit
+
public class BlockPressurePlateBinary extends BlockPressurePlateAbstract {
public static final BlockStateBoolean POWERED = BlockProperties.w;
-@@ -66,6 +68,26 @@
+@@ -81,6 +83,26 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
diff --git a/nms-patches/net/minecraft/world/level/block/BlockPressurePlateWeighted.patch b/nms-patches/net/minecraft/world/level/block/BlockPressurePlateWeighted.patch
index 18afba2eb..3a36239cd 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockPressurePlateWeighted.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockPressurePlateWeighted.patch
@@ -1,14 +1,15 @@
---- a/net/minecraft/server/BlockPressurePlateWeighted.java
-+++ b/net/minecraft/server/BlockPressurePlateWeighted.java
-@@ -1,5 +1,7 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/level/block/BlockPressurePlateWeighted.java
++++ b/net/minecraft/world/level/block/BlockPressurePlateWeighted.java
+@@ -14,6 +14,8 @@
+ import net.minecraft.world.level.block.state.properties.BlockProperties;
+ import net.minecraft.world.level.block.state.properties.BlockStateInteger;
+import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit
+
public class BlockPressurePlateWeighted extends BlockPressurePlateAbstract {
public static final BlockStateInteger POWER = BlockProperties.az;
-@@ -13,7 +15,31 @@
+@@ -27,7 +29,31 @@
@Override
protected int b(World world, BlockPosition blockposition) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockPumpkinCarved.patch b/nms-patches/net/minecraft/world/level/block/BlockPumpkinCarved.patch
index 43e888daa..ca3b643f0 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockPumpkinCarved.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockPumpkinCarved.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BlockPumpkinCarved.java
-+++ b/net/minecraft/server/BlockPumpkinCarved.java
-@@ -4,6 +4,11 @@
- import java.util.function.Predicate;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/BlockPumpkinCarved.java
++++ b/net/minecraft/world/level/block/BlockPumpkinCarved.java
+@@ -26,6 +26,11 @@
+ import net.minecraft.world.level.block.state.properties.BlockStateDirection;
+ import net.minecraft.world.level.material.Material;
+// CraftBukkit start
+import org.bukkit.craftbukkit.util.BlockStateListPopulator;
@@ -12,7 +12,7 @@
public class BlockPumpkinCarved extends BlockFacingHorizontal implements ItemWearable {
public static final BlockStateDirection a = BlockFacingHorizontal.FACING;
-@@ -42,19 +47,28 @@
+@@ -64,19 +69,28 @@
EntityPlayer entityplayer;
int j;
@@ -44,7 +44,7 @@
iterator = world.a(EntityPlayer.class, entitysnowman.getBoundingBox().g(5.0D)).iterator();
while (iterator.hasNext()) {
-@@ -74,8 +88,8 @@
+@@ -96,8 +110,8 @@
for (int k = 0; k < this.getIronGolemShape().b(); ++k) {
ShapeDetectorBlock shapedetectorblock2 = shapedetector_shapedetectorcollection.a(i, k, 0);
@@ -55,7 +55,7 @@
}
}
-@@ -84,7 +98,15 @@
+@@ -106,7 +120,15 @@
entityirongolem.setPlayerCreated(true);
entityirongolem.setPositionRotation((double) blockposition2.getX() + 0.5D, (double) blockposition2.getY() + 0.05D, (double) blockposition2.getZ() + 0.5D, 0.0F, 0.0F);
diff --git a/nms-patches/net/minecraft/world/level/block/BlockRedstoneComparator.patch b/nms-patches/net/minecraft/world/level/block/BlockRedstoneComparator.patch
index f4baf5e46..72bd60127 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockRedstoneComparator.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockRedstoneComparator.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockRedstoneComparator.java
-+++ b/net/minecraft/server/BlockRedstoneComparator.java
-@@ -4,6 +4,8 @@
- import java.util.Random;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/BlockRedstoneComparator.java
++++ b/net/minecraft/world/level/block/BlockRedstoneComparator.java
+@@ -28,6 +28,8 @@
+ import net.minecraft.world.phys.AxisAlignedBB;
+ import net.minecraft.world.phys.MovingObjectPositionBlock;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITileEntity {
public static final BlockStateEnum MODE = BlockProperties.aG;
-@@ -67,7 +69,8 @@
+@@ -91,7 +93,8 @@
@Nullable
private EntityItemFrame a(World world, EnumDirection enumdirection, BlockPosition blockposition) {
@@ -19,7 +19,7 @@
return entityitemframe != null && entityitemframe.getDirection() == enumdirection;
});
-@@ -122,8 +125,18 @@
+@@ -146,8 +149,18 @@
boolean flag1 = (Boolean) iblockdata.get(BlockRedstoneComparator.c);
if (flag1 && !flag) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockRedstoneLamp.patch b/nms-patches/net/minecraft/world/level/block/BlockRedstoneLamp.patch
index c11918254..778838990 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockRedstoneLamp.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockRedstoneLamp.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockRedstoneLamp.java
-+++ b/net/minecraft/server/BlockRedstoneLamp.java
-@@ -3,6 +3,8 @@
- import java.util.Random;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/BlockRedstoneLamp.java
++++ b/net/minecraft/world/level/block/BlockRedstoneLamp.java
+@@ -12,6 +12,8 @@
+ import net.minecraft.world.level.block.state.properties.BlockStateBoolean;
+ import net.minecraft.world.level.block.state.properties.IBlockState;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockRedstoneLamp extends Block {
public static final BlockStateBoolean a = BlockRedstoneTorch.LIT;
-@@ -27,6 +29,11 @@
+@@ -36,6 +38,11 @@
if (flag1) {
world.getBlockTickList().a(blockposition, this, 4);
} else {
@@ -21,7 +21,7 @@
world.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockRedstoneLamp.a), 2);
}
}
-@@ -37,6 +44,11 @@
+@@ -46,6 +53,11 @@
@Override
public void tickAlways(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if ((Boolean) iblockdata.get(BlockRedstoneLamp.a) && !worldserver.isBlockIndirectlyPowered(blockposition)) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockRedstoneOre.patch b/nms-patches/net/minecraft/world/level/block/BlockRedstoneOre.patch
index e7740d32d..628ebf4c1 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockRedstoneOre.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockRedstoneOre.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BlockRedstoneOre.java
-+++ b/net/minecraft/server/BlockRedstoneOre.java
-@@ -2,6 +2,11 @@
-
- import java.util.Random;
+--- a/net/minecraft/world/level/block/BlockRedstoneOre.java
++++ b/net/minecraft/world/level/block/BlockRedstoneOre.java
+@@ -21,6 +21,11 @@
+ import net.minecraft.world.level.block.state.properties.BlockStateBoolean;
+ import net.minecraft.world.phys.MovingObjectPositionBlock;
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -12,7 +12,7 @@
public class BlockRedstoneOre extends Block {
public static final BlockStateBoolean a = BlockRedstoneTorch.LIT;
-@@ -13,14 +18,30 @@
+@@ -32,14 +37,30 @@
@Override
public void attack(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman) {
@@ -46,7 +46,7 @@
}
@Override
-@@ -28,7 +49,7 @@
+@@ -47,7 +68,7 @@
if (world.isClientSide) {
playEffect(world, blockposition);
} else {
@@ -55,7 +55,7 @@
}
ItemStack itemstack = entityhuman.b(enumhand);
-@@ -36,9 +57,14 @@
+@@ -55,9 +76,14 @@
return itemstack.getItem() instanceof ItemBlock && (new BlockActionContext(entityhuman, enumhand, itemstack, movingobjectpositionblock)).b() ? EnumInteractionResult.PASS : EnumInteractionResult.SUCCESS;
}
@@ -71,7 +71,7 @@
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, true), 3);
}
-@@ -52,6 +78,11 @@
+@@ -71,6 +97,11 @@
@Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if ((Boolean) iblockdata.get(BlockRedstoneOre.a)) {
@@ -83,7 +83,7 @@
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneOre.a, false), 3);
}
-@@ -60,12 +91,25 @@
+@@ -79,12 +110,25 @@
@Override
public void dropNaturally(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
super.dropNaturally(iblockdata, worldserver, blockposition, itemstack);
diff --git a/nms-patches/net/minecraft/world/level/block/BlockRedstoneTorch.patch b/nms-patches/net/minecraft/world/level/block/BlockRedstoneTorch.patch
index f594c0f0e..94cf28cf0 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockRedstoneTorch.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockRedstoneTorch.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockRedstoneTorch.java
-+++ b/net/minecraft/server/BlockRedstoneTorch.java
-@@ -6,6 +6,8 @@
- import java.util.Random;
- import java.util.WeakHashMap;
+--- a/net/minecraft/world/level/block/BlockRedstoneTorch.java
++++ b/net/minecraft/world/level/block/BlockRedstoneTorch.java
+@@ -17,6 +17,8 @@
+ import net.minecraft.world.level.block.state.properties.BlockProperties;
+ import net.minecraft.world.level.block.state.properties.BlockStateBoolean;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockRedstoneTorch extends BlockTorch {
public static final BlockStateBoolean LIT = BlockProperties.r;
-@@ -62,8 +64,24 @@
+@@ -73,8 +75,24 @@
list.remove(0);
}
@@ -34,7 +34,7 @@
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockRedstoneTorch.LIT, false), 3);
if (a(worldserver, blockposition, true)) {
worldserver.triggerEffect(1502, blockposition, 0);
-@@ -71,6 +89,15 @@
+@@ -82,6 +100,15 @@
}
}
} else if (!flag && !a(worldserver, blockposition, false)) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockRedstoneWire.patch b/nms-patches/net/minecraft/world/level/block/BlockRedstoneWire.patch
index 5f909ebfc..5a8753f80 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockRedstoneWire.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockRedstoneWire.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockRedstoneWire.java
-+++ b/net/minecraft/server/BlockRedstoneWire.java
-@@ -9,6 +9,8 @@
- import java.util.Set;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/BlockRedstoneWire.java
++++ b/net/minecraft/world/level/block/BlockRedstoneWire.java
+@@ -34,6 +34,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+ import net.minecraft.world.phys.shapes.VoxelShapes;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockRedstoneWire extends Block {
public static final BlockStateEnum NORTH = BlockProperties.X;
-@@ -213,7 +215,16 @@
+@@ -238,7 +240,16 @@
private void a(World world, BlockPosition blockposition, IBlockData iblockdata) {
int i = this.a(world, blockposition);
diff --git a/nms-patches/net/minecraft/world/level/block/BlockReed.patch b/nms-patches/net/minecraft/world/level/block/BlockReed.patch
index 16d32eed3..a0b56761d 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockReed.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockReed.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockReed.java
-+++ b/net/minecraft/server/BlockReed.java
-@@ -39,7 +39,7 @@
+--- a/net/minecraft/world/level/block/BlockReed.java
++++ b/net/minecraft/world/level/block/BlockReed.java
+@@ -55,7 +55,7 @@
int j = (Integer) iblockdata.get(BlockReed.AGE);
if (j == 15) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockSapling.patch b/nms-patches/net/minecraft/world/level/block/BlockSapling.patch
index 62dd59f54..65afc5237 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockSapling.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockSapling.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BlockSapling.java
-+++ b/net/minecraft/server/BlockSapling.java
-@@ -2,11 +2,19 @@
-
- import java.util.Random;
+--- a/net/minecraft/world/level/block/BlockSapling.java
++++ b/net/minecraft/world/level/block/BlockSapling.java
+@@ -15,11 +15,19 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
+import org.bukkit.Location;
@@ -20,7 +20,7 @@
protected BlockSapling(WorldGenTreeProvider worldgentreeprovider, BlockBase.Info blockbase_info) {
super(blockbase_info);
-@@ -22,7 +30,30 @@
+@@ -35,7 +43,30 @@
@Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (worldserver.getLightLevel(blockposition.up()) >= 9 && random.nextInt(7) == 0) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockScaffolding.patch b/nms-patches/net/minecraft/world/level/block/BlockScaffolding.patch
index 3bc8a16b5..e3019e7a1 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockScaffolding.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockScaffolding.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockScaffolding.java
-+++ b/net/minecraft/server/BlockScaffolding.java
-@@ -73,7 +73,7 @@
+--- a/net/minecraft/world/level/block/BlockScaffolding.java
++++ b/net/minecraft/world/level/block/BlockScaffolding.java
+@@ -94,7 +94,7 @@
int i = a((IBlockAccess) worldserver, blockposition);
IBlockData iblockdata1 = (IBlockData) ((IBlockData) iblockdata.set(BlockScaffolding.a, i)).set(BlockScaffolding.c, this.a(worldserver, blockposition, i));
diff --git a/nms-patches/net/minecraft/world/level/block/BlockSnow.patch b/nms-patches/net/minecraft/world/level/block/BlockSnow.patch
index f94055297..7fb414a67 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockSnow.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockSnow.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockSnow.java
-+++ b/net/minecraft/server/BlockSnow.java
-@@ -67,6 +67,11 @@
+--- a/net/minecraft/world/level/block/BlockSnow.java
++++ b/net/minecraft/world/level/block/BlockSnow.java
+@@ -85,6 +85,11 @@
@Override
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
if (worldserver.getBrightness(EnumSkyBlock.BLOCK, blockposition) > 11) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockSoil.patch b/nms-patches/net/minecraft/world/level/block/BlockSoil.patch
index 5dcd4e558..893fcc629 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockSoil.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockSoil.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BlockSoil.java
-+++ b/net/minecraft/server/BlockSoil.java
-@@ -3,6 +3,11 @@
- import java.util.Iterator;
- import java.util.Random;
+--- a/net/minecraft/world/level/block/BlockSoil.java
++++ b/net/minecraft/world/level/block/BlockSoil.java
+@@ -26,6 +26,11 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
+import org.bukkit.event.entity.EntityInteractEvent;
@@ -12,7 +12,7 @@
public class BlockSoil extends Block {
public static final BlockStateInteger MOISTURE = BlockProperties.aw;
-@@ -58,26 +63,49 @@
+@@ -81,26 +86,49 @@
if (!a((IWorldReader) worldserver, blockposition) && !worldserver.isRainingAt(blockposition.up())) {
if (i > 0) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockSponge.patch b/nms-patches/net/minecraft/world/level/block/BlockSponge.patch
index b39c53b2a..9ae2263c5 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockSponge.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockSponge.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BlockSponge.java
-+++ b/net/minecraft/server/BlockSponge.java
-@@ -3,6 +3,13 @@
- import com.google.common.collect.Lists;
- import java.util.Queue;
+--- a/net/minecraft/world/level/block/BlockSponge.java
++++ b/net/minecraft/world/level/block/BlockSponge.java
+@@ -16,6 +16,13 @@
+ import net.minecraft.world.level.material.FluidTypes;
+ import net.minecraft.world.level.material.Material;
+// CraftBukkit start
+import java.util.List;
@@ -14,7 +14,7 @@
public class BlockSponge extends Block {
protected BlockSponge(BlockBase.Info blockbase_info) {
-@@ -35,6 +42,7 @@
+@@ -48,6 +55,7 @@
queue.add(new Tuple<>(blockposition, 0));
int i = 0;
@@ -22,7 +22,7 @@
while (!queue.isEmpty()) {
Tuple tuple = (Tuple) queue.poll();
-@@ -46,27 +54,31 @@
+@@ -59,27 +67,31 @@
for (int l = 0; l < k; ++l) {
EnumDirection enumdirection = aenumdirection[l];
BlockPosition blockposition2 = blockposition1.shift(enumdirection);
@@ -61,7 +61,7 @@
++i;
if (j < 6) {
queue.add(new Tuple<>(blockposition2, j + 1));
-@@ -79,6 +91,39 @@
+@@ -92,6 +104,39 @@
break;
}
}
diff --git a/nms-patches/net/minecraft/world/level/block/BlockStem.patch b/nms-patches/net/minecraft/world/level/block/BlockStem.patch
index 6703296f4..091761f81 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockStem.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockStem.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockStem.java
-+++ b/net/minecraft/server/BlockStem.java
-@@ -2,6 +2,8 @@
-
- import java.util.Random;
+--- a/net/minecraft/world/level/block/BlockStem.java
++++ b/net/minecraft/world/level/block/BlockStem.java
+@@ -15,6 +15,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockStem extends BlockPlant implements IBlockFragilePlantElement {
public static final BlockStateInteger AGE = BlockProperties.ai;
-@@ -34,14 +36,18 @@
+@@ -47,14 +49,18 @@
if (i < 7) {
iblockdata = (IBlockData) iblockdata.set(BlockStem.AGE, i + 1);
@@ -30,7 +30,7 @@
worldserver.setTypeUpdate(blockposition, (IBlockData) this.blockFruit.d().getBlockData().set(BlockFacingHorizontal.FACING, enumdirection));
}
}
-@@ -65,7 +71,7 @@
+@@ -78,7 +84,7 @@
int i = Math.min(7, (Integer) iblockdata.get(BlockStem.AGE) + MathHelper.nextInt(worldserver.random, 2, 5));
IBlockData iblockdata1 = (IBlockData) iblockdata.set(BlockStem.AGE, i);
diff --git a/nms-patches/net/minecraft/world/level/block/BlockSweetBerryBush.patch b/nms-patches/net/minecraft/world/level/block/BlockSweetBerryBush.patch
index b4a28febd..d974f401b 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockSweetBerryBush.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockSweetBerryBush.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BlockSweetBerryBush.java
-+++ b/net/minecraft/server/BlockSweetBerryBush.java
-@@ -2,6 +2,14 @@
-
- import java.util.Random;
+--- a/net/minecraft/world/level/block/BlockSweetBerryBush.java
++++ b/net/minecraft/world/level/block/BlockSweetBerryBush.java
+@@ -26,6 +26,14 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
+import java.util.Collections;
@@ -15,7 +15,7 @@
public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlantElement {
public static final BlockStateInteger a = BlockProperties.ag;
-@@ -28,7 +36,7 @@
+@@ -52,7 +60,7 @@
int i = (Integer) iblockdata.get(BlockSweetBerryBush.a);
if (i < 3 && random.nextInt(5) == 0 && worldserver.getLightLevel(blockposition.up(), 0) >= 9) {
@@ -24,7 +24,7 @@
}
}
-@@ -42,7 +50,9 @@
+@@ -66,7 +74,9 @@
double d1 = Math.abs(entity.locZ() - entity.F);
if (d0 >= 0.003000000026077032D || d1 >= 0.003000000026077032D) {
@@ -34,7 +34,7 @@
}
}
-@@ -59,7 +69,15 @@
+@@ -83,7 +93,15 @@
} else if (i > 1) {
int j = 1 + world.random.nextInt(2);
diff --git a/nms-patches/net/minecraft/world/level/block/BlockTNT.patch b/nms-patches/net/minecraft/world/level/block/BlockTNT.patch
index def64b901..cbbf826de 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockTNT.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockTNT.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockTNT.java
-+++ b/net/minecraft/server/BlockTNT.java
-@@ -94,6 +94,11 @@
+--- a/net/minecraft/world/level/block/BlockTNT.java
++++ b/net/minecraft/world/level/block/BlockTNT.java
+@@ -115,6 +115,11 @@
if (iprojectile.isBurning()) {
BlockPosition blockposition = movingobjectpositionblock.getBlockPosition();
diff --git a/nms-patches/net/minecraft/world/level/block/BlockTallPlant.patch b/nms-patches/net/minecraft/world/level/block/BlockTallPlant.patch
index dea595b55..2e45f966a 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockTallPlant.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockTallPlant.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockTallPlant.java
-+++ b/net/minecraft/server/BlockTallPlant.java
-@@ -66,6 +66,11 @@
+--- a/net/minecraft/world/level/block/BlockTallPlant.java
++++ b/net/minecraft/world/level/block/BlockTallPlant.java
+@@ -82,6 +82,11 @@
}
protected static void b(World world, BlockPosition blockposition, IBlockData iblockdata, EntityHuman entityhuman) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockTrapdoor.patch b/nms-patches/net/minecraft/world/level/block/BlockTrapdoor.patch
index 4a274e0e4..d8014b649 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockTrapdoor.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockTrapdoor.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockTrapdoor.java
-+++ b/net/minecraft/server/BlockTrapdoor.java
-@@ -2,6 +2,8 @@
-
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/BlockTrapdoor.java
++++ b/net/minecraft/world/level/block/BlockTrapdoor.java
+@@ -27,6 +27,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterlogged {
public static final BlockStateBoolean OPEN = BlockProperties.u;
-@@ -88,6 +90,19 @@
+@@ -113,6 +115,19 @@
boolean flag1 = world.isBlockIndirectlyPowered(blockposition);
if (flag1 != (Boolean) iblockdata.get(BlockTrapdoor.c)) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockTripwire.patch b/nms-patches/net/minecraft/world/level/block/BlockTripwire.patch
index 35d5936d4..53ff86300 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockTripwire.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockTripwire.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockTripwire.java
-+++ b/net/minecraft/server/BlockTripwire.java
-@@ -5,6 +5,8 @@
- import java.util.Map;
- import java.util.Random;
+--- a/net/minecraft/world/level/block/BlockTripwire.java
++++ b/net/minecraft/world/level/block/BlockTripwire.java
+@@ -23,6 +23,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit
+
public class BlockTripwire extends Block {
public static final BlockStateBoolean POWERED = BlockProperties.w;
-@@ -132,6 +134,40 @@
+@@ -150,6 +152,40 @@
}
}
diff --git a/nms-patches/net/minecraft/world/level/block/BlockTripwireHook.patch b/nms-patches/net/minecraft/world/level/block/BlockTripwireHook.patch
index 2495fbbb9..255d64077 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockTripwireHook.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockTripwireHook.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockTripwireHook.java
-+++ b/net/minecraft/server/BlockTripwireHook.java
-@@ -4,6 +4,8 @@
- import java.util.Random;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/BlockTripwireHook.java
++++ b/net/minecraft/world/level/block/BlockTripwireHook.java
+@@ -25,6 +25,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
+
public class BlockTripwireHook extends Block {
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
-@@ -134,6 +136,17 @@
+@@ -155,6 +157,17 @@
this.a(world, blockposition1, flag4, flag5, flag2, flag3);
}
diff --git a/nms-patches/net/minecraft/world/level/block/BlockTurtleEgg.patch b/nms-patches/net/minecraft/world/level/block/BlockTurtleEgg.patch
index 5c7a4610b..1413c1598 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockTurtleEgg.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockTurtleEgg.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BlockTurtleEgg.java
-+++ b/net/minecraft/server/BlockTurtleEgg.java
-@@ -3,6 +3,12 @@
- import java.util.Random;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/BlockTurtleEgg.java
++++ b/net/minecraft/world/level/block/BlockTurtleEgg.java
+@@ -29,6 +29,12 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
+import org.bukkit.event.entity.EntityInteractEvent;
@@ -13,7 +13,7 @@
public class BlockTurtleEgg extends Block {
private static final VoxelShape c = Block.a(3.0D, 0.0D, 3.0D, 12.0D, 7.0D, 12.0D);
-@@ -36,6 +42,19 @@
+@@ -62,6 +68,19 @@
IBlockData iblockdata = world.getType(blockposition);
if (iblockdata.a(Blocks.TURTLE_EGG)) {
@@ -33,7 +33,7 @@
this.a(world, blockposition, iblockdata);
}
}
-@@ -62,9 +81,19 @@
+@@ -88,9 +107,19 @@
int i = (Integer) iblockdata.get(BlockTurtleEgg.a);
if (i < 2) {
@@ -54,7 +54,7 @@
worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_EGG_HATCH, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F);
worldserver.a(blockposition, false);
-@@ -75,7 +104,7 @@
+@@ -101,7 +130,7 @@
entityturtle.setAgeRaw(-24000);
entityturtle.setHomePos(blockposition);
entityturtle.setPositionRotation((double) blockposition.getX() + 0.3D + (double) j * 0.2D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.3D, 0.0F, 0.0F);
diff --git a/nms-patches/net/minecraft/world/level/block/BlockVine.patch b/nms-patches/net/minecraft/world/level/block/BlockVine.patch
index 4b8c62e9d..61690537d 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockVine.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockVine.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/BlockVine.java
-+++ b/net/minecraft/server/BlockVine.java
-@@ -8,6 +8,8 @@
- import java.util.stream.Collectors;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/BlockVine.java
++++ b/net/minecraft/world/level/block/BlockVine.java
+@@ -23,6 +23,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+ import net.minecraft.world.phys.shapes.VoxelShapes;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockVine extends Block {
public static final BlockStateBoolean UP = BlockSprawling.e;
-@@ -175,20 +177,24 @@
+@@ -190,20 +192,24 @@
BlockPosition blockposition3 = blockposition2.shift(enumdirection1);
BlockPosition blockposition4 = blockposition2.shift(enumdirection2);
@@ -39,7 +39,7 @@
}
} else if (a((IBlockAccess) worldserver, blockposition2, enumdirection)) {
worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.set(getDirection(enumdirection), true), 2);
-@@ -218,7 +224,7 @@
+@@ -233,7 +239,7 @@
}
if (this.canSpread(iblockdata2)) {
@@ -48,7 +48,7 @@
}
return;
-@@ -233,7 +239,7 @@
+@@ -248,7 +254,7 @@
IBlockData iblockdata4 = this.a(iblockdata, iblockdata3, random);
if (iblockdata3 != iblockdata4 && this.canSpread(iblockdata4)) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockWaterLily.patch b/nms-patches/net/minecraft/world/level/block/BlockWaterLily.patch
index 0119b98d7..ab1490aa6 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockWaterLily.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockWaterLily.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockWaterLily.java
-+++ b/net/minecraft/server/BlockWaterLily.java
-@@ -11,7 +11,7 @@
+--- a/net/minecraft/world/level/block/BlockWaterLily.java
++++ b/net/minecraft/world/level/block/BlockWaterLily.java
+@@ -25,7 +25,7 @@
@Override
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
super.a(iblockdata, world, blockposition, entity);
diff --git a/nms-patches/net/minecraft/world/level/block/BlockWitherRose.patch b/nms-patches/net/minecraft/world/level/block/BlockWitherRose.patch
index ee9660f47..f3ac4af49 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockWitherRose.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockWitherRose.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BlockWitherRose.java
-+++ b/net/minecraft/server/BlockWitherRose.java
-@@ -18,7 +18,7 @@
+--- a/net/minecraft/world/level/block/BlockWitherRose.java
++++ b/net/minecraft/world/level/block/BlockWitherRose.java
+@@ -31,7 +31,7 @@
EntityLiving entityliving = (EntityLiving) entity;
if (!entityliving.isInvulnerable(DamageSource.WITHER)) {
diff --git a/nms-patches/net/minecraft/world/level/block/BlockWitherSkull.patch b/nms-patches/net/minecraft/world/level/block/BlockWitherSkull.patch
index 1bdd7edaf..19c83f006 100644
--- a/nms-patches/net/minecraft/world/level/block/BlockWitherSkull.patch
+++ b/nms-patches/net/minecraft/world/level/block/BlockWitherSkull.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BlockWitherSkull.java
-+++ b/net/minecraft/server/BlockWitherSkull.java
-@@ -3,6 +3,11 @@
- import java.util.Iterator;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/BlockWitherSkull.java
++++ b/net/minecraft/world/level/block/BlockWitherSkull.java
+@@ -27,6 +27,11 @@
+ import net.minecraft.world.level.block.state.predicate.MaterialPredicate;
+ import net.minecraft.world.level.material.Material;
+// CraftBukkit start
+import org.bukkit.craftbukkit.util.BlockStateListPopulator;
@@ -12,7 +12,7 @@
public class BlockWitherSkull extends BlockSkull {
@Nullable
-@@ -26,6 +31,7 @@
+@@ -50,6 +55,7 @@
}
public static void a(World world, BlockPosition blockposition, TileEntitySkull tileentityskull) {
@@ -20,7 +20,7 @@
if (!world.isClientSide) {
IBlockData iblockdata = tileentityskull.getBlock();
boolean flag = iblockdata.a(Blocks.WITHER_SKELETON_SKULL) || iblockdata.a(Blocks.WITHER_SKELETON_WALL_SKULL);
-@@ -35,12 +41,14 @@
+@@ -59,12 +65,14 @@
ShapeDetector.ShapeDetectorCollection shapedetector_shapedetectorcollection = shapedetector.a(world, blockposition);
if (shapedetector_shapedetectorcollection != null) {
@@ -37,7 +37,7 @@
}
}
-@@ -50,6 +58,15 @@
+@@ -74,6 +82,15 @@
entitywither.setPositionRotation((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.55D, (double) blockposition1.getZ() + 0.5D, shapedetector_shapedetectorcollection.getFacing().n() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F, 0.0F);
entitywither.aA = shapedetector_shapedetectorcollection.getFacing().n() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F;
entitywither.beginSpawnSequence();
@@ -53,7 +53,7 @@
Iterator iterator = world.a(EntityPlayer.class, entitywither.getBoundingBox().g(50.0D)).iterator();
while (iterator.hasNext()) {
-@@ -58,7 +75,7 @@
+@@ -82,7 +99,7 @@
CriterionTriggers.n.a(entityplayer, (Entity) entitywither);
}
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntity.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntity.patch
index 02fa490c3..ad16478e8 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntity.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntity.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/TileEntity.java
-+++ b/net/minecraft/server/TileEntity.java
-@@ -5,8 +5,18 @@
+--- a/net/minecraft/world/level/block/entity/TileEntity.java
++++ b/net/minecraft/world/level/block/entity/TileEntity.java
+@@ -15,8 +15,18 @@
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.util.Supplier;
@@ -19,14 +19,14 @@
private static final Logger LOGGER = LogManager.getLogger();
private final TileEntityTypes> tileType;
@Nullable
-@@ -38,6 +48,14 @@
+@@ -48,6 +58,14 @@
public void load(IBlockData iblockdata, NBTTagCompound nbttagcompound) {
this.position = new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z"));
+ // CraftBukkit start - read container
+ this.persistentDataContainer = new CraftPersistentDataContainer(DATA_TYPE_REGISTRY);
+
-+ NBTBase persistentDataTag = nbttagcompound.get("PublicBukkitValues");
++ net.minecraft.nbt.NBTBase persistentDataTag = nbttagcompound.get("PublicBukkitValues");
+ if (persistentDataTag instanceof NBTTagCompound) {
+ this.persistentDataContainer.putAll((NBTTagCompound) persistentDataTag);
+ }
@@ -34,7 +34,7 @@
}
public NBTTagCompound save(NBTTagCompound nbttagcompound) {
-@@ -54,6 +72,11 @@
+@@ -64,6 +82,11 @@
nbttagcompound.setInt("x", this.position.getX());
nbttagcompound.setInt("y", this.position.getY());
nbttagcompound.setInt("z", this.position.getZ());
@@ -46,7 +46,7 @@
return nbttagcompound;
}
}
-@@ -169,4 +192,13 @@
+@@ -179,4 +202,13 @@
}, this::getPosition});
}
}
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityBanner.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityBanner.patch
index d0c233678..c868fd0a5 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityBanner.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityBanner.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/TileEntityBanner.java
-+++ b/net/minecraft/server/TileEntityBanner.java
-@@ -70,6 +70,11 @@
+--- a/net/minecraft/world/level/block/entity/TileEntityBanner.java
++++ b/net/minecraft/world/level/block/entity/TileEntityBanner.java
+@@ -80,6 +80,11 @@
}
this.patterns = nbttagcompound.getList("Patterns", 10);
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityBarrel.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityBarrel.patch
index 33e51f722..68f3dbc44 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityBarrel.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityBarrel.patch
@@ -1,7 +1,8 @@
---- a/net/minecraft/server/TileEntityBarrel.java
-+++ b/net/minecraft/server/TileEntityBarrel.java
-@@ -1,7 +1,49 @@
- package net.minecraft.server;
+--- a/net/minecraft/world/level/block/entity/TileEntityBarrel.java
++++ b/net/minecraft/world/level/block/entity/TileEntityBarrel.java
+@@ -19,8 +19,50 @@
+ import net.minecraft.world.level.block.Blocks;
+ import net.minecraft.world.level.block.state.IBlockData;
+// CraftBukkit start
+import java.util.ArrayList;
@@ -50,7 +51,7 @@
private NonNullList items;
private int b;
-@@ -100,7 +142,7 @@
+@@ -119,7 +161,7 @@
return;
}
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityBeacon.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityBeacon.patch
index 7e21b75f4..1a7f81d98 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityBeacon.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityBeacon.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/TileEntityBeacon.java
-+++ b/net/minecraft/server/TileEntityBeacon.java
-@@ -8,6 +8,11 @@
- import java.util.stream.Collectors;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/entity/TileEntityBeacon.java
++++ b/net/minecraft/world/level/block/entity/TileEntityBeacon.java
+@@ -38,6 +38,11 @@
+ import net.minecraft.world.level.levelgen.HeightMap;
+ import net.minecraft.world.phys.AxisAlignedBB;
+// CraftBukkit start
+import org.bukkit.craftbukkit.potion.CraftPotionUtil;
@@ -12,7 +12,7 @@
public class TileEntityBeacon extends TileEntity implements ITileInventory, ITickable {
public static final MobEffectList[][] a = new MobEffectList[][]{{MobEffects.FASTER_MOVEMENT, MobEffects.FASTER_DIG}, {MobEffects.RESISTANCE, MobEffects.JUMP}, {MobEffects.INCREASE_DAMAGE}, {MobEffects.REGENERATION}};
-@@ -24,6 +29,15 @@
+@@ -54,6 +59,15 @@
public IChatBaseComponent customName;
public ChestLock chestLock;
private final IContainerProperties containerProperties;
@@ -28,7 +28,7 @@
public TileEntityBeacon() {
super(TileEntityTypes.BEACON);
-@@ -192,39 +206,78 @@
+@@ -222,39 +236,78 @@
super.al_();
}
@@ -117,7 +117,7 @@
public void a(SoundEffect soundeffect) {
this.world.playSound((EntityHuman) null, this.position, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F);
}
-@@ -254,8 +307,11 @@
+@@ -284,8 +337,11 @@
@Override
public void load(IBlockData iblockdata, NBTTagCompound nbttagcompound) {
super.load(iblockdata, nbttagcompound);
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityBeehive.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityBeehive.patch
index be9f67377..f54259dec 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityBeehive.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityBeehive.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/TileEntityBeehive.java
-+++ b/net/minecraft/server/TileEntityBeehive.java
-@@ -10,6 +10,7 @@
+--- a/net/minecraft/world/level/block/entity/TileEntityBeehive.java
++++ b/net/minecraft/world/level/block/entity/TileEntityBeehive.java
+@@ -29,6 +29,7 @@
private final List bees = Lists.newArrayList();
@Nullable
public BlockPosition flowerPos = null;
@@ -8,7 +8,7 @@
public TileEntityBeehive() {
super(TileEntityTypes.BEEHIVE);
-@@ -49,7 +50,7 @@
+@@ -68,7 +69,7 @@
}
public boolean isFull() {
@@ -17,7 +17,7 @@
}
public void a(@Nullable EntityHuman entityhuman, IBlockData iblockdata, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus) {
-@@ -66,7 +67,7 @@
+@@ -85,7 +86,7 @@
if (entityhuman.getPositionVector().distanceSquared(entity.getPositionVector()) <= 16.0D) {
if (!this.isSedated()) {
@@ -26,7 +26,7 @@
} else {
entitybee.setCannotEnterHiveTicks(400);
}
-@@ -78,10 +79,16 @@
+@@ -97,10 +98,16 @@
}
private List releaseBees(IBlockData iblockdata, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus) {
@@ -44,7 +44,7 @@
});
return list;
}
-@@ -107,7 +114,19 @@
+@@ -126,7 +133,19 @@
}
public void a(Entity entity, boolean flag, int i) {
@@ -65,7 +65,7 @@
entity.stopRiding();
entity.ejectPassengers();
NBTTagCompound nbttagcompound = new NBTTagCompound();
-@@ -133,7 +152,13 @@
+@@ -152,7 +171,13 @@
}
private boolean releaseBee(IBlockData iblockdata, TileEntityBeehive.HiveBee tileentitybeehive_hivebee, @Nullable List list, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus) {
@@ -80,7 +80,7 @@
return false;
} else {
BlockPosition blockposition = this.getPosition();
-@@ -157,6 +182,18 @@
+@@ -176,6 +201,18 @@
if (!entity.getEntityType().a((Tag) TagsEntity.BEEHIVE_INHABITORS)) {
return false;
} else {
@@ -99,7 +99,7 @@
if (entity instanceof EntityBee) {
EntityBee entitybee = (EntityBee) entity;
-@@ -186,6 +223,7 @@
+@@ -205,6 +242,7 @@
list.add(entitybee);
}
@@ -107,7 +107,7 @@
float f = entity.getWidth();
double d0 = flag ? 0.0D : 0.55D + (double) (f / 2.0F);
double d1 = (double) blockposition.getX() + 0.5D + d0 * (double) enumdirection.getAdjacentX();
-@@ -193,10 +231,11 @@
+@@ -212,10 +250,11 @@
double d3 = (double) blockposition.getZ() + 0.5D + d0 * (double) enumdirection.getAdjacentZ();
entity.setPositionRotation(d1, d2, d3, entity.yaw, entity.pitch);
@@ -120,7 +120,7 @@
}
} else {
return false;
-@@ -234,6 +273,10 @@
+@@ -253,6 +292,10 @@
if (this.releaseBee(iblockdata, tileentitybeehive_hivebee, (List) null, tileentitybeehive_releasestatus)) {
iterator.remove();
@@ -131,7 +131,7 @@
}
}
}
-@@ -276,6 +319,11 @@
+@@ -295,6 +338,11 @@
this.flowerPos = GameProfileSerializer.b(nbttagcompound.getCompound("FlowerPos"));
}
@@ -143,7 +143,7 @@
}
@Override
-@@ -285,6 +333,7 @@
+@@ -304,6 +352,7 @@
if (this.x()) {
nbttagcompound.set("FlowerPos", GameProfileSerializer.a(this.flowerPos));
}
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityBrewingStand.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityBrewingStand.patch
index 7a84c06ce..9538973c3 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityBrewingStand.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityBrewingStand.patch
@@ -1,11 +1,12 @@
---- a/net/minecraft/server/TileEntityBrewingStand.java
-+++ b/net/minecraft/server/TileEntityBrewingStand.java
-@@ -4,6 +4,16 @@
- import java.util.Iterator;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/entity/TileEntityBrewingStand.java
++++ b/net/minecraft/world/level/block/entity/TileEntityBrewingStand.java
+@@ -24,6 +24,17 @@
+ import net.minecraft.world.level.block.BlockBrewingStand;
+ import net.minecraft.world.level.block.state.IBlockData;
+// CraftBukkit start
+import java.util.List;
++import net.minecraft.server.MinecraftServer;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.entity.HumanEntity;
@@ -17,7 +18,7 @@
public class TileEntityBrewingStand extends TileEntityContainer implements IWorldInventory, ITickable {
private static final int[] b = new int[]{3};
-@@ -15,6 +25,36 @@
+@@ -35,6 +46,36 @@
private Item k;
public int fuelLevel;
protected final IContainerProperties a;
@@ -54,7 +55,7 @@
public TileEntityBrewingStand() {
super(TileEntityTypes.BREWING_STAND);
-@@ -83,8 +123,19 @@
+@@ -103,8 +144,19 @@
ItemStack itemstack = (ItemStack) this.items.get(4);
if (this.fuelLevel <= 0 && itemstack.getItem() == Items.BLAZE_POWDER) {
@@ -76,7 +77,7 @@
this.update();
}
-@@ -92,9 +143,14 @@
+@@ -112,9 +164,14 @@
boolean flag1 = this.brewTime > 0;
ItemStack itemstack1 = (ItemStack) this.items.get(3);
@@ -93,7 +94,7 @@
if (flag2 && flag) {
this.j();
-@@ -168,6 +224,16 @@
+@@ -188,6 +245,16 @@
private void j() {
ItemStack itemstack = (ItemStack) this.items.get(3);
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityCampfire.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityCampfire.patch
index 3c5707e62..8f82afe03 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityCampfire.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityCampfire.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/TileEntityCampfire.java
-+++ b/net/minecraft/server/TileEntityCampfire.java
-@@ -4,6 +4,12 @@
- import java.util.Random;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/entity/TileEntityCampfire.java
++++ b/net/minecraft/world/level/block/entity/TileEntityCampfire.java
+@@ -21,6 +21,12 @@
+ import net.minecraft.world.level.block.BlockCampfire;
+ import net.minecraft.world.level.block.state.IBlockData;
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock;
@@ -13,7 +13,7 @@
public class TileEntityCampfire extends TileEntity implements Clearable, ITickable {
private final NonNullList items;
-@@ -55,6 +61,20 @@
+@@ -72,6 +78,20 @@
}).orElse(itemstack);
BlockPosition blockposition = this.getPosition();
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityChest.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityChest.patch
index 472afa044..ff36b5dd6 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityChest.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityChest.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/TileEntityChest.java
-+++ b/net/minecraft/server/TileEntityChest.java
-@@ -3,6 +3,11 @@
- import java.util.Iterator;
- import java.util.List;
+--- a/net/minecraft/world/level/block/entity/TileEntityChest.java
++++ b/net/minecraft/world/level/block/entity/TileEntityChest.java
+@@ -27,6 +27,12 @@
+ import net.minecraft.world.level.block.state.properties.BlockPropertyChestType;
+ import net.minecraft.world.phys.AxisAlignedBB;
+// CraftBukkit start
++import net.minecraft.world.level.block.Blocks;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.entity.HumanEntity;
+// CraftBukkit end
@@ -12,7 +13,7 @@
public class TileEntityChest extends TileEntityLootable implements ITickable {
private NonNullList items;
-@@ -11,6 +16,37 @@
+@@ -35,6 +41,37 @@
public int viewingCount;
private int j;
@@ -50,7 +51,7 @@
protected TileEntityChest(TileEntityTypes> tileentitytypes) {
super(tileentitytypes);
this.items = NonNullList.a(27, ItemStack.b);
-@@ -61,6 +97,13 @@
+@@ -85,6 +122,13 @@
this.b = this.a;
float f = 0.1F;
@@ -64,7 +65,7 @@
if (this.viewingCount > 0 && this.a == 0.0F) {
this.playOpenSound(SoundEffects.BLOCK_CHEST_OPEN);
}
-@@ -155,8 +198,20 @@
+@@ -179,8 +223,20 @@
if (this.viewingCount < 0) {
this.viewingCount = 0;
}
@@ -85,7 +86,7 @@
this.onOpen();
}
-@@ -165,7 +220,18 @@
+@@ -189,7 +245,18 @@
@Override
public void closeContainer(EntityHuman entityhuman) {
if (!entityhuman.isSpectator()) {
@@ -104,7 +105,7 @@
this.onOpen();
}
-@@ -175,7 +241,7 @@
+@@ -199,7 +266,7 @@
Block block = this.getBlock().getBlock();
if (block instanceof BlockChest) {
@@ -113,7 +114,7 @@
this.world.applyPhysics(this.position, block);
}
-@@ -216,4 +282,11 @@
+@@ -240,4 +307,11 @@
protected Container createContainer(int i, PlayerInventory playerinventory) {
return ContainerChest.a(i, playerinventory, this);
}
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityCommand.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityCommand.patch
index ab30886d3..be8d2691d 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityCommand.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityCommand.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/TileEntityCommand.java
-+++ b/net/minecraft/server/TileEntityCommand.java
-@@ -9,6 +9,13 @@
+--- a/net/minecraft/world/level/block/entity/TileEntityCommand.java
++++ b/net/minecraft/world/level/block/entity/TileEntityCommand.java
+@@ -24,6 +24,13 @@
private boolean c;
private boolean g;
private final CommandBlockListenerAbstract h = new CommandBlockListenerAbstract() {
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityConduit.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityConduit.patch
index 28ce81948..ea6e09941 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityConduit.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityConduit.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/TileEntityConduit.java
-+++ b/net/minecraft/server/TileEntityConduit.java
-@@ -7,6 +7,11 @@
- import java.util.UUID;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/entity/TileEntityConduit.java
++++ b/net/minecraft/world/level/block/entity/TileEntityConduit.java
+@@ -27,6 +27,11 @@
+ import net.minecraft.world.phys.AxisAlignedBB;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock;
@@ -12,7 +12,7 @@
public class TileEntityConduit extends TileEntity implements ITickable {
private static final Block[] b = new Block[]{Blocks.PRISMARINE, Blocks.PRISMARINE_BRICKS, Blocks.SEA_LANTERN, Blocks.DARK_PRISMARINE};
-@@ -158,7 +163,7 @@
+@@ -178,7 +183,7 @@
EntityHuman entityhuman = (EntityHuman) iterator.next();
if (this.position.a((BaseBlockPosition) entityhuman.getChunkCoordinates(), (double) j) && entityhuman.isInWaterOrRain()) {
@@ -21,7 +21,7 @@
}
}
-@@ -175,7 +180,7 @@
+@@ -195,7 +200,7 @@
this.target = this.x();
this.k = null;
} else if (this.target == null) {
@@ -30,7 +30,7 @@
return entityliving1 instanceof IMonster && entityliving1.isInWaterOrRain();
});
-@@ -187,8 +192,13 @@
+@@ -207,8 +212,13 @@
}
if (this.target != null) {
@@ -46,7 +46,7 @@
}
if (entityliving != this.target) {
-@@ -221,7 +231,7 @@
+@@ -241,7 +251,7 @@
@Nullable
private EntityLiving x() {
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityContainer.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityContainer.patch
index f9473c325..be760114c 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityContainer.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityContainer.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/TileEntityContainer.java
-+++ b/net/minecraft/server/TileEntityContainer.java
-@@ -76,4 +76,12 @@
+--- a/net/minecraft/world/level/block/entity/TileEntityContainer.java
++++ b/net/minecraft/world/level/block/entity/TileEntityContainer.java
+@@ -89,4 +89,12 @@
}
protected abstract Container createContainer(int i, PlayerInventory playerinventory);
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityDispenser.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityDispenser.patch
index 713cfd14d..816d1d7fa 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityDispenser.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityDispenser.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/TileEntityDispenser.java
-+++ b/net/minecraft/server/TileEntityDispenser.java
-@@ -2,11 +2,48 @@
-
- import java.util.Random;
+--- a/net/minecraft/world/level/block/entity/TileEntityDispenser.java
++++ b/net/minecraft/world/level/block/entity/TileEntityDispenser.java
+@@ -13,11 +13,48 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.level.block.state.IBlockData;
+// CraftBukkit start
+import java.util.List;
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityEndGateway.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityEndGateway.patch
index eab984a8b..0c6644746 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityEndGateway.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityEndGateway.patch
@@ -1,10 +1,11 @@
---- a/net/minecraft/server/TileEntityEndGateway.java
-+++ b/net/minecraft/server/TileEntityEndGateway.java
-@@ -7,6 +7,13 @@
+--- a/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
++++ b/net/minecraft/world/level/block/entity/TileEntityEndGateway.java
+@@ -30,6 +30,14 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
++import net.minecraft.world.level.dimension.DimensionManager;
+import org.bukkit.Bukkit;
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.entity.CraftPlayer;
@@ -14,7 +15,7 @@
public class TileEntityEndGateway extends TileEntityEnderPortal implements ITickable {
private static final Logger LOGGER = LogManager.getLogger();
-@@ -117,7 +124,7 @@
+@@ -140,7 +148,7 @@
public void b(Entity entity) {
if (this.world instanceof WorldServer && !this.f()) {
this.c = 100;
@@ -23,7 +24,7 @@
this.a((WorldServer) this.world);
}
-@@ -142,6 +149,27 @@
+@@ -165,6 +173,27 @@
entity1 = entity.getRootVehicle();
}
@@ -51,7 +52,7 @@
entity1.resetPortalCooldown();
entity1.enderTeleportAndLoad((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D);
}
-@@ -246,7 +274,7 @@
+@@ -269,7 +298,7 @@
}
private void a(WorldServer worldserver, BlockPosition blockposition) {
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityFurnace.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityFurnace.patch
index 7d941a262..09d4e7073 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityFurnace.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityFurnace.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/TileEntityFurnace.java
-+++ b/net/minecraft/server/TileEntityFurnace.java
-@@ -10,6 +10,17 @@
- import java.util.Map;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/entity/TileEntityFurnace.java
++++ b/net/minecraft/world/level/block/entity/TileEntityFurnace.java
+@@ -39,6 +39,17 @@
+ import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.craftbukkit.block.CraftBlock;
@@ -18,7 +18,7 @@
public abstract class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput, ITickable {
private static final int[] g = new int[]{0};
-@@ -137,6 +148,36 @@
+@@ -166,6 +177,36 @@
return map;
}
@@ -55,7 +55,7 @@
private static boolean b(Item item) {
return TagsItem.NON_FLAMMABLE_WOOD.isTagged(item);
}
-@@ -223,12 +264,23 @@
+@@ -252,12 +293,23 @@
this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.cookTimeTotal);
}
} else {
@@ -82,7 +82,7 @@
flag1 = true;
if (!itemstack.isEmpty()) {
Item item = itemstack.getItem();
-@@ -290,11 +342,38 @@
+@@ -319,11 +371,38 @@
ItemStack itemstack1 = irecipe.getResult();
ItemStack itemstack2 = (ItemStack) this.items.get(2);
@@ -121,7 +121,7 @@
if (!this.world.isClientSide) {
this.a(irecipe);
-@@ -319,7 +398,7 @@
+@@ -348,7 +427,7 @@
}
protected int getRecipeCookingTime() {
@@ -130,7 +130,7 @@
}
public static boolean isFuel(ItemStack itemstack) {
-@@ -446,14 +525,20 @@
+@@ -475,14 +554,20 @@
@Override
public void b(EntityHuman entityhuman) {}
@@ -153,7 +153,7 @@
List> list = Lists.newArrayList();
ObjectIterator objectiterator = this.n.object2IntEntrySet().iterator();
-@@ -462,14 +547,14 @@
+@@ -491,14 +576,14 @@
world.getCraftingManager().getRecipe((MinecraftKey) entry.getKey()).ifPresent((irecipe) -> {
list.add(irecipe);
@@ -170,7 +170,7 @@
int j = MathHelper.d((float) i * f);
float f1 = MathHelper.h((float) i * f);
-@@ -477,6 +562,14 @@
+@@ -506,6 +591,14 @@
++j;
}
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityHopper.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityHopper.patch
index 95d74de83..9b5878b37 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityHopper.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityHopper.patch
@@ -1,10 +1,12 @@
---- a/net/minecraft/server/TileEntityHopper.java
-+++ b/net/minecraft/server/TileEntityHopper.java
-@@ -7,12 +7,51 @@
- import java.util.stream.IntStream;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/entity/TileEntityHopper.java
++++ b/net/minecraft/world/level/block/entity/TileEntityHopper.java
+@@ -33,12 +33,53 @@
+ import net.minecraft.world.phys.shapes.OperatorBoolean;
+ import net.minecraft.world.phys.shapes.VoxelShapes;
+// CraftBukkit start
++import net.minecraft.world.InventoryLargeChest;
++import net.minecraft.world.entity.vehicle.EntityMinecartHopper;
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
+import org.bukkit.entity.HumanEntity;
@@ -52,7 +54,7 @@
public TileEntityHopper() {
super(TileEntityTypes.HOPPER);
this.items = NonNullList.a(5, ItemStack.b);
-@@ -138,7 +177,28 @@
+@@ -164,7 +205,28 @@
for (int i = 0; i < this.getSize(); ++i) {
if (!this.getItem(i).isEmpty()) {
ItemStack itemstack = this.getItem(i).cloneItemStack();
@@ -82,7 +84,7 @@
if (itemstack1.isEmpty()) {
iinventory.update();
-@@ -203,7 +263,34 @@
+@@ -229,7 +291,34 @@
if (!itemstack.isEmpty() && b(iinventory, itemstack, i, enumdirection)) {
ItemStack itemstack1 = itemstack.cloneItemStack();
@@ -118,7 +120,7 @@
if (itemstack2.isEmpty()) {
iinventory.update();
-@@ -218,6 +305,13 @@
+@@ -244,6 +333,13 @@
public static boolean a(IInventory iinventory, EntityItem entityitem) {
boolean flag = false;
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityLectern.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityLectern.patch
index bf78093c0..dce66b812 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityLectern.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityLectern.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/TileEntityLectern.java
-+++ b/net/minecraft/server/TileEntityLectern.java
-@@ -2,9 +2,63 @@
-
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/entity/TileEntityLectern.java
++++ b/net/minecraft/world/level/block/entity/TileEntityLectern.java
+@@ -27,9 +27,63 @@
+ import net.minecraft.world.phys.Vec2F;
+ import net.minecraft.world.phys.Vec3D;
-public class TileEntityLectern extends TileEntity implements Clearable, ITileInventory {
+// CraftBukkit start
@@ -66,7 +66,7 @@
@Override
public int getSize() {
return 1;
-@@ -49,11 +103,20 @@
+@@ -74,11 +128,20 @@
}
@Override
@@ -89,7 +89,7 @@
}
@Override
-@@ -135,7 +198,7 @@
+@@ -160,7 +223,7 @@
if (j != this.page) {
this.page = j;
this.update();
@@ -98,7 +98,7 @@
}
}
-@@ -158,6 +221,32 @@
+@@ -183,6 +246,32 @@
return itemstack;
}
@@ -131,7 +131,7 @@
private CommandListenerWrapper a(@Nullable EntityHuman entityhuman) {
String s;
Object object;
-@@ -172,7 +261,8 @@
+@@ -197,7 +286,8 @@
Vec3D vec3d = Vec3D.a((BaseBlockPosition) this.position);
@@ -141,7 +141,7 @@
}
@Override
-@@ -211,7 +301,7 @@
+@@ -236,7 +326,7 @@
@Override
public Container createMenu(int i, PlayerInventory playerinventory, EntityHuman entityhuman) {
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntityShulkerBox.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntityShulkerBox.patch
index aedaf4311..119673267 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntityShulkerBox.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntityShulkerBox.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/TileEntityShulkerBox.java
-+++ b/net/minecraft/server/TileEntityShulkerBox.java
-@@ -4,6 +4,11 @@
- import java.util.stream.IntStream;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/entity/TileEntityShulkerBox.java
++++ b/net/minecraft/world/level/block/entity/TileEntityShulkerBox.java
+@@ -29,6 +29,11 @@
+ import net.minecraft.world.phys.Vec3D;
+ import net.minecraft.world.phys.shapes.VoxelShapes;
+// CraftBukkit start
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
@@ -12,7 +12,7 @@
public class TileEntityShulkerBox extends TileEntityLootable implements IWorldInventory, ITickable {
private static final int[] a = IntStream.range(0, 27).toArray();
-@@ -16,6 +21,37 @@
+@@ -41,6 +46,37 @@
private EnumColor l;
private boolean m;
@@ -50,7 +50,7 @@
public TileEntityShulkerBox(@Nullable EnumColor enumcolor) {
super(TileEntityTypes.SHULKER_BOX);
this.contents = NonNullList.a(27, ItemStack.b);
-@@ -178,6 +214,7 @@
+@@ -203,6 +239,7 @@
}
++this.viewingCount;
@@ -58,7 +58,7 @@
this.world.playBlockAction(this.position, this.getBlock().getBlock(), 1, this.viewingCount);
if (this.viewingCount == 1) {
this.world.playSound((EntityHuman) null, this.position, SoundEffects.BLOCK_SHULKER_BOX_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
-@@ -190,6 +227,7 @@
+@@ -215,6 +252,7 @@
public void closeContainer(EntityHuman entityhuman) {
if (!entityhuman.isSpectator()) {
--this.viewingCount;
diff --git a/nms-patches/net/minecraft/world/level/block/entity/TileEntitySign.patch b/nms-patches/net/minecraft/world/level/block/entity/TileEntitySign.patch
index 096e174a3..41279c969 100644
--- a/nms-patches/net/minecraft/world/level/block/entity/TileEntitySign.patch
+++ b/nms-patches/net/minecraft/world/level/block/entity/TileEntitySign.patch
@@ -1,15 +1,15 @@
---- a/net/minecraft/server/TileEntitySign.java
-+++ b/net/minecraft/server/TileEntitySign.java
-@@ -3,7 +3,7 @@
- import com.mojang.brigadier.exceptions.CommandSyntaxException;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/entity/TileEntitySign.java
++++ b/net/minecraft/world/level/block/entity/TileEntitySign.java
+@@ -23,7 +23,7 @@
+ import net.minecraft.world.phys.Vec2F;
+ import net.minecraft.world.phys.Vec3D;
-public class TileEntitySign extends TileEntity {
+public class TileEntitySign extends TileEntity implements ICommandListener { // CraftBukkit - implements
public final IChatBaseComponent[] lines;
public boolean isEditable;
-@@ -29,6 +29,12 @@
+@@ -49,6 +49,12 @@
nbttagcompound.setString("Text" + (i + 1), s);
}
@@ -22,7 +22,7 @@
nbttagcompound.setString("Color", this.color.c());
return nbttagcompound;
}
-@@ -39,18 +45,38 @@
+@@ -59,18 +65,38 @@
super.load(iblockdata, nbttagcompound);
this.color = EnumColor.a(nbttagcompound.getString("Color"), EnumColor.BLACK);
@@ -68,7 +68,7 @@
}
this.g[i] = null;
-@@ -111,11 +137,37 @@
+@@ -131,11 +157,37 @@
return true;
}
@@ -107,7 +107,7 @@
}
public EnumColor getColor() {
-@@ -126,7 +178,7 @@
+@@ -146,7 +198,7 @@
if (enumcolor != this.getColor()) {
this.color = enumcolor;
this.update();
diff --git a/nms-patches/net/minecraft/world/level/block/grower/WorldGenMegaTreeProvider.patch b/nms-patches/net/minecraft/world/level/block/grower/WorldGenMegaTreeProvider.patch
index 34602daaa..e5a11ce1c 100644
--- a/nms-patches/net/minecraft/world/level/block/grower/WorldGenMegaTreeProvider.patch
+++ b/nms-patches/net/minecraft/world/level/block/grower/WorldGenMegaTreeProvider.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/WorldGenMegaTreeProvider.java
-+++ b/net/minecraft/server/WorldGenMegaTreeProvider.java
-@@ -30,6 +30,7 @@
+--- a/net/minecraft/world/level/block/grower/WorldGenMegaTreeProvider.java
++++ b/net/minecraft/world/level/block/grower/WorldGenMegaTreeProvider.java
+@@ -39,6 +39,7 @@
return false;
} else {
((WorldGenFeatureTreeConfiguration) worldgenfeatureconfigured.f).b();
diff --git a/nms-patches/net/minecraft/world/level/block/grower/WorldGenTreeProvider.patch b/nms-patches/net/minecraft/world/level/block/grower/WorldGenTreeProvider.patch
index 0d6d528c6..e7e3cdb13 100644
--- a/nms-patches/net/minecraft/world/level/block/grower/WorldGenTreeProvider.patch
+++ b/nms-patches/net/minecraft/world/level/block/grower/WorldGenTreeProvider.patch
@@ -1,15 +1,19 @@
---- a/net/minecraft/server/WorldGenTreeProvider.java
-+++ b/net/minecraft/server/WorldGenTreeProvider.java
-@@ -4,6 +4,8 @@
- import java.util.Random;
- import javax.annotation.Nullable;
+--- a/net/minecraft/world/level/block/grower/WorldGenTreeProvider.java
++++ b/net/minecraft/world/level/block/grower/WorldGenTreeProvider.java
+@@ -14,6 +14,12 @@
+ import net.minecraft.world.level.levelgen.feature.WorldGenFeatureConfigured;
+ import net.minecraft.world.level.levelgen.feature.configurations.WorldGenFeatureTreeConfiguration;
-+import org.bukkit.TreeType; // CraftBukkit
++// CraftBukkit start
++import net.minecraft.data.worldgen.BiomeDecoratorGroups;
++import net.minecraft.world.level.block.BlockSapling;
++import org.bukkit.TreeType;
++// CraftBukkit end
+
public abstract class WorldGenTreeProvider {
public WorldGenTreeProvider() {}
-@@ -17,6 +19,7 @@
+@@ -27,6 +33,7 @@
if (worldgenfeatureconfigured == null) {
return false;
} else {
@@ -17,7 +21,7 @@
worldserver.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 4);
((WorldGenFeatureTreeConfiguration) worldgenfeatureconfigured.f).b();
if (worldgenfeatureconfigured.a(worldserver, chunkgenerator, random, blockposition)) {
-@@ -43,4 +46,46 @@
+@@ -53,4 +60,46 @@
return true;
}
diff --git a/nms-patches/net/minecraft/world/level/block/piston/BlockPiston.patch b/nms-patches/net/minecraft/world/level/block/piston/BlockPiston.patch
index 041c191f6..4d88e6a44 100644
--- a/nms-patches/net/minecraft/world/level/block/piston/BlockPiston.patch
+++ b/nms-patches/net/minecraft/world/level/block/piston/BlockPiston.patch
@@ -1,8 +1,8 @@
---- a/net/minecraft/server/BlockPiston.java
-+++ b/net/minecraft/server/BlockPiston.java
-@@ -7,6 +7,14 @@
- import java.util.Map;
- import java.util.Map.Entry;
+--- a/net/minecraft/world/level/block/piston/BlockPiston.java
++++ b/net/minecraft/world/level/block/piston/BlockPiston.java
+@@ -36,6 +36,14 @@
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+ import net.minecraft.world.phys.shapes.VoxelShapes;
+// CraftBukkit start
+import com.google.common.collect.ImmutableList;
@@ -15,7 +15,7 @@
public class BlockPiston extends BlockDirectional {
public static final BlockStateBoolean EXTENDED = BlockProperties.g;
-@@ -103,6 +111,18 @@
+@@ -132,6 +140,18 @@
}
}
@@ -34,7 +34,7 @@
world.playBlockAction(blockposition, this, b0, enumdirection.c());
}
-@@ -279,6 +299,48 @@
+@@ -308,6 +328,48 @@
IBlockData[] aiblockdata = new IBlockData[list.size() + list2.size()];
EnumDirection enumdirection1 = flag ? enumdirection : enumdirection.opposite();
int j = 0;
diff --git a/nms-patches/net/minecraft/world/level/block/state/properties/BlockStateInteger.patch b/nms-patches/net/minecraft/world/level/block/state/properties/BlockStateInteger.patch
index 6c8682896..27e534f75 100644
--- a/nms-patches/net/minecraft/world/level/block/state/properties/BlockStateInteger.patch
+++ b/nms-patches/net/minecraft/world/level/block/state/properties/BlockStateInteger.patch
@@ -1,5 +1,5 @@
---- a/net/minecraft/server/BlockStateInteger.java
-+++ b/net/minecraft/server/BlockStateInteger.java
+--- a/net/minecraft/world/level/block/state/properties/BlockStateInteger.java
++++ b/net/minecraft/world/level/block/state/properties/BlockStateInteger.java
@@ -9,9 +9,15 @@
public class BlockStateInteger extends IBlockState {
diff --git a/nms-patches/net/minecraft/world/level/border/WorldBorder.patch b/nms-patches/net/minecraft/world/level/border/WorldBorder.patch
index 66e53f812..bcd2b2d6c 100644
--- a/nms-patches/net/minecraft/world/level/border/WorldBorder.patch
+++ b/nms-patches/net/minecraft/world/level/border/WorldBorder.patch
@@ -1,14 +1,14 @@
---- a/net/minecraft/server/WorldBorder.java
-+++ b/net/minecraft/server/WorldBorder.java
-@@ -17,6 +17,7 @@
+--- a/net/minecraft/world/level/border/WorldBorder.java
++++ b/net/minecraft/world/level/border/WorldBorder.java
+@@ -27,6 +27,7 @@
private int i = 29999984;
private WorldBorder.a j = new WorldBorder.d(6.0E7D);
public static final WorldBorder.c c = new WorldBorder.c(0.0D, 0.0D, 0.2D, 5.0D, 5, 15, 6.0E7D, 0L, 0.0D);
-+ public WorldServer world; // CraftBukkit
++ public net.minecraft.server.level.WorldServer world; // CraftBukkit
public WorldBorder() {}
-@@ -130,6 +131,7 @@
+@@ -140,6 +141,7 @@
}
public void a(IWorldBorderListener iworldborderlistener) {
diff --git a/nms-patches/net/minecraft/world/level/chunk/BiomeStorage.patch b/nms-patches/net/minecraft/world/level/chunk/BiomeStorage.patch
index 278584550..ba06164c4 100644
--- a/nms-patches/net/minecraft/world/level/chunk/BiomeStorage.patch
+++ b/nms-patches/net/minecraft/world/level/chunk/BiomeStorage.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/BiomeStorage.java
-+++ b/net/minecraft/server/BiomeStorage.java
-@@ -87,4 +87,14 @@
+--- a/net/minecraft/world/level/chunk/BiomeStorage.java
++++ b/net/minecraft/world/level/chunk/BiomeStorage.java
+@@ -93,4 +93,14 @@
return this.h[i1 << BiomeStorage.e + BiomeStorage.e | j1 << BiomeStorage.e | l];
}
diff --git a/nms-patches/net/minecraft/world/level/chunk/Chunk.patch b/nms-patches/net/minecraft/world/level/chunk/Chunk.patch
index b65a14732..66e0aaef6 100644
--- a/nms-patches/net/minecraft/world/level/chunk/Chunk.patch
+++ b/nms-patches/net/minecraft/world/level/chunk/Chunk.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/Chunk.java
-+++ b/net/minecraft/server/Chunk.java
-@@ -31,7 +31,7 @@
+--- a/net/minecraft/world/level/chunk/Chunk.java
++++ b/net/minecraft/world/level/chunk/Chunk.java
+@@ -65,7 +65,7 @@
private BiomeStorage d;
private final Map e;
public boolean loaded;
@@ -9,7 +9,7 @@
public final Map heightMap;
private final ChunkConverter i;
public final Map tileEntities;
-@@ -65,7 +65,7 @@
+@@ -99,7 +99,7 @@
this.m = Maps.newHashMap();
this.n = new ShortList[16];
this.entitySlices = (EntitySlice[]) (new EntitySlice[16]);
@@ -18,7 +18,7 @@
this.loc = chunkcoordintpair;
this.i = chunkconverter;
HeightMap.Type[] aheightmap_type = HeightMap.Type.values();
-@@ -96,8 +96,22 @@
+@@ -130,8 +130,22 @@
}
}
@@ -41,7 +41,7 @@
public Chunk(World world, ProtoChunk protochunk) {
this(world, protochunk.getPos(), protochunk.getBiomeIndex(), protochunk.p(), protochunk.n(), protochunk.o(), protochunk.getInhabitedTime(), protochunk.getSections(), (Consumer) null);
Iterator iterator = protochunk.y().iterator();
-@@ -139,6 +153,7 @@
+@@ -173,6 +187,7 @@
this.b(protochunk.r());
this.s = true;
@@ -49,7 +49,7 @@
}
@Override
-@@ -229,9 +244,16 @@
+@@ -263,9 +278,16 @@
}
}
@@ -66,17 +66,17 @@
int i = blockposition.getX() & 15;
int j = blockposition.getY();
int k = blockposition.getZ() & 15;
-@@ -283,7 +305,8 @@
+@@ -317,7 +339,8 @@
}
}
- if (!this.world.isClientSide) {
+ // CraftBukkit - Don't place while processing the BlockPlaceEvent, unless it's a BlockContainer. Prevents blocks such as TNT from activating when cancelled.
-+ if (!this.world.isClientSide && doPlace && (!this.world.captureBlockStates || block instanceof BlockTileEntity)) {
++ if (!this.world.isClientSide && doPlace && (!this.world.captureBlockStates || block instanceof net.minecraft.world.level.block.BlockTileEntity)) {
iblockdata.onPlace(this.world, blockposition, iblockdata1, flag);
}
-@@ -378,7 +401,12 @@
+@@ -412,7 +435,12 @@
@Nullable
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
@@ -90,13 +90,13 @@
if (tileentity == null) {
NBTTagCompound nbttagcompound = (NBTTagCompound) this.e.remove(blockposition);
-@@ -424,6 +452,13 @@
+@@ -458,6 +486,13 @@
tileentity1.al_();
}
+ // CraftBukkit start
+ } else {
-+ System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ()
++ System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.getPosition().getX() + "," + tileentity.getPosition().getY() + "," + tileentity.getPosition().getZ()
+ + " (" + getType(blockposition) + ") where there was no entity tile!");
+ System.out.println("Chunk coordinates: " + (this.loc.x * 16) + "," + (this.loc.z * 16));
+ new Exception().printStackTrace();
@@ -104,7 +104,7 @@
}
}
-@@ -473,6 +508,50 @@
+@@ -507,6 +542,50 @@
}
@@ -155,7 +155,7 @@
public void markDirty() {
this.s = true;
}
-@@ -526,7 +605,7 @@
+@@ -560,7 +639,7 @@
Iterator iterator = this.entitySlices[k].a(Entity.class).iterator();
while (iterator.hasNext()) {
@@ -164,7 +164,7 @@
if ((entitytypes == null || entity.getEntityType() == entitytypes) && entity.getBoundingBox().c(axisalignedbb) && predicate.test(entity)) {
list.add(entity);
-@@ -547,7 +626,7 @@
+@@ -581,7 +660,7 @@
Iterator iterator = this.entitySlices[k].a(oclass).iterator();
while (iterator.hasNext()) {
@@ -173,7 +173,7 @@
if (t0.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test(t0))) {
list.add(t0);
-@@ -621,7 +700,7 @@
+@@ -655,7 +734,7 @@
@Override
public boolean isNeedsSaving() {
@@ -182,7 +182,7 @@
}
public void d(boolean flag) {
-@@ -763,7 +842,7 @@
+@@ -797,7 +876,7 @@
public void B() {
if (this.o instanceof ProtoChunkTickList) {
@@ -191,7 +191,7 @@
return this.getType(blockposition).getBlock();
});
this.o = TickListEmpty.b();
-@@ -773,7 +852,7 @@
+@@ -807,7 +886,7 @@
}
if (this.p instanceof ProtoChunkTickList) {
@@ -200,7 +200,7 @@
return this.getFluid(blockposition).getType();
});
this.p = TickListEmpty.b();
-@@ -785,12 +864,12 @@
+@@ -819,12 +898,12 @@
}
public void a(WorldServer worldserver) {
diff --git a/nms-patches/net/minecraft/world/level/chunk/ChunkGenerator.patch b/nms-patches/net/minecraft/world/level/chunk/ChunkGenerator.patch
index 8f2c8cab5..87855a895 100644
--- a/nms-patches/net/minecraft/world/level/chunk/ChunkGenerator.patch
+++ b/nms-patches/net/minecraft/world/level/chunk/ChunkGenerator.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ChunkGenerator.java
-+++ b/net/minecraft/server/ChunkGenerator.java
-@@ -210,7 +210,16 @@
+--- a/net/minecraft/world/level/chunk/ChunkGenerator.java
++++ b/net/minecraft/world/level/chunk/ChunkGenerator.java
+@@ -246,7 +246,16 @@
while (iterator.hasNext()) {
Supplier> supplier = (Supplier) iterator.next();
@@ -18,7 +18,7 @@
}
}
-@@ -294,9 +303,11 @@
+@@ -330,9 +339,11 @@
}
static {
diff --git a/nms-patches/net/minecraft/world/level/chunk/ChunkStatus.patch b/nms-patches/net/minecraft/world/level/chunk/ChunkStatus.patch
index 49ba72886..f4ff21014 100644
--- a/nms-patches/net/minecraft/world/level/chunk/ChunkStatus.patch
+++ b/nms-patches/net/minecraft/world/level/chunk/ChunkStatus.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ChunkStatus.java
-+++ b/net/minecraft/server/ChunkStatus.java
-@@ -27,7 +27,7 @@
+--- a/net/minecraft/world/level/chunk/ChunkStatus.java
++++ b/net/minecraft/world/level/chunk/ChunkStatus.java
+@@ -38,7 +38,7 @@
});
public static final ChunkStatus STRUCTURE_STARTS = a("structure_starts", ChunkStatus.EMPTY, 0, ChunkStatus.n, ChunkStatus.Type.PROTOCHUNK, (chunkstatus, worldserver, chunkgenerator, definedstructuremanager, lightenginethreaded, function, list, ichunkaccess) -> {
if (!ichunkaccess.getChunkStatus().b(chunkstatus)) {
@@ -9,7 +9,7 @@
chunkgenerator.createStructures(worldserver.r(), worldserver.getStructureManager(), ichunkaccess, definedstructuremanager, worldserver.getSeed());
}
-@@ -90,7 +90,7 @@
+@@ -101,7 +101,7 @@
return (CompletableFuture) function.apply(ichunkaccess);
});
private static final List q = ImmutableList.of(ChunkStatus.FULL, ChunkStatus.FEATURES, ChunkStatus.LIQUID_CARVERS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS);
diff --git a/nms-patches/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.patch b/nms-patches/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.patch
index f77d3d98c..e7c43d03e 100644
--- a/nms-patches/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.patch
+++ b/nms-patches/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ChunkRegionLoader.java
-+++ b/net/minecraft/server/ChunkRegionLoader.java
-@@ -91,7 +91,7 @@
+--- a/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
++++ b/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
+@@ -133,7 +133,7 @@
if (nbttagcompound1.hasKeyOfType("TileTicks", 9)) {
nbttaglist1 = nbttagcompound1.getList("TileTicks", 10);
@@ -9,7 +9,7 @@
registryblocks = IRegistry.BLOCK;
registryblocks.getClass();
object1 = TickListChunk.a(nbttaglist1, function, registryblocks::get);
-@@ -103,7 +103,7 @@
+@@ -145,7 +145,7 @@
if (nbttagcompound1.hasKeyOfType("LiquidTicks", 9)) {
nbttaglist1 = nbttagcompound1.getList("LiquidTicks", 10);
@@ -18,12 +18,12 @@
registryblocks = IRegistry.FLUID;
registryblocks.getClass();
object2 = TickListChunk.a(nbttaglist1, function, registryblocks::get);
-@@ -113,6 +113,12 @@
+@@ -155,6 +155,12 @@
object = new Chunk(worldserver.getMinecraftWorld(), chunkcoordintpair, biomestorage, chunkconverter, (TickList) object1, (TickList) object2, j, achunksection, (chunk) -> {
loadEntities(nbttagcompound1, chunk);
+ // CraftBukkit start - load chunk persistent data from nbt
-+ NBTBase persistentBase = nbttagcompound1.get("ChunkBukkitValues");
++ net.minecraft.nbt.NBTBase persistentBase = nbttagcompound1.get("ChunkBukkitValues");
+ if (persistentBase instanceof NBTTagCompound) {
+ chunk.persistentDataContainer.putAll((NBTTagCompound) persistentBase);
+ }
@@ -31,7 +31,7 @@
});
} else {
ProtoChunk protochunk = new ProtoChunk(chunkcoordintpair, chunkconverter, achunksection, protochunkticklist, protochunkticklist1);
-@@ -246,8 +252,9 @@
+@@ -288,8 +294,9 @@
NBTTagCompound nbttagcompound2;
for (int i = -1; i < 17; ++i) {
@@ -42,7 +42,7 @@
}).findFirst().orElse(Chunk.a);
NibbleArray nibblearray = lightenginethreaded.a(EnumSkyBlock.BLOCK).a(SectionPosition.a(chunkcoordintpair, i));
NibbleArray nibblearray1 = lightenginethreaded.a(EnumSkyBlock.SKY).a(SectionPosition.a(chunkcoordintpair, i));
-@@ -302,6 +309,12 @@
+@@ -344,6 +351,12 @@
if (ichunkaccess.getChunkStatus().getType() == ChunkStatus.Type.LEVELCHUNK) {
Chunk chunk = (Chunk) ichunkaccess;
diff --git a/nms-patches/net/minecraft/world/level/chunk/storage/IChunkLoader.patch b/nms-patches/net/minecraft/world/level/chunk/storage/IChunkLoader.patch
index 780643b09..f4162d365 100644
--- a/nms-patches/net/minecraft/world/level/chunk/storage/IChunkLoader.patch
+++ b/nms-patches/net/minecraft/world/level/chunk/storage/IChunkLoader.patch
@@ -1,6 +1,21 @@
---- a/net/minecraft/server/IChunkLoader.java
-+++ b/net/minecraft/server/IChunkLoader.java
-@@ -18,10 +18,49 @@
+--- a/net/minecraft/world/level/chunk/storage/IChunkLoader.java
++++ b/net/minecraft/world/level/chunk/storage/IChunkLoader.java
+@@ -15,6 +15,14 @@
+ import net.minecraft.world.level.levelgen.structure.PersistentStructureLegacy;
+ import net.minecraft.world.level.storage.WorldPersistentData;
+
++// CraftBukkit start
++import net.minecraft.server.level.ChunkProviderServer;
++import net.minecraft.server.level.WorldServer;
++import net.minecraft.world.level.GeneratorAccess;
++import net.minecraft.world.level.chunk.ChunkStatus;
++import net.minecraft.world.level.dimension.DimensionManager;
++// CraftBukkit end
++
+ public class IChunkLoader implements AutoCloseable {
+
+ private final IOWorker a;
+@@ -27,10 +35,49 @@
this.a = new IOWorker(file, flag, "chunk");
}
diff --git a/nms-patches/net/minecraft/world/level/chunk/storage/RegionFileCache.patch b/nms-patches/net/minecraft/world/level/chunk/storage/RegionFileCache.patch
index 3a17b2ae0..4d73d3c09 100644
--- a/nms-patches/net/minecraft/world/level/chunk/storage/RegionFileCache.patch
+++ b/nms-patches/net/minecraft/world/level/chunk/storage/RegionFileCache.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/RegionFileCache.java
-+++ b/net/minecraft/server/RegionFileCache.java
-@@ -21,7 +21,7 @@
+--- a/net/minecraft/world/level/chunk/storage/RegionFileCache.java
++++ b/net/minecraft/world/level/chunk/storage/RegionFileCache.java
+@@ -25,7 +25,7 @@
this.c = flag;
}
@@ -9,7 +9,7 @@
long i = ChunkCoordIntPair.pair(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ());
RegionFile regionfile = (RegionFile) this.cache.getAndMoveToFirst(i);
-@@ -37,6 +37,7 @@
+@@ -41,6 +41,7 @@
}
File file = new File(this.b, "r." + chunkcoordintpair.getRegionX() + "." + chunkcoordintpair.getRegionZ() + ".mca");
@@ -17,7 +17,7 @@
RegionFile regionfile1 = new RegionFile(file, this.b, this.c);
this.cache.putAndMoveToFirst(i, regionfile1);
-@@ -46,7 +47,12 @@
+@@ -50,7 +51,12 @@
@Nullable
public NBTTagCompound read(ChunkCoordIntPair chunkcoordintpair) throws IOException {
@@ -31,7 +31,7 @@
DataInputStream datainputstream = regionfile.a(chunkcoordintpair);
Throwable throwable = null;
-@@ -81,7 +87,7 @@
+@@ -85,7 +91,7 @@
}
protected void write(ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound) throws IOException {
diff --git a/nms-patches/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.patch b/nms-patches/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.patch
index edb3116e5..e588d593e 100644
--- a/nms-patches/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.patch
+++ b/nms-patches/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/ChunkGeneratorAbstract.java
-+++ b/net/minecraft/server/ChunkGeneratorAbstract.java
-@@ -24,7 +24,7 @@
+--- a/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java
++++ b/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java
+@@ -58,7 +58,7 @@
return chunkgeneratorabstract.h;
})).apply(instance, instance.stable(ChunkGeneratorAbstract::new));
});
@@ -9,7 +9,7 @@
for (int i = 0; i < 24; ++i) {
for (int j = 0; j < 24; ++j) {
for (int k = 0; k < 24; ++k) {
-@@ -34,7 +34,7 @@
+@@ -68,7 +68,7 @@
}
});
@@ -18,7 +18,7 @@
for (int i = -2; i <= 2; ++i) {
for (int j = -2; j <= 2; ++j) {
float f = 10.0F / MathHelper.c((float) (i * i + j * j) + 0.2F);
-@@ -193,6 +193,11 @@
+@@ -227,6 +227,11 @@
f6 = f4;
f7 = f5;
}
diff --git a/nms-patches/net/minecraft/world/level/levelgen/MobSpawnerPatrol.patch b/nms-patches/net/minecraft/world/level/levelgen/MobSpawnerPatrol.patch
index dc224a1cc..4657200b9 100644
--- a/nms-patches/net/minecraft/world/level/levelgen/MobSpawnerPatrol.patch
+++ b/nms-patches/net/minecraft/world/level/levelgen/MobSpawnerPatrol.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/MobSpawnerPatrol.java
-+++ b/net/minecraft/server/MobSpawnerPatrol.java
-@@ -102,7 +102,7 @@
+--- a/net/minecraft/world/level/levelgen/MobSpawnerPatrol.java
++++ b/net/minecraft/world/level/levelgen/MobSpawnerPatrol.java
+@@ -118,7 +118,7 @@
entitymonsterpatrolling.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
entitymonsterpatrolling.prepare(worldserver, worldserver.getDamageScaler(blockposition), EnumMobSpawn.PATROL, (GroupDataEntity) null, (NBTTagCompound) null);
diff --git a/nms-patches/net/minecraft/world/level/levelgen/MobSpawnerPhantom.patch b/nms-patches/net/minecraft/world/level/levelgen/MobSpawnerPhantom.patch
index 899a76a42..2d8e6a56a 100644
--- a/nms-patches/net/minecraft/world/level/levelgen/MobSpawnerPhantom.patch
+++ b/nms-patches/net/minecraft/world/level/levelgen/MobSpawnerPhantom.patch
@@ -1,6 +1,6 @@
---- a/net/minecraft/server/MobSpawnerPhantom.java
-+++ b/net/minecraft/server/MobSpawnerPhantom.java
-@@ -57,7 +57,7 @@
+--- a/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java
++++ b/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java
+@@ -77,7 +77,7 @@
entityphantom.setPositionRotation(blockposition1, 0.0F, 0.0F);
groupdataentity = entityphantom.prepare(worldserver, difficultydamagescaler, EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null);
diff --git a/nms-patches/net/minecraft/world/level/levelgen/structure/PersistentStructureLegacy.patch b/nms-patches/net/minecraft/world/level/levelgen/structure/PersistentStructureLegacy.patch
index 2e5b6fc97..1e1da9454 100644
--- a/nms-patches/net/minecraft/world/level/levelgen/structure/PersistentStructureLegacy.patch
+++ b/nms-patches/net/minecraft/world/level/levelgen/structure/PersistentStructureLegacy.patch
@@ -1,7 +1,13 @@
---- a/net/minecraft/server/PersistentStructureLegacy.java
-+++ b/net/minecraft/server/PersistentStructureLegacy.java
-@@ -14,7 +14,7 @@
+--- a/net/minecraft/world/level/levelgen/structure/PersistentStructureLegacy.java
++++ b/net/minecraft/world/level/levelgen/structure/PersistentStructureLegacy.java
+@@ -20,9 +20,13 @@
+ import net.minecraft.world.level.levelgen.feature.StructureGenerator;
+ import net.minecraft.world.level.storage.WorldPersistentData;
++// CraftBukkit start
++import net.minecraft.world.level.dimension.DimensionManager;
++// CraftBukkit end
++
public class PersistentStructureLegacy {
- private static final Map