several more patches updated
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
Date: Thu, 24 Dec 2020 12:43:39 -0800
|
||||
Subject: [PATCH] Add OBSTRUCTED reason to BedEnterResult
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -0,0 +0,0 @@ public class CraftEventFactory {
|
||||
return BedEnterResult.TOO_FAR_AWAY;
|
||||
case NOT_SAFE:
|
||||
return BedEnterResult.NOT_SAFE;
|
||||
+ // Paper start
|
||||
+ case OBSTRUCTED:
|
||||
+ return BedEnterResult.OBSTRUCTED;
|
||||
+ // Paper end
|
||||
default:
|
||||
return BedEnterResult.OTHER_PROBLEM;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Sun, 27 Dec 2020 11:31:06 +0000
|
||||
Subject: [PATCH] Do not crash from invalid ingredient lists in
|
||||
VillagerAcquireTradeEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
@@ -0,0 +0,0 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
}
|
||||
if (!event.isCancelled()) {
|
||||
- recipeList.add(CraftMerchantRecipe.fromBukkit(event.getRecipe()).toMinecraft());
|
||||
+ // Paper start
|
||||
+ final CraftMerchantRecipe craftMerchantRecipe = CraftMerchantRecipe.fromBukkit(event.getRecipe());
|
||||
+ if (craftMerchantRecipe.getIngredients().isEmpty()) return;
|
||||
+ recipeList.add(craftMerchantRecipe.toMinecraft());
|
||||
+ // Paper end
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
|
||||
Date: Sun, 13 Dec 2020 05:32:05 +0200
|
||||
Subject: [PATCH] Expose LivingEntity hurt direction
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
public void playPickupItemAnimation(org.bukkit.entity.Item item, int quantity) {
|
||||
getHandle().take(((CraftItem) item).getHandle(), quantity);
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public float getHurtDirection() {
|
||||
+ return getHandle().hurtDir;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setHurtDirection(float hurtDirection) {
|
||||
+ getHandle().hurtDir = hurtDirection;
|
||||
+ }
|
||||
// Paper end
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <blake.galbreath@gmail.com>
|
||||
Date: Tue, 8 Dec 2020 20:24:52 -0600
|
||||
Subject: [PATCH] MC-4: Fix item position desync
|
||||
|
||||
This fixes item position desync (MC-4) by running the item coordinates
|
||||
through the encode/decode methods of the packet that causes the precision
|
||||
loss, which forces the server to lose the same precision as the client
|
||||
keeping them in sync.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperConfig {
|
||||
private static void trackPluginScoreboards() {
|
||||
trackPluginScoreboards = getBoolean("settings.track-plugin-scoreboards", false);
|
||||
}
|
||||
+
|
||||
+ public static boolean fixEntityPositionDesync = true;
|
||||
+ private static void fixEntityPositionDesync() {
|
||||
+ fixEntityPositionDesync = getBoolean("settings.fix-entity-position-desync", fixEntityPositionDesync);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundMoveEntityPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundMoveEntityPacket.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundMoveEntityPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundMoveEntityPacket.java
|
||||
@@ -0,0 +0,0 @@ public abstract class ClientboundMoveEntityPacket implements Packet<ClientGamePa
|
||||
protected final boolean hasPos;
|
||||
|
||||
public static long entityToPacket(double coord) {
|
||||
- return Mth.lfloor(coord * 4096.0D);
|
||||
+ return Mth.lfloor(coord * 4096.0D); // Paper - check ItemEntity#setPosRaw on update
|
||||
}
|
||||
|
||||
public static double packetToEntity(long coord) {
|
||||
- return (double)coord / 4096.0D;
|
||||
+ return (double)coord / 4096.0D; // Paper - check ItemEntity#setPosRaw on update
|
||||
}
|
||||
|
||||
public Vec3 updateEntityPosition(Vec3 orig) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||
}
|
||||
public final void setPosRaw(double x, double y, double z, boolean forceBoundingBoxUpdate) {
|
||||
// Paper end
|
||||
+ // Paper start - fix MC-4
|
||||
+ if (this instanceof ItemEntity) {
|
||||
+ if (com.destroystokyo.paper.PaperConfig.fixEntityPositionDesync) {
|
||||
+ // encode/decode from PacketPlayOutEntity
|
||||
+ x = Mth.lfloor(x * 4096.0D) * (1 / 4096.0D);
|
||||
+ y = Mth.lfloor(y * 4096.0D) * (1 / 4096.0D);
|
||||
+ z = Mth.lfloor(z * 4096.0D) * (1 / 4096.0D);
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - fix MC-4
|
||||
if (this.position.x != x || this.position.y != y || this.position.z != z) {
|
||||
this.position = new Vec3(x, y, z);
|
||||
int i = Mth.floor(x);
|
||||
@@ -1,34 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 21 Dec 2020 11:01:42 -0500
|
||||
Subject: [PATCH] Optimize Dynamic#get Missing Keys
|
||||
|
||||
get was calling toString() on every NBT object that was ever asked for an optional
|
||||
key from the object to build a string for the error text.
|
||||
|
||||
When done on large NBT objects, this was using a ton of computation time building the
|
||||
JSON representation of the NBT object.
|
||||
|
||||
Now we will just skip the value when 99.9999% of the time the text is never even printed.
|
||||
|
||||
diff --git a/src/main/java/com/mojang/serialization/Dynamic.java b/src/main/java/com/mojang/serialization/Dynamic.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/com/mojang/serialization/Dynamic.java
|
||||
+++ b/src/main/java/com/mojang/serialization/Dynamic.java
|
||||
@@ -0,0 +0,0 @@ import java.util.stream.Stream;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Dynamic<T> extends DynamicLike<T> {
|
||||
+ private static final boolean DEBUG_MISSING_KEYS = Boolean.getBoolean("Paper.debugDynamicMissingKeys"); // Paper
|
||||
private final T value;
|
||||
|
||||
public Dynamic(final DynamicOps<T> ops) {
|
||||
@@ -0,0 +0,0 @@ public class Dynamic<T> extends DynamicLike<T> {
|
||||
return new OptionalDynamic<>(ops, ops.getMap(value).flatMap(m -> {
|
||||
final T value = m.get(key);
|
||||
if (value == null) {
|
||||
- return DataResult.error("key missing: " + key + " in " + this.value);
|
||||
+ return DataResult.error(DEBUG_MISSING_KEYS ? "key missing: " + key + " in " + this.value : "key missing: " + key); // Paper
|
||||
}
|
||||
return DataResult.success(new Dynamic<>(ops, value));
|
||||
}));
|
||||
@@ -1,32 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: ysl3000 <yannicklamprecht@live.de>
|
||||
Date: Mon, 5 Oct 2020 21:25:16 +0200
|
||||
Subject: [PATCH] Player Chunk Load/Unload Events
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
|
||||
public void trackChunk(ChunkPos chunkPos, Packet<?> chunkDataPacket, Packet<?> lightUpdatePacket) {
|
||||
this.connection.send(lightUpdatePacket);
|
||||
this.connection.send(chunkDataPacket);
|
||||
+ // Paper start
|
||||
+ if(io.papermc.paper.event.packet.PlayerChunkLoadEvent.getHandlerList().getRegisteredListeners().length > 0){
|
||||
+ new io.papermc.paper.event.packet.PlayerChunkLoadEvent(this.getBukkitEntity().getWorld().getChunkAt(chunkPos.longKey), this.getBukkitEntity()).callEvent();
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
public void untrackChunk(ChunkPos chunkPos) {
|
||||
if (this.isAlive()) {
|
||||
this.connection.send(new ClientboundForgetLevelChunkPacket(chunkPos.x, chunkPos.z));
|
||||
+ // Paper start
|
||||
+ if(io.papermc.paper.event.packet.PlayerChunkUnloadEvent.getHandlerList().getRegisteredListeners().length > 0){
|
||||
+ new io.papermc.paper.event.packet.PlayerChunkUnloadEvent(this.getBukkitEntity().getWorld().getChunkAt(chunkPos.longKey), this.getBukkitEntity()).callEvent();
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user