diff --git a/patches/api-unmapped/Fix-upstream-javadoc-warnings-and-errors.patch b/patches/api/Fix-upstream-javadoc-warnings-and-errors.patch
similarity index 100%
rename from patches/api-unmapped/Fix-upstream-javadoc-warnings-and-errors.patch
rename to patches/api/Fix-upstream-javadoc-warnings-and-errors.patch
diff --git a/patches/api-unmapped/Item-canEntityPickup.patch b/patches/api/Item-canEntityPickup.patch
similarity index 100%
rename from patches/api-unmapped/Item-canEntityPickup.patch
rename to patches/api/Item-canEntityPickup.patch
diff --git a/patches/api-unmapped/PlayerPickupItemEvent-setFlyAtPlayer.patch b/patches/api/PlayerPickupItemEvent-setFlyAtPlayer.patch
similarity index 99%
rename from patches/api-unmapped/PlayerPickupItemEvent-setFlyAtPlayer.patch
rename to patches/api/PlayerPickupItemEvent-setFlyAtPlayer.patch
index 71a965b6fc..62d8f08dc2 100644
--- a/patches/api-unmapped/PlayerPickupItemEvent-setFlyAtPlayer.patch
+++ b/patches/api/PlayerPickupItemEvent-setFlyAtPlayer.patch
@@ -15,11 +15,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private boolean flyAtPlayer = true; // Paper
private boolean cancel = false;
private final int remaining;
-
+
@@ -0,0 +0,0 @@ public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable {
return remaining;
}
-
+
+ // Paper Start
+ /**
+ * Set if the item will fly at the player
@@ -50,5 +50,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.cancel = cancel;
+ this.flyAtPlayer = !cancel; // Paper
}
-
+
@NotNull
diff --git a/patches/server-remapped/Item-canEntityPickup.patch b/patches/server/Item-canEntityPickup.patch
similarity index 91%
rename from patches/server-remapped/Item-canEntityPickup.patch
rename to patches/server/Item-canEntityPickup.patch
index 4d167395ae..ae2954513a 100644
--- a/patches/server-remapped/Item-canEntityPickup.patch
+++ b/patches/server/Item-canEntityPickup.patch
@@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity {
ItemEntity entityitem = (ItemEntity) iterator.next();
- if (!entityitem.removed && !entityitem.getItem().isEmpty() && !entityitem.hasPickUpDelay() && this.wantsToPickUp(entityitem.getItem())) {
+ if (!entityitem.isRemoved() && !entityitem.getItem().isEmpty() && !entityitem.hasPickUpDelay() && this.wantsToPickUp(entityitem.getItem())) {
+ // Paper Start
+ if (!entityitem.canMobPickup) {
+ continue;
@@ -41,10 +41,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
+ // Paper Start
++ @Override
+ public boolean canMobPickup() {
+ return item.canMobPickup;
+ }
+
++ @Override
+ public void setCanMobPickup(boolean canMobPickup) {
+ item.canMobPickup = canMobPickup;
+ }
@@ -52,4 +54,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
@Override
public void setOwner(UUID uuid) {
- item.setOwner(uuid);
+ this.item.setOwner(uuid);
diff --git a/patches/server-remapped/PlayerPickupItemEvent-setFlyAtPlayer.patch b/patches/server/PlayerPickupItemEvent-setFlyAtPlayer.patch
similarity index 88%
rename from patches/server-remapped/PlayerPickupItemEvent-setFlyAtPlayer.patch
rename to patches/server/PlayerPickupItemEvent-setFlyAtPlayer.patch
index 2d681e9d96..1d0d50f679 100644
--- a/patches/server-remapped/PlayerPickupItemEvent-setFlyAtPlayer.patch
+++ b/patches/server/PlayerPickupItemEvent-setFlyAtPlayer.patch
@@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -0,0 +0,0 @@ public class ItemEntity extends Entity {
// CraftBukkit start - fire PlayerPickupItemEvent
- int canHold = player.inventory.canHold(itemstack);
+ int canHold = player.getInventory().canHold(itemstack);
int remaining = i - canHold;
+ boolean flyAtPlayer = false; // Paper
@@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
itemstack.setCount(canHold);
@@ -0,0 +0,0 @@ public class ItemEntity extends Entity {
PlayerPickupItemEvent playerEvent = new PlayerPickupItemEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining);
- playerEvent.setCancelled(!player.canPickUpLoot);
+ playerEvent.setCancelled(!playerEvent.getPlayer().getCanPickupItems());
this.level.getCraftServer().getPluginManager().callEvent(playerEvent);
+ flyAtPlayer = playerEvent.getFlyAtPlayer(); // Paper
if (playerEvent.isCancelled()) {
@@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class ItemEntity extends Entity {
// CraftBukkit end
- if (this.pickupDelay == 0 && (this.owner == null || this.owner.equals(player.getUUID())) && player.inventory.add(itemstack)) {
+ if (this.pickupDelay == 0 && (this.owner == null || this.owner.equals(player.getUUID())) && player.getInventory().add(itemstack)) {
- player.take(this, i);
+ // Paper Start
+ if (flyAtPlayer) {
@@ -42,5 +42,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper End
if (itemstack.isEmpty()) {
- this.remove();
+ this.discard();
itemstack.setCount(i);
diff --git a/patches/server-remapped/Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch
similarity index 90%
rename from patches/server-remapped/Use-TerminalConsoleAppender-for-console-improvements.patch
rename to patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch
index a11fc149bc..d60f00fc45 100644
--- a/patches/server-remapped/Use-TerminalConsoleAppender-for-console-improvements.patch
+++ b/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch
@@ -18,60 +18,29 @@ Other changes:
- Server starts 1-2 seconds faster thanks to optimizations in Log4j
configuration
-diff --git a/pom.xml b/pom.xml
+diff --git a/build.gradle.kts b/build.gradle.kts
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/pom.xml
-+++ b/pom.xml
-@@ -0,0 +0,0 @@
- compile
-
-
-- jline
-- jline
-- 2.12.1
-- compile
-+ net.minecrell
-+ terminalconsoleappender
-+ 1.2.0
-+
-+
-+ org.jline
-+ jline-terminal-jansi
-+ 3.12.1
-+ runtime
-+
-+
-+
-+ org.apache.logging.log4j
-+ log4j-core
-+ runtime
-
-
- org.apache.logging.log4j
-@@ -0,0 +0,0 @@
-
- META-INF/services/java.sql.Driver
-
-+
-
-
-
-
-+
-+
-+ com.github.edwgiz
-+ maven-shade-plugin.log4j2-cachefile-transformer
-+ 2.13.1
-+
-+
-
-
- org.apache.maven.plugins
++ */
++ runtimeOnly("org.apache.logging.log4j:log4j-core:2.14.1")
++ // Paper end
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.14.1") // Paper
+ implementation("org.apache.logging.log4j:log4j-api:2.14.1") // Paper
+ implementation("org.apache.logging.log4j:log4j-slf4j-impl:2.14.1") // Paper
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
new file mode 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
@@ -152,8 +121,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import io.netty.buffer.Unpooled;
+import io.papermc.paper.adventure.PaperAdventure; // Paper
import it.unimi.dsi.fastutil.longs.LongIterator;
+ import java.awt.GraphicsEnvironment;
import java.awt.image.BufferedImage;
- import java.io.BufferedWriter;
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
import com.mojang.serialization.DynamicOps;
import com.mojang.serialization.Lifecycle;
@@ -183,7 +152,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
System.setProperty("jline.terminal", "jline.UnsupportedTerminal");
Main.useJline = false;
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> waitable = new Waitable>() {
@Override
protected List evaluate() {
-@@ -0,0 +0,0 @@ public class ConsoleCommandCompleter implements Completer {
+- List offers = ConsoleCommandCompleter.this.server.getCommandMap().tabComplete(ConsoleCommandCompleter.this.server.getConsoleSender(), buffer);
++ List offers = server.getCommandMap().tabComplete(server.getConsoleSender(), buffer); // Paper - fix remap
+
+- TabCompleteEvent tabEvent = new TabCompleteEvent(ConsoleCommandCompleter.this.server.getConsoleSender(), buffer, (offers == null) ? Collections.EMPTY_LIST : offers);
+- ConsoleCommandCompleter.this.server.getPluginManager().callEvent(tabEvent);
++ TabCompleteEvent tabEvent = new TabCompleteEvent(server.getConsoleSender(), buffer, (offers == null) ? Collections.EMPTY_LIST : offers); // Paper - fix remap
++ server.getPluginManager().callEvent(tabEvent); // Paper - fix remap
+
return tabEvent.isCancelled() ? Collections.EMPTY_LIST : tabEvent.getCompletions();
}
};
@@ -475,7 +451,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
@@ -0,0 +0,0 @@ public class ServerShutdownThread extends Thread {
- server.close();
+ this.server.close();
} finally {
try {
- server.reader.getTerminal().restore();
diff --git a/patches/server-remapped/provide-a-configurable-option-to-disable-creeper-lin.patch b/patches/server/provide-a-configurable-option-to-disable-creeper-lin.patch
similarity index 96%
rename from patches/server-remapped/provide-a-configurable-option-to-disable-creeper-lin.patch
rename to patches/server/provide-a-configurable-option-to-disable-creeper-lin.patch
index 07088cf9d9..9b22046211 100644
--- a/patches/server-remapped/provide-a-configurable-option-to-disable-creeper-lin.patch
+++ b/patches/server/provide-a-configurable-option-to-disable-creeper-lin.patch
@@ -24,7 +24,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
-@@ -0,0 +0,0 @@ public class Creeper extends Monster {
+@@ -0,0 +0,0 @@ public class Creeper extends Monster implements PowerableMob {
private void spawnLingeringCloud() {
Collection collection = this.getActiveEffects();