mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-01 00:10:32 +01:00
Patches!
This commit is contained in:
parent
5be858e9b7
commit
2d9d0d8b1d
@ -25,10 +25,10 @@ index f041b5d80bff9c022b007e04ef1558e9116acc6b..a586442422a2b2c06b785af0d261d3e1
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
|
||||
index f24b4732db849893fd870b4b6a49f1c4b3eacdec..3feaaca5aaee12e48fa2e5f5d05329c9980b161e 100644
|
||||
index d839a0edf31f6803e5813b28a23fa17e20916b2c..bb8a3e670924ebcce48669c5dce57e2df03fad77 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
|
||||
@@ -152,6 +152,11 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine
|
||||
@@ -145,6 +145,11 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine
|
||||
public net.kyori.adventure.text.Component displayName(int level) {
|
||||
return io.papermc.paper.adventure.PaperAdventure.asAdventure(getHandle().getFullname(level));
|
||||
}
|
@ -5,10 +5,10 @@ Subject: [PATCH] Create HoverEvent from ItemStack Entity
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
index 71db89105c70cb70726fb6a732b899297aeee82a..12f90520e4d6d5fcea0c2f8e19dad9102970cd99 100644
|
||||
index fc51a93785ffc464d2719b440f49022f24b3983a..3ebba8af1cf2d2eaf6670860b011c7dc1da62890 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
@@ -527,4 +527,41 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
@@ -537,4 +537,41 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
return nms != null ? net.minecraft.locale.Language.getInstance().getOrDefault(nms.getItem().getDescriptionId(nms)) : null;
|
||||
}
|
||||
// Paper end - add getI18NDisplayName
|
@ -5,10 +5,10 @@ Subject: [PATCH] Cache block data strings
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index adc93e0e7a57907e824bdd8bb7b3012f28b515f4..dd98174480eedfcb348798d9070219581009f16f 100644
|
||||
index 3ec35f0aff38e6cbd969ec3442b924bc51365f4a..90cd5e6a5564f3b2002c2a4415fe130bf672b5d8 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2068,6 +2068,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2128,6 +2128,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.getPlayerList().reloadResources();
|
||||
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
||||
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
|
||||
@ -17,10 +17,10 @@ index adc93e0e7a57907e824bdd8bb7b3012f28b515f4..dd98174480eedfcb348798d907021958
|
||||
|
||||
if (this.isSameThread()) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
index fce3fec5e1ff164b0596fdd6b3d7b5b0277253ef..587396f5ed01939cd3ddce10fecf86ba80eb9c73 100644
|
||||
index 19fab0d8d8a6211782df1fd99b5d60681aecd2f5..b875bebb8b63c6f60301180fc2e3fc9c1bc87193 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
@@ -154,7 +154,7 @@ public class CraftBlockData implements BlockData {
|
||||
@@ -153,7 +153,7 @@ public class CraftBlockData implements BlockData {
|
||||
return exactMatch;
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ index fce3fec5e1ff164b0596fdd6b3d7b5b0277253ef..587396f5ed01939cd3ddce10fecf86ba
|
||||
|
||||
/**
|
||||
* Convert an NMS Enum (usually a BlockStateEnum) to its appropriate Bukkit
|
||||
@@ -537,9 +537,39 @@ public class CraftBlockData implements BlockData {
|
||||
@@ -538,9 +538,39 @@ public class CraftBlockData implements BlockData {
|
||||
Preconditions.checkState(CraftBlockData.MAP.put(nms, bukkit) == null, "Duplicate mapping %s->%s", nms, bukkit);
|
||||
}
|
||||
|
@ -9,10 +9,10 @@ as this is how Vanilla teleports entities.
|
||||
Cancel any pending motion when teleported.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 36ff9acf571d670fda225bce2f4ed16dc1d20fe3..07c5c01c2f5c18b1d6162275ca091b0ababd72c5 100644
|
||||
index 51e97ca80f25cd1e49033cfbc41b595f3fa54d66..5175475d75c393bfd5516d7dbede5200b7091b64 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -656,7 +656,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -682,7 +682,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
return;
|
||||
}
|
||||
|
||||
@ -21,20 +21,20 @@ index 36ff9acf571d670fda225bce2f4ed16dc1d20fe3..07c5c01c2f5c18b1d6162275ca091b0a
|
||||
this.lastGoodX = this.awaitingPositionFromClient.x;
|
||||
this.lastGoodY = this.awaitingPositionFromClient.y;
|
||||
this.lastGoodZ = this.awaitingPositionFromClient.z;
|
||||
@@ -1587,7 +1587,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
// CraftBukkit end
|
||||
@@ -1589,7 +1589,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
this.awaitingTeleportTime = this.tickCount;
|
||||
this.player.resetCurrentImpulseContext();
|
||||
- this.player.absMoveTo(d0, d1, d2, f, f1);
|
||||
+ this.player.moveTo(d0, d1, d2, f, f1); // Paper - Fix Entity Teleportation and cancel velocity if teleported
|
||||
this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport));
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 0c6680bf15b57cf314638ab70d849e033719c0e1..f45b148884b305628411d57f7662ea454fde3906 100644
|
||||
index e6422024dd4aa472156d9751dcdeb55b5e210f53..c8e4e37b706bd8cb9698ac2d13d0d8668e2d1d14 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -162,6 +162,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -165,6 +165,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
// CraftBukkit start
|
||||
private static final int CURRENT_LEVEL = 2;
|
||||
@ -42,7 +42,7 @@ index 0c6680bf15b57cf314638ab70d849e033719c0e1..f45b148884b305628411d57f7662ea45
|
||||
static boolean isLevelAtLeast(CompoundTag tag, int level) {
|
||||
return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
|
||||
}
|
||||
@@ -1785,6 +1786,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -1809,6 +1810,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public void moveTo(double x, double y, double z, float yaw, float pitch) {
|
||||
@ -57,10 +57,10 @@ index 0c6680bf15b57cf314638ab70d849e033719c0e1..f45b148884b305628411d57f7662ea45
|
||||
this.setYRot(yaw);
|
||||
this.setXRot(pitch);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
index b771f954f3fccd92e15196bf542e0d3703cfb71a..41d2793e69bd664456b5e3c5891b03bdcb31d103 100644
|
||||
index b90127f9f805fdb5bb43a4b8ad2b10499b0b6b78..8efc06d29c62fa2be8515ed3359d52a6d4b807d2 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
@@ -162,6 +162,7 @@ public abstract class BaseSpawner {
|
||||
@@ -164,6 +164,7 @@ public abstract class BaseSpawner {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ index b771f954f3fccd92e15196bf542e0d3703cfb71a..41d2793e69bd664456b5e3c5891b03bd
|
||||
if (entity instanceof Mob) {
|
||||
Mob entityinsentient = (Mob) entity;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 326978aedbd9cc81db2bf1d5398c1cd2ce68a866..f664fd4aa8d79e95787848b5a3e0ed7bc182fa25 100644
|
||||
index 40e4b8233e27b8ebd94a89bb43b5c14808edaa68..3da47cf8968c1917e2f216a410eece51a693dfb2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -238,7 +238,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add additional open container api to HumanEntity
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
index 3898d583a65e82711fd4415aed32ecf08f42100f..d5a8f019e88de30400733cdc3178eb982ccca341 100644
|
||||
index bbd3f0981eb95348ef12c9af8fa1712c022ed869..9393e9d21fcc41cb0f20b98d9f28c95b0e523f62 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
@@ -464,6 +464,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
@@ -462,6 +462,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
return this.getHandle().containerMenu.getBukkitView();
|
||||
}
|
||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] Extend block drop capture to capture all items added to the
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 2e42e09d3fa19e5a16374ee6ac1677dd2b2004f1..283f686364691f54d9e9e925b33238526de74219 100644
|
||||
index ccc5e57bfaaa51b05c66349475212f2079a4428c..4e1027f00fba2084073aa926805753224aa8b153 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1224,6 +1224,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1230,6 +1230,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
|
||||
return false;
|
||||
} else {
|
||||
@ -23,10 +23,10 @@ index 2e42e09d3fa19e5a16374ee6ac1677dd2b2004f1..283f686364691f54d9e9e925b3323852
|
||||
if (spawnReason != null && !CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) {
|
||||
return false;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
index c3eb4b6372eed0b7eb636f495ce494b676767b6e..a03d1a85019afdc42de2b8449fc38384c4dac51e 100644
|
||||
index 2f0d56c78584abe27ef050258827103fb60d5785..486d9c4dbe3ee23198eba7f34ea8b5f4e9048c0b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
@@ -429,10 +429,12 @@ public class ServerPlayerGameMode {
|
||||
@@ -432,10 +432,12 @@ public class ServerPlayerGameMode {
|
||||
// return true; // CraftBukkit
|
||||
}
|
||||
// CraftBukkit start
|
@ -6,10 +6,10 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index f45b148884b305628411d57f7662ea454fde3906..44610d4e3fb69e6cf5629d9e895e93d8dd5e09e9 100644
|
||||
index c8e4e37b706bd8cb9698ac2d13d0d8668e2d1d14..909575a02bf5f7040eb9c8edb034e7b6578e92b9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4411,4 +4411,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -4439,4 +4439,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
void accept(Entity entity, double x, double y, double z);
|
||||
}
|
||||
@ -21,10 +21,10 @@ index f45b148884b305628411d57f7662ea454fde3906..44610d4e3fb69e6cf5629d9e895e93d8
|
||||
+ // Paper end - Expose entity id counter
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 7579e076793ba90e405b3ac0db600374ee8fdcb3..f4a7da134584a065a34b4f6a8eaebfcb81b6d735 100644
|
||||
index 291a9befb2abf95739fdc93faddb4864eb75853a..274747142472119677fa825b174e02aae0bf68eb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -525,6 +525,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -522,6 +522,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!");
|
||||
return compound;
|
||||
}
|
@ -5,10 +5,10 @@ Subject: [PATCH] Entity#isTicking
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 44610d4e3fb69e6cf5629d9e895e93d8dd5e09e9..2c0c41ae455ae5894e6bd85830741143c3d8aaa5 100644
|
||||
index 909575a02bf5f7040eb9c8edb034e7b6578e92b9..bbce55b02f848be720ad95cb5b896ff9ad1f66d0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4416,5 +4416,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -4444,5 +4444,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public static int nextEntityId() {
|
||||
return ENTITY_COUNTER.incrementAndGet();
|
||||
}
|
||||
@ -19,10 +19,10 @@ index 44610d4e3fb69e6cf5629d9e895e93d8dd5e09e9..2c0c41ae455ae5894e6bd85830741143
|
||||
// Paper end - Expose entity id counter
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index f664fd4aa8d79e95787848b5a3e0ed7bc182fa25..ef8f8b3f97405250ebe058c67c4099da66a8e773 100644
|
||||
index 3da47cf8968c1917e2f216a410eece51a693dfb2..2080733ebae1af51b7b4d3cd2fbd1a4a2703a920 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1035,4 +1035,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -1045,4 +1045,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
return getHandle().isInLava();
|
||||
}
|
||||
// Paper end - entity liquid API
|
@ -6,10 +6,10 @@ Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index dd98174480eedfcb348798d9070219581009f16f..70ae9d44dd860014fd9a599e3a4e4a3fe80068ff 100644
|
||||
index 90cd5e6a5564f3b2002c2a4415fe130bf672b5d8..18efcf55bf13fa17ac532cca4c213e5b6e14979f 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2151,13 +2151,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2253,13 +2253,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
if (this.isEnforceWhitelist()) {
|
||||
PlayerList playerlist = source.getServer().getPlayerList();
|
||||
UserWhiteList whitelist = playerlist.getWhiteList();
|
@ -7,7 +7,7 @@ if multiple threads from worldgen sort at same time, it will crash.
|
||||
So make a copy of the list for sorting purposes.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
|
||||
index 3288afe9aaf69c32a92b172fb1aaf3fbb8a494a5..5ca112631cce775c609950d3540059f54033fd3e 100644
|
||||
index 334962f1bf5988059fec506f0d3aaf4302205220..6a270c9adb044a6e0b1c8e09b9106d51989fd761 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
|
||||
@@ -18,7 +18,7 @@ public class GateBehavior<E extends LivingEntity> implements BehaviorControl<E>
|
@ -11,7 +11,7 @@ This ensures the crystals/pillars are in expected state when the dragon spawns.
|
||||
See #3522
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
index 1c716cf65d77e54ba8f90c8cf736e20c64f5df2e..f615b7f43f1444cf1e34b92cb0c05242a5dc26fd 100644
|
||||
index 6f9c78b124a33212125e98905efc8a09a1891500..79b63082e849f29244352b9d0d6ac9b7df7813f6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
@@ -472,6 +472,7 @@ public class EndDragonFight {
|
@ -6,10 +6,10 @@ Subject: [PATCH] Fix for large move vectors crashing server
|
||||
Check movement distance also based on current position.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 07c5c01c2f5c18b1d6162275ca091b0ababd72c5..26c9d483810c8679fb2eff42c9176b8037cd56f8 100644
|
||||
index 5175475d75c393bfd5516d7dbede5200b7091b64..355b1726e90eb796fa2c1e21108bcf793637bf6c 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -472,9 +472,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -498,9 +498,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
float prevYaw = this.player.getYRot();
|
||||
float prevPitch = this.player.getXRot();
|
||||
// CraftBukkit end
|
||||
@ -22,7 +22,7 @@ index 07c5c01c2f5c18b1d6162275ca091b0ababd72c5..26c9d483810c8679fb2eff42c9176b80
|
||||
double d3 = ServerGamePacketListenerImpl.clampHorizontal(packet.getX()); final double toX = d3; // Paper - OBFHELPER
|
||||
double d4 = ServerGamePacketListenerImpl.clampVertical(packet.getY()); final double toY = d4; // Paper - OBFHELPER
|
||||
double d5 = ServerGamePacketListenerImpl.clampHorizontal(packet.getZ()); final double toZ = d5; // Paper - OBFHELPER
|
||||
@@ -484,7 +484,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -510,7 +510,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
double d7 = d4 - this.vehicleFirstGoodY;
|
||||
double d8 = d5 - this.vehicleFirstGoodZ;
|
||||
double d9 = entity.getDeltaMovement().lengthSqr();
|
||||
@ -40,7 +40,7 @@ index 07c5c01c2f5c18b1d6162275ca091b0ababd72c5..26c9d483810c8679fb2eff42c9176b80
|
||||
|
||||
// CraftBukkit start - handle custom speeds and skipped ticks
|
||||
this.allowedPlayerTicks += (System.currentTimeMillis() / 50) - this.lastTick;
|
||||
@@ -530,9 +539,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -556,9 +565,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
boolean flag = worldserver.noCollision(entity, entity.getBoundingBox().deflate(0.0625D));
|
||||
|
||||
@ -53,7 +53,7 @@ index 07c5c01c2f5c18b1d6162275ca091b0ababd72c5..26c9d483810c8679fb2eff42c9176b80
|
||||
boolean flag1 = entity.verticalCollisionBelow;
|
||||
|
||||
if (entity instanceof LivingEntity) {
|
||||
@@ -1272,7 +1281,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1265,7 +1274,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
double d7 = d1 - this.firstGoodY;
|
||||
double d8 = d2 - this.firstGoodZ;
|
||||
double d9 = this.player.getDeltaMovement().lengthSqr();
|
||||
@ -71,7 +71,7 @@ index 07c5c01c2f5c18b1d6162275ca091b0ababd72c5..26c9d483810c8679fb2eff42c9176b80
|
||||
|
||||
if (this.player.isSleeping()) {
|
||||
if (d10 > 1.0D) {
|
||||
@@ -1326,9 +1344,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1321,9 +1339,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
AABB axisalignedbb = this.player.getBoundingBox();
|
||||
|
||||
@ -81,6 +81,6 @@ index 07c5c01c2f5c18b1d6162275ca091b0ababd72c5..26c9d483810c8679fb2eff42c9176b80
|
||||
+ d6 = d0 - this.lastGoodX; // Paper - diff on change, used for checking large move vectors above
|
||||
+ d7 = d1 - this.lastGoodY; // Paper - diff on change, used for checking large move vectors above
|
||||
+ d8 = d2 - this.lastGoodZ; // Paper - diff on change, used for checking large move vectors above
|
||||
boolean flag = d7 > 0.0D;
|
||||
boolean flag1 = d7 > 0.0D;
|
||||
|
||||
if (this.player.onGround() && !packet.isOnGround() && flag) {
|
||||
if (this.player.onGround() && !packet.isOnGround() && flag1) {
|
@ -6,7 +6,7 @@ Subject: [PATCH] Optimise getType calls
|
||||
Remove the map lookup for converting from Block->Bukkit Material
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockState.java b/src/main/java/net/minecraft/world/level/block/state/BlockState.java
|
||||
index da878e180c6b94f98dc82c6e8395f63ecc9b2c1e..e33a4ade1dd40ba482e2ca51c3b3ddad284106c3 100644
|
||||
index 065d140ca4f987e14138a37f4c7d60879dd7b6e1..601135f3368272bf1ca3a43ec9c199e3ee838462 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockState.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockState.java
|
||||
@@ -10,6 +10,16 @@ import net.minecraft.world.level.block.state.properties.Property;
|
||||
@ -23,7 +23,7 @@ index da878e180c6b94f98dc82c6e8395f63ecc9b2c1e..e33a4ade1dd40ba482e2ca51c3b3ddad
|
||||
+ return this.cachedMaterial;
|
||||
+ }
|
||||
+ // Paper end - optimise getType calls
|
||||
public BlockState(Block block, ImmutableMap<Property<?>, Comparable<?>> propertyMap, MapCodec<BlockState> codec) {
|
||||
public BlockState(Block block, Reference2ObjectArrayMap<Property<?>, Comparable<?>> propertyMap, MapCodec<BlockState> codec) {
|
||||
super(block, propertyMap, codec);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java
|
||||
@ -53,10 +53,10 @@ index a586442422a2b2c06b785af0d261d3e19eb1d59b..aa644231425b9622437538b5c092d406
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
||||
index 8e5279abccdd074d565f246420b2b12b81189b67..928a301627134b49915b0ceaeabb7dc350605dc2 100644
|
||||
index fabdec2d66cc6d676ed58fa570e2c318ab0927e2..1002123cd0c6f57cecc4e80f5f21cc6ff5886d37 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
||||
@@ -170,7 +170,7 @@ public class CraftBlockState implements BlockState {
|
||||
@@ -175,7 +175,7 @@ public class CraftBlockState implements BlockState {
|
||||
|
||||
@Override
|
||||
public Material getType() {
|
||||
@ -66,10 +66,10 @@ index 8e5279abccdd074d565f246420b2b12b81189b67..928a301627134b49915b0ceaeabb7dc3
|
||||
|
||||
public void setFlag(int flag) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
index 587396f5ed01939cd3ddce10fecf86ba80eb9c73..01a1479711b7f7bb87db275a1edfab5a95464cca 100644
|
||||
index b875bebb8b63c6f60301180fc2e3fc9c1bc87193..2303525542daa933a8de5978ac43d16223c6e5fd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
@@ -61,7 +61,7 @@ public class CraftBlockData implements BlockData {
|
||||
@@ -60,7 +60,7 @@ public class CraftBlockData implements BlockData {
|
||||
|
||||
@Override
|
||||
public Material getMaterial() {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Villager#resetOffers
|
||||
|
||||
|
||||
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 0ded8ee2deb51bea7506a8fa2d21f5e160694d54..ddc002f269527201724457c0b820788200441e0c 100644
|
||||
index 521c9602db7c532470adcd5f024d3dd0f1e88780..79e81fd5490a493b595dc1034641e13451e5a61a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
@@ -114,6 +114,13 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
||||
@@ -116,6 +116,13 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
||||
return this.tradingPlayer != null;
|
||||
}
|
||||
|
@ -10,10 +10,10 @@ In general, look at making this logic more robust (i.e properly handling
|
||||
cases where a captured entry is overriden) - but for now this will do.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 6d5a0aa8f8cee0897a920c2abf18efc03cad2abb..40f1b4ba266f96629b989590c7c81cd7534e93da 100644
|
||||
index eec2ca8306d42e4eafdf3ab0778bf2023739cb83..411841f2d8013ae9142b96c251aabd54d16c5b73 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -154,7 +154,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -151,7 +151,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public boolean captureBlockStates = false;
|
||||
public boolean captureTreeGeneration = false;
|
||||
public Map<BlockPos, org.bukkit.craftbukkit.block.CraftBlockState> capturedBlockStates = new java.util.LinkedHashMap<>(); // Paper
|
@ -7,10 +7,10 @@ Fixes #4259 by not flooring the blockposition among other weirdness
|
||||
Vanilla Issue: MC-267622
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
|
||||
index c4cf6abf0a962794ddbb4d7a691406054062ffee..3a2afa6c1f6dfad7dc18d93b743cbea1eef0e4b8 100644
|
||||
index 0de294a2aec50a39d6dbc56b6a61b01b1e538828..66fbad74c2ec2f853ec6c74482c6cae1c1746007 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
|
||||
@@ -82,7 +82,14 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
|
||||
@@ -87,7 +87,14 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
|
||||
result = blockCookEvent.getResult();
|
||||
itemstack1 = CraftItemStack.asNMSCopy(result);
|
||||
// CraftBukkit end
|
||||
@ -25,4 +25,4 @@ index c4cf6abf0a962794ddbb4d7a691406054062ffee..3a2afa6c1f6dfad7dc18d93b743cbea1
|
||||
+ // Paper end - Fix item locations dropped from campfires
|
||||
campfire.items.set(i, ItemStack.EMPTY);
|
||||
world.sendBlockUpdated(pos, state, state, 3);
|
||||
world.gameEvent(GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(state));
|
||||
world.gameEvent((Holder) GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(state));
|
@ -6,7 +6,7 @@ Subject: [PATCH] Fix bell block entity memory leak
|
||||
BellBlockEntity has a list of entities (entitiesAtRing) that was not being cleared at the right time, causing leaks whenever a bell would be rung near a crowd of entities.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BellBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BellBlockEntity.java
|
||||
index 30e9d4b20005dc6d20baf578f2ae958bdfcea02a..d21f7e9712ac2d9088ce19d415e4ba7863d8cebf 100644
|
||||
index e1adfd10a2f67687b7123d20d31eb7d059a3e1e3..86dac3f82da065bf79d94da9df192f51ce4665e2 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BellBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BellBlockEntity.java
|
||||
@@ -63,6 +63,11 @@ public class BellBlockEntity extends BlockEntity {
|
@ -8,10 +8,10 @@ This can realistically only happen if there's custom loot active on fishing
|
||||
which can return 0 items. This would disconnect the player who's fishing.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
index d7548eb7cd6986dcea6fbf4efb76b647cc350642..a87fcd5b837e1c824cbd5587c3350986e2fd7acb 100644
|
||||
index 453da998a98eabe5a55a968277b71bd9998f3221..a9ea83ea03ab23abc1eb463dadcdd742bfa20036 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
@@ -504,9 +504,15 @@ public class FishingHook extends Projectile {
|
||||
@@ -505,9 +505,15 @@ public class FishingHook extends Projectile {
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
ItemStack itemstack1 = (ItemStack) iterator.next();
|
||||
@ -29,7 +29,7 @@ index d7548eb7cd6986dcea6fbf4efb76b647cc350642..a87fcd5b837e1c824cbd5587c3350986
|
||||
playerFishEvent.setExpToDrop(this.random.nextInt(6) + 1);
|
||||
this.level().getCraftServer().getPluginManager().callEvent(playerFishEvent);
|
||||
|
||||
@@ -519,8 +525,12 @@ public class FishingHook extends Projectile {
|
||||
@@ -520,8 +526,12 @@ public class FishingHook extends Projectile {
|
||||
double d2 = entityhuman.getZ() - this.getZ();
|
||||
double d3 = 0.1D;
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add getOfflinePlayerIfCached(String)
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index c05fd6a179e8d142b3f5a8977ae7afab8c609a4e..c353f7a3a9ad0099ef7330dde988d1a174a0e327 100644
|
||||
index a22b146e2bfdeb66aca8abb5fb23ee5cd6306f4e..99fa8f65801b1816b788fa42d49d6672bf331579 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1921,6 +1921,28 @@ public final class CraftServer implements Server {
|
||||
@@ -1933,6 +1933,28 @@ public final class CraftServer implements Server {
|
||||
return result;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add ignore discounts API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||
index 0a1a70edda66bf348b3e3a9df4670cd81561cd1f..a01e089ed7689485a7ac33ab29bc27c4b68bc1df 100644
|
||||
index 4d7f95d2bd415bacccee145bfc47f2b480530c11..4d3a04e1d7910c4e71ac9a1cebb58e482958671a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -491,6 +491,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@ -25,10 +25,21 @@ index 0a1a70edda66bf348b3e3a9df4670cd81561cd1f..a01e089ed7689485a7ac33ab29bc27c4
|
||||
int k = (int) Math.floor(d0 * (double) merchantrecipe1.getBaseCostA().getCount());
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java
|
||||
index 7da5c4a45f8fd46fedd4386e0faac57445475e3a..02feea12c998f37098b72becf6bfaf6b27d155de 100644
|
||||
index 89982d25f60c8b60ba91e559ef88278f338fe215..bffa088b13312d525efaab3d7988a08953c4d9c3 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java
|
||||
@@ -19,6 +19,7 @@ public class MerchantOffer {
|
||||
@@ -33,6 +33,10 @@ public class MerchantOffer {
|
||||
return merchantrecipe.priceMultiplier;
|
||||
}), Codec.INT.lenientOptionalFieldOf("xp", 1).forGetter((merchantrecipe) -> {
|
||||
return merchantrecipe.xp;
|
||||
+ // Paper start
|
||||
+ }), Codec.BOOL.lenientOptionalFieldOf("Paper.IgnoreDiscounts", false).forGetter((merchantrecipe) -> {
|
||||
+ return merchantrecipe.ignoreDiscounts;
|
||||
+ // Paper end
|
||||
})).apply(instance, MerchantOffer::new);
|
||||
});
|
||||
public static final StreamCodec<RegistryFriendlyByteBuf, MerchantOffer> STREAM_CODEC = StreamCodec.of(MerchantOffer::writeToStream, MerchantOffer::createFromStream);
|
||||
@@ -46,6 +50,7 @@ public class MerchantOffer {
|
||||
public int demand;
|
||||
public float priceMultiplier;
|
||||
public int xp;
|
||||
@ -36,65 +47,42 @@ index 7da5c4a45f8fd46fedd4386e0faac57445475e3a..02feea12c998f37098b72becf6bfaf6b
|
||||
// CraftBukkit start
|
||||
private CraftMerchantRecipe bukkitHandle;
|
||||
|
||||
@@ -31,7 +32,15 @@ public class MerchantOffer {
|
||||
}
|
||||
|
||||
public MerchantOffer(ItemStack itemstack, ItemStack itemstack1, ItemStack itemstack2, int uses, int maxUses, int experience, float priceMultiplier, int demand, CraftMerchantRecipe bukkit) {
|
||||
- this(itemstack, itemstack1, itemstack2, uses, maxUses, experience, priceMultiplier, demand);
|
||||
+ // Paper start - Add ignore discounts API
|
||||
+ this(itemstack, itemstack1, itemstack2, uses, maxUses, experience, priceMultiplier, demand, false, bukkit);
|
||||
+ }
|
||||
+ public MerchantOffer(ItemStack itemstack, ItemStack itemstack1, ItemStack itemstack2, int uses, int maxUses, int experience, float priceMultiplier, boolean ignoreDiscounts, CraftMerchantRecipe bukkit) {
|
||||
+ this(itemstack, itemstack1, itemstack2, uses, maxUses, experience, priceMultiplier, 0, ignoreDiscounts, bukkit);
|
||||
+ }
|
||||
+ public MerchantOffer(ItemStack itemstack, ItemStack itemstack1, ItemStack itemstack2, int uses, int maxUses, int experience, float priceMultiplier, int demand, boolean ignoreDiscounts, CraftMerchantRecipe bukkit) {
|
||||
+ this(itemstack, itemstack1, itemstack2, uses, maxUses, experience, priceMultiplier, demand, ignoreDiscounts);
|
||||
+ // Paper end - Add ignore discounts API
|
||||
this.bukkitHandle = bukkit;
|
||||
@@ -59,7 +64,7 @@ public class MerchantOffer {
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -63,6 +72,7 @@ public class MerchantOffer {
|
||||
|
||||
this.specialPriceDiff = nbt.getInt("specialPrice");
|
||||
this.demand = nbt.getInt("demand");
|
||||
+ this.ignoreDiscounts = nbt.getBoolean("Paper.IgnoreDiscounts"); // Paper - Add ignore discounts API
|
||||
}
|
||||
|
||||
public MerchantOffer(ItemStack buyItem, ItemStack sellItem, int maxUses, int merchantExperience, float priceMultiplier) {
|
||||
@@ -74,10 +84,19 @@ public class MerchantOffer {
|
||||
}
|
||||
|
||||
public MerchantOffer(ItemStack firstBuyItem, ItemStack secondBuyItem, ItemStack sellItem, int uses, int maxUses, int merchantExperience, float priceMultiplier) {
|
||||
- this(firstBuyItem, secondBuyItem, sellItem, uses, maxUses, merchantExperience, priceMultiplier, 0);
|
||||
+ // Paper start - Add ignore discounts API
|
||||
+ this(firstBuyItem, secondBuyItem, sellItem, uses, maxUses, merchantExperience, priceMultiplier, false);
|
||||
+ }
|
||||
+ public MerchantOffer(ItemStack firstBuyItem, ItemStack secondBuyItem, ItemStack sellItem, int uses, int maxUses, int merchantExperience, float priceMultiplier, boolean ignoreDiscounts) {
|
||||
+ this(firstBuyItem, secondBuyItem, sellItem, uses, maxUses, merchantExperience, priceMultiplier, 0, ignoreDiscounts);
|
||||
}
|
||||
|
||||
public MerchantOffer(ItemStack firstBuyItem, ItemStack secondBuyItem, ItemStack sellItem, int uses, int maxUses, int merchantExperience, float priceMultiplier, int demandBonus) {
|
||||
+ this(firstBuyItem, secondBuyItem, sellItem, uses, maxUses, merchantExperience, priceMultiplier, demandBonus, false);
|
||||
+ }
|
||||
+ public MerchantOffer(ItemStack firstBuyItem, ItemStack secondBuyItem, ItemStack sellItem, int uses, int maxUses, int merchantExperience, float priceMultiplier, int demandBonus, boolean ignoreDiscounts) {
|
||||
+ this.ignoreDiscounts = ignoreDiscounts;
|
||||
+ // Paper end - Add ignore discounts API
|
||||
this.rewardExp = true;
|
||||
this.xp = 1;
|
||||
- private MerchantOffer(ItemCost firstBuyItem, Optional<ItemCost> secondBuyItem, ItemStack sellItem, int uses, int maxUses, boolean rewardingPlayerExperience, int specialPrice, int demandBonus, float priceMultiplier, int merchantExperience) {
|
||||
+ private MerchantOffer(ItemCost firstBuyItem, Optional<ItemCost> secondBuyItem, ItemStack sellItem, int uses, int maxUses, boolean rewardingPlayerExperience, int specialPrice, int demandBonus, float priceMultiplier, int merchantExperience, boolean ignoreDiscounts) { // Paper
|
||||
this.baseCostA = firstBuyItem;
|
||||
@@ -210,6 +229,7 @@ public class MerchantOffer {
|
||||
nbttagcompound.putFloat("priceMultiplier", this.priceMultiplier);
|
||||
nbttagcompound.putInt("specialPrice", this.specialPriceDiff);
|
||||
nbttagcompound.putInt("demand", this.demand);
|
||||
+ nbttagcompound.putBoolean("Paper.IgnoreDiscounts", this.ignoreDiscounts); // Paper - Add ignore discounts API
|
||||
return nbttagcompound;
|
||||
this.costB = secondBuyItem;
|
||||
this.result = sellItem;
|
||||
@@ -70,6 +75,7 @@ public class MerchantOffer {
|
||||
this.demand = demandBonus;
|
||||
this.priceMultiplier = priceMultiplier;
|
||||
this.xp = merchantExperience;
|
||||
+ this.ignoreDiscounts = ignoreDiscounts;
|
||||
}
|
||||
|
||||
public MerchantOffer(ItemCost buyItem, ItemStack sellItem, int maxUses, int merchantExperience, float priceMultiplier) {
|
||||
@@ -85,11 +91,11 @@ public class MerchantOffer {
|
||||
}
|
||||
|
||||
public MerchantOffer(ItemCost firstBuyItem, Optional<ItemCost> secondBuyItem, ItemStack sellItem, int uses, int maxUses, int merchantExperience, float priceMultiplier, int demandBonus) {
|
||||
- this(firstBuyItem, secondBuyItem, sellItem, uses, maxUses, true, 0, demandBonus, priceMultiplier, merchantExperience);
|
||||
+ this(firstBuyItem, secondBuyItem, sellItem, uses, maxUses, true, 0, demandBonus, priceMultiplier, merchantExperience, false); // Paper
|
||||
}
|
||||
|
||||
private MerchantOffer(MerchantOffer offer) {
|
||||
- this(offer.baseCostA, offer.costB, offer.result.copy(), offer.uses, offer.maxUses, offer.rewardExp, offer.specialPriceDiff, offer.demand, offer.priceMultiplier, offer.xp);
|
||||
+ this(offer.baseCostA, offer.costB, offer.result.copy(), offer.uses, offer.maxUses, offer.rewardExp, offer.specialPriceDiff, offer.demand, offer.priceMultiplier, offer.xp, offer.ignoreDiscounts); // Paper
|
||||
}
|
||||
|
||||
public ItemStack getBaseCostA() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java
|
||||
index c015b34d2b13a759783da7c0c06dd0563d35fc88..5741a233fb1dd8ad0f83a09b44476a4b88e6aa16 100644
|
||||
index 3bf9b5c016fa638fd0377d2a031a7359430b79ce..a18088125254178d362fdd283bff704a9ccdd0a7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java
|
||||
@@ -18,11 +18,19 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
@@ -22,11 +22,19 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
|
||||
@Deprecated
|
||||
public CraftMerchantRecipe(ItemStack result, int uses, int maxUses, boolean experienceReward, int experience, float priceMultiplier) {
|
||||
@ -114,9 +102,9 @@ index c015b34d2b13a759783da7c0c06dd0563d35fc88..5741a233fb1dd8ad0f83a09b44476a4b
|
||||
+ super(result, uses, maxUses, experienceReward, experience, priceMultiplier, demand, specialPrice, ignoreDiscounts);
|
||||
+ // Paper end
|
||||
this.handle = new net.minecraft.world.item.trading.MerchantOffer(
|
||||
net.minecraft.world.item.ItemStack.EMPTY,
|
||||
net.minecraft.world.item.ItemStack.EMPTY,
|
||||
@@ -32,6 +40,7 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
new ItemCost(Items.AIR),
|
||||
Optional.empty(),
|
||||
@@ -36,6 +44,7 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
experience,
|
||||
priceMultiplier,
|
||||
demand,
|
||||
@ -124,7 +112,7 @@ index c015b34d2b13a759783da7c0c06dd0563d35fc88..5741a233fb1dd8ad0f83a09b44476a4b
|
||||
this
|
||||
);
|
||||
this.setSpecialPrice(specialPrice);
|
||||
@@ -108,6 +117,18 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
@@ -112,6 +121,18 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
this.handle.priceMultiplier = priceMultiplier;
|
||||
}
|
||||
|
||||
@ -143,7 +131,7 @@ index c015b34d2b13a759783da7c0c06dd0563d35fc88..5741a233fb1dd8ad0f83a09b44476a4b
|
||||
public net.minecraft.world.item.trading.MerchantOffer toMinecraft() {
|
||||
List<ItemStack> ingredients = this.getIngredients();
|
||||
Preconditions.checkState(!ingredients.isEmpty(), "No offered ingredients");
|
||||
@@ -122,7 +143,7 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
@@ -128,7 +149,7 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
if (recipe instanceof CraftMerchantRecipe) {
|
||||
return (CraftMerchantRecipe) recipe;
|
||||
} else {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Toggle for removing existing dragon
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
index f615b7f43f1444cf1e34b92cb0c05242a5dc26fd..c4555320d1f283a41c47d08d68c2633717f6fda8 100644
|
||||
index 79b63082e849f29244352b9d0d6ac9b7df7813f6..3ea0ca395e0561d96044f0f84442a08b42b539bd 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
@@ -209,7 +209,7 @@ public class EndDragonFight {
|
@ -15,10 +15,10 @@ manually reload the advancement data for all players, which
|
||||
normally takes place as a part of the datapack reloading.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index f4a7da134584a065a34b4f6a8eaebfcb81b6d735..f10457466cbaaba2d3aa49a64092847f635ce752 100644
|
||||
index 274747142472119677fa825b174e02aae0bf68eb..c0878cf9948774986996127e250004f0f21d6b31 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -334,7 +334,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -333,7 +333,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
Bukkit.getLogger().log(Level.SEVERE, "Error saving advancement " + key, ex);
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Beacon API - custom effect ranges
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
index a1097950766ad31393340b423ea3f98a1f555368..49f25826aea528d9da085b9e65cb4c85cd78c415 100644
|
||||
index 18450017bc3df2f0b1a5715e6021e8e5defa24a1..32a242d4b67b4edbc1996fa64a151dc60e7e996e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
|
||||
@@ -82,6 +82,26 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
@@ -86,6 +86,26 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
return (BeaconBlockEntity.hasSecondaryEffect(this.levels, this.primaryPower, this.secondaryPower)) ? CraftPotionUtil.toBukkit(new MobEffectInstance(this.secondaryPower, BeaconBlockEntity.getLevel(this.levels), BeaconBlockEntity.getAmplification(this.levels, this.primaryPower, this.secondaryPower), true, true)) : null;
|
||||
}
|
||||
// CraftBukkit end
|
||||
@ -34,8 +34,8 @@ index a1097950766ad31393340b423ea3f98a1f555368..49f25826aea528d9da085b9e65cb4c85
|
||||
+ // Paper end - Custom beacon ranges
|
||||
|
||||
@Nullable
|
||||
static MobEffect filterEffect(@Nullable MobEffect effect) {
|
||||
@@ -197,7 +217,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
static Holder<MobEffect> filterEffect(@Nullable Holder<MobEffect> effect) {
|
||||
@@ -201,7 +221,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
}
|
||||
|
||||
if (blockEntity.levels > 0 && !blockEntity.beamSections.isEmpty()) {
|
||||
@ -44,7 +44,7 @@ index a1097950766ad31393340b423ea3f98a1f555368..49f25826aea528d9da085b9e65cb4c85
|
||||
BeaconBlockEntity.playSound(world, pos, SoundEvents.BEACON_AMBIENT);
|
||||
}
|
||||
}
|
||||
@@ -283,8 +303,13 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
@@ -287,8 +307,13 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
}
|
||||
|
||||
public static List getHumansInRange(Level world, BlockPos blockposition, int i) {
|
||||
@ -59,11 +59,11 @@ index a1097950766ad31393340b423ea3f98a1f555368..49f25826aea528d9da085b9e65cb4c85
|
||||
|
||||
AABB axisalignedbb = (new AABB(blockposition)).inflate(d0).expandTowards(0.0D, (double) world.getHeight(), 0.0D);
|
||||
List<Player> list = world.getEntitiesOfClass(Player.class, axisalignedbb);
|
||||
@@ -325,12 +350,17 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
@@ -329,12 +354,17 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
}
|
||||
|
||||
private static void applyEffects(Level world, BlockPos pos, int beaconLevel, @Nullable MobEffect primaryEffect, @Nullable MobEffect secondaryEffect) {
|
||||
+ // Paper start - Custom beacon ranges
|
||||
private static void applyEffects(Level world, BlockPos pos, int beaconLevel, @Nullable Holder<MobEffect> primaryEffect, @Nullable Holder<MobEffect> secondaryEffect) {
|
||||
+ // Paper start - Custom beacon ranges
|
||||
+ BeaconBlockEntity.applyEffects(world, pos, beaconLevel, primaryEffect, secondaryEffect, null);
|
||||
+ }
|
||||
+ private static void applyEffects(Level world, BlockPos pos, int beaconLevel, @Nullable MobEffect primaryEffect, @Nullable MobEffect secondaryEffect, @Nullable BeaconBlockEntity blockEntity) {
|
||||
@ -78,7 +78,7 @@ index a1097950766ad31393340b423ea3f98a1f555368..49f25826aea528d9da085b9e65cb4c85
|
||||
|
||||
BeaconBlockEntity.applyEffect(list, primaryEffect, j, b0, true, pos); // Paper - BeaconEffectEvent
|
||||
|
||||
@@ -393,6 +423,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
@@ -395,6 +425,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
}
|
||||
|
||||
this.lockKey = LockCode.fromTag(nbt);
|
||||
@ -86,7 +86,7 @@ index a1097950766ad31393340b423ea3f98a1f555368..49f25826aea528d9da085b9e65cb4c85
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -406,6 +437,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
@@ -408,6 +439,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
||||
}
|
||||
|
||||
this.lockKey.addToTag(nbt);
|
||||
@ -95,10 +95,10 @@ index a1097950766ad31393340b423ea3f98a1f555368..49f25826aea528d9da085b9e65cb4c85
|
||||
|
||||
public void setCustomName(@Nullable Component customName) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java
|
||||
index c4890927419e27fd35e4e373fb09dcb182234fbf..2d77ee30f87491bd413d11687d9fd6def843104c 100644
|
||||
index 2dfbe061a064b0c79b96f644a1c3639bb900eca4..3f1bb225c4e6acdd9104e856d6a11d519119c9f4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java
|
||||
@@ -32,7 +32,7 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem
|
||||
@@ -33,7 +33,7 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem
|
||||
if (tileEntity instanceof BeaconBlockEntity) {
|
||||
BeaconBlockEntity beacon = (BeaconBlockEntity) tileEntity;
|
||||
|
||||
@ -107,9 +107,9 @@ index c4890927419e27fd35e4e373fb09dcb182234fbf..2d77ee30f87491bd413d11687d9fd6de
|
||||
Collection<LivingEntity> bukkit = new ArrayList<LivingEntity>(nms.size());
|
||||
|
||||
for (Player human : nms) {
|
||||
@@ -114,4 +114,21 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem
|
||||
public CraftBeacon copy() {
|
||||
return new CraftBeacon(this);
|
||||
@@ -120,4 +120,21 @@ public class CraftBeacon extends CraftBlockEntityState<BeaconBlockEntity> implem
|
||||
public CraftBeacon copy(Location location) {
|
||||
return new CraftBeacon(this, location);
|
||||
}
|
||||
+
|
||||
+ // Paper start
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add API for quit reason
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||
index 1113380f6f142d2faf36191aae158c747bed5bb9..ddc84de84c8a503a01e40c42fe83558af7159f8f 100644
|
||||
index 68d5be903a0d13e59c9e4bd6d85baaf0773547a0..fe89e8f509f3972ceb71c9aa6277524baa39985b 100644
|
||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||
@@ -179,12 +179,15 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -167,12 +167,15 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
|
||||
this.handlingFault = true;
|
||||
if (this.channel.isOpen()) {
|
||||
@ -18,17 +18,17 @@ index 1113380f6f142d2faf36191aae158c747bed5bb9..ddc84de84c8a503a01e40c42fe83558a
|
||||
+ if (player != null) player.quitReason = org.bukkit.event.player.PlayerQuitEvent.QuitReason.TIMED_OUT; // Paper - Add API for quit reason
|
||||
this.disconnect(Component.translatable("disconnect.timeout"));
|
||||
} else {
|
||||
MutableComponent ichatmutablecomponent = Component.translatable("disconnect.genericReason", "Internal Exception: " + throwable);
|
||||
MutableComponent ichatmutablecomponent = Component.translatable("disconnect.genericReason", "Internal Exception: " + String.valueOf(throwable));
|
||||
|
||||
+ if (player != null) player.quitReason = org.bukkit.event.player.PlayerQuitEvent.QuitReason.ERRONEOUS_STATE; // Paper - Add API for quit reason
|
||||
if (flag) {
|
||||
Connection.LOGGER.debug("Failed to sent packet", throwable);
|
||||
if (this.getSending() == PacketFlow.CLIENTBOUND) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 7c7e3d541733ea1784f8b90acbc8b1aecb6d7859..efe511fc6ab121263fe0c09763e09e0cf10a354a 100644
|
||||
index a182ab1c06c4644e9c14d7a2eff2620d827dfb2c..edfcfb91d907d6e1837e5a5d0e7abb8c8f6bcb66 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -274,6 +274,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -290,6 +290,7 @@ public class ServerPlayer extends Player {
|
||||
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
|
||||
public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
|
||||
public @Nullable String clientBrandName = null; // Paper - Brand support
|
||||
@ -37,10 +37,10 @@ index 7c7e3d541733ea1784f8b90acbc8b1aecb6d7859..efe511fc6ab121263fe0c09763e09e0c
|
||||
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) {
|
||||
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
index 6597e6e9987ddb5906909c22704fdfb6557aee8e..6bb846d3ee2fb54ab3ffa116607f2a83e538460e 100644
|
||||
index 215da3c52dc7b9e92c23f352fa7cffc2fb3d8a1a..d947eb533ba4dfd3b711e644d2a68238d1ec007a 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
@@ -315,6 +315,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -360,6 +360,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
final Component ichatbasecomponent = io.papermc.paper.adventure.PaperAdventure.asVanilla(event.reason()); // Paper - Adventure
|
||||
// CraftBukkit end
|
||||
|
||||
@ -49,10 +49,10 @@ index 6597e6e9987ddb5906909c22704fdfb6557aee8e..6bb846d3ee2fb54ab3ffa116607f2a83
|
||||
this.connection.disconnect(ichatbasecomponent);
|
||||
}));
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index b43dd483d99a0021ccb0a2e690e19aec5f4da606..f8e6dda015d6feec2d06ca84a734f371d72b5267 100644
|
||||
index 7af0239dbcaf46ee9f793072e832978400cdee0c..27069c61441c3abd59d922911f18143045363bdf 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -578,7 +578,7 @@ public abstract class PlayerList {
|
||||
@@ -576,7 +576,7 @@ public abstract class PlayerList {
|
||||
entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper - Inventory close reason
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ in IWorldServerData are removed as they were only used in certain places, with h
|
||||
values used in other places.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||
index 83d0db5a9f03ee3ead10d9f61e5f425330eae0e9..a089f72695b5fb49c7918e89fd5015e8c3a3dd0e 100644
|
||||
index 4b7e9bc8aa253d0eb12a2195416c618cccdc8690..d5d27b0d352ca3fd57a26605cb35c499e88b57fc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
||||
@@ -40,43 +40,53 @@ public class WanderingTraderSpawner implements CustomSpawner {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Expose world spawn angle
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index f8e6dda015d6feec2d06ca84a734f371d72b5267..b560d28562c27bfa2f4da5e79d73eed8eea80e15 100644
|
||||
index 27069c61441c3abd59d922911f18143045363bdf..b665cad02cf3ec79270a99d6733cb075c7e1940c 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -848,7 +848,7 @@ public abstract class PlayerList {
|
||||
@@ -847,7 +847,7 @@ public abstract class PlayerList {
|
||||
if (location == null) {
|
||||
worldserver1 = this.server.getLevel(Level.OVERWORLD);
|
||||
blockposition = entityplayer1.getSpawnPoint(worldserver1);
|
@ -6,10 +6,10 @@ Subject: [PATCH] Add Destroy Speed API
|
||||
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
index 01a1479711b7f7bb87db275a1edfab5a95464cca..a4252f9078c3ab7e458504496ebcdeb6875724d1 100644
|
||||
index 2303525542daa933a8de5978ac43d16223c6e5fd..48e8d0cc267706d3d8e29333d7fd6b89fdd88553 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
@@ -720,4 +720,19 @@ public class CraftBlockData implements BlockData {
|
||||
@@ -721,4 +721,19 @@ public class CraftBlockData implements BlockData {
|
||||
public BlockState createBlockState() {
|
||||
return CraftBlockStates.getBlockState(this.state, null);
|
||||
}
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 7c98519b13326acd8c9c871c0fbd0b8d52f80af2..b9f1848c382a52e6ef05c5d0c68015cfcfcde324 100644
|
||||
index 777f48d31b8b1d3a47471caba00ffb77a335c03b..8f437587d8989f3aa709ce36d1a10f237d28f0fa 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2621,7 +2621,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2686,7 +2686,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
if (data != null) {
|
||||
Preconditions.checkArgument(particle.getDataType().isInstance(data), "data (%s) should be %s", data.getClass(), particle.getDataType());
|
||||
}
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#clearActiveItem
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 87033a5d8dd5b67475657c3749f428a8e841a2f2..6848cdb3271b37972e98af78e85125409c650c4d 100644
|
||||
index aff940a7bacf53571f8e7bcd520419994596ebb3..7158f88e90c624b7ed3345ad7fb47745d4491d88 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -949,6 +949,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -934,6 +934,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return this.getHandle().getUseItem().asBukkitMirror();
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ Co-authored-by: Dylan Xaldin <Puremin0rez515@gmail.com>
|
||||
Co-authored-by: pop4959 <pop4959@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java b/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java
|
||||
index 92c2df6a6abd9c60e90b0b84ab66987557adb9c8..d5dccab8020e31f818420b8ee59c6d3928f1dfff 100644
|
||||
index b09bc1dac649ce9f4826edc1923c843804226993..ac8447e20531ad59d5e26c6db541d6e844d56c0f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/DensityFunctions.java
|
||||
@@ -509,6 +509,16 @@ public final class DensityFunctions {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Climbing should not bypass cramming gamerule
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 2c0c41ae455ae5894e6bd85830741143c3d8aaa5..82ccfd91dfd3cce35a35edf8f73ccdd1ddd1fd6a 100644
|
||||
index bbce55b02f848be720ad95cb5b896ff9ad1f66d0..717d596b2479a66861a83445ed87f40c7c0f69d8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1983,6 +1983,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -2011,6 +2011,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public boolean isPushable() {
|
||||
@ -44,10 +44,10 @@ index ee4495b67c46cf1282cdd6ad15b224b0b7b10bfb..e382a29b441b656f35bc24cb90f95cb4
|
||||
} else if (entity.level().isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) {
|
||||
return false;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index b98f82b619a1932e6d820a2c42120efdc03fc839..ed32b3f1107210d56e5653b2d5eddcf1deb39dfc 100644
|
||||
index 914c6499eb94665f0e3c4654dd05fc10d93f87d4..e38f0659836be4bebff06e8d8e7848abdcbda455 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3447,7 +3447,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3534,7 +3534,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return;
|
||||
}
|
||||
// Paper end - don't run getEntities if we're not going to use its result
|
||||
@ -56,7 +56,7 @@ index b98f82b619a1932e6d820a2c42120efdc03fc839..ed32b3f1107210d56e5653b2d5eddcf1
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
// Paper - don't run getEntities if we're not going to use its result; moved up
|
||||
@@ -3637,9 +3637,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3724,9 +3724,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return !this.isRemoved() && this.collides; // CraftBukkit
|
||||
}
|
||||
|
||||
@ -75,10 +75,10 @@ index b98f82b619a1932e6d820a2c42120efdc03fc839..ed32b3f1107210d56e5653b2d5eddcf1
|
||||
|
||||
// CraftBukkit start - collidable API
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
index bc9a710a92662b1f69b0f5b289780fe0a0d5ed32..44fa2d4f90389f5526746bd94a2450c03340bd0b 100644
|
||||
index 934fa26b8f347b8b2d90f79370b62165c0cdc312..dc27ddf5131e7398a5390a5187261d4c7fb6ccaa 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
@@ -90,7 +90,7 @@ public class Bat extends AmbientCreature {
|
||||
@@ -88,7 +88,7 @@ public class Bat extends AmbientCreature {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -88,10 +88,10 @@ index bc9a710a92662b1f69b0f5b289780fe0a0d5ed32..44fa2d4f90389f5526746bd94a2450c0
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Parrot.java b/src/main/java/net/minecraft/world/entity/animal/Parrot.java
|
||||
index fbad0e512b990c3d6885ecf92766ba6fd851cc20..f3f48225c2a1e4bd3d0091d1b4b7e4e150850ed2 100644
|
||||
index 1a129f43dc737218746b21ae5d03e3749bfee092..5ca96541abbb754f4d9fbe01f37ebaf19c532bbb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Parrot.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Parrot.java
|
||||
@@ -383,8 +383,8 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder<Parrot
|
||||
@@ -367,8 +367,8 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder<Parrot
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -103,10 +103,10 @@ index fbad0e512b990c3d6885ecf92766ba6fd851cc20..f3f48225c2a1e4bd3d0091d1b4b7e4e1
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
||||
index 6b7453281e32aae20778f26b4098df418401c45b..8fc65fd7347340a89dba0b9839497aadfcc67d79 100644
|
||||
index bff2627aa0c2cc48020e65c71a5862ab6e995f99..d53ef42e64d87790ea86d806153f047005accb9f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
||||
@@ -286,7 +286,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
||||
@@ -353,7 +353,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -116,10 +116,10 @@ index 6b7453281e32aae20778f26b4098df418401c45b..8fc65fd7347340a89dba0b9839497aad
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
index bc1a95f466b700bb0530cf0bb61fcbcbe21f5bbb..f62b5976e307a69ca40d51ae76126005c801df0c 100644
|
||||
index bf717b5bcd14291a99414eae5366c0b91ce68a68..b1b0b0554e0ad035463fd53aa440d9c079b7cfb4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
@@ -344,7 +344,7 @@ public class ArmorStand extends LivingEntity {
|
||||
@@ -350,7 +350,7 @@ public class ArmorStand extends LivingEntity {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -129,10 +129,10 @@ index bc1a95f466b700bb0530cf0bb61fcbcbe21f5bbb..f62b5976e307a69ca40d51ae76126005
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||
index e390735d411d815dcc4591da58db7017452acf31..be16ab6da56d2aa2a21ee378cfc44dbb14e108b3 100644
|
||||
index 2c97c8ee6dccb7f517e5edcd0c5d9620a3433f1e..1aecb6cc62b4b411ab0ff3b7fb11a5d9d050b959 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||
@@ -172,7 +172,7 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
||||
@@ -169,7 +169,7 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,10 +142,10 @@ index e390735d411d815dcc4591da58db7017452acf31..be16ab6da56d2aa2a21ee378cfc44dbb
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||
index e6a7bf9a27fb66d8c2210678dbe8afa8bbf5e7c8..0178eb918179b12d7d8eb56cd72e5bfc34cfdbaf 100644
|
||||
index 164468371e9a52ef96a183fdbcfe097d2fc24b56..d1eaadba8ce1f472a174afcfe8e0d059a121612c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||
@@ -157,7 +157,7 @@ public class Boat extends VehicleEntity implements VariantHolder<Boat.Type> {
|
||||
@@ -150,7 +150,7 @@ public class Boat extends VehicleEntity implements VariantHolder<Boat.Type> {
|
||||
}
|
||||
|
||||
@Override
|
71
patches/server/0458-Add-PlayerShearBlockEvent.patch
Normal file
71
patches/server/0458-Add-PlayerShearBlockEvent.patch
Normal file
@ -0,0 +1,71 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: JRoy <joshroy126@gmail.com>
|
||||
Date: Thu, 27 Aug 2020 15:02:48 -0400
|
||||
Subject: [PATCH] Add PlayerShearBlockEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
|
||||
index ce108f1cea8027aa7aab444689f7a29f2e54cc20..7b311f60ceae9942eeee0d2c7a170278e5983f2d 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
|
||||
@@ -127,7 +127,7 @@ public class BeehiveBlock extends BaseEntityBlock {
|
||||
}
|
||||
|
||||
public static void dropHoneycomb(Level world, BlockPos pos) {
|
||||
- popResource(world, pos, new ItemStack(Items.HONEYCOMB, 3));
|
||||
+ popResource(world, pos, new ItemStack(Items.HONEYCOMB, 3)); // Paper - Add PlayerShearBlockEvent; conflict on change, item needs to be set below
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -139,8 +139,19 @@ public class BeehiveBlock extends BaseEntityBlock {
|
||||
Item item = stack.getItem();
|
||||
|
||||
if (stack.is(Items.SHEARS)) {
|
||||
+ // Paper start - Add PlayerShearBlockEvent
|
||||
+ io.papermc.paper.event.block.PlayerShearBlockEvent event = new io.papermc.paper.event.block.PlayerShearBlockEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand), new java.util.ArrayList<>());
|
||||
+ event.getDrops().add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(new ItemStack(Items.HONEYCOMB, 3)));
|
||||
+ if (!event.callEvent()) {
|
||||
+ return InteractionResult.PASS;
|
||||
+ }
|
||||
+ // Paper end
|
||||
world.playSound(player, player.getX(), player.getY(), player.getZ(), SoundEvents.BEEHIVE_SHEAR, SoundSource.BLOCKS, 1.0F, 1.0F);
|
||||
- BeehiveBlock.dropHoneycomb(world, pos);
|
||||
+ // Paper start - Add PlayerShearBlockEvent
|
||||
+ for (org.bukkit.inventory.ItemStack itemDrop : event.getDrops()) {
|
||||
+ popResource(world, pos, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(itemDrop));
|
||||
+ }
|
||||
+ // Paper end - Add PlayerShearBlockEvent
|
||||
stack.hurtAndBreak(1, player, LivingEntity.getSlotForHand(hand));
|
||||
flag = true;
|
||||
world.gameEvent((Entity) player, (Holder) GameEvent.SHEAR, pos);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java b/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java
|
||||
index aa8667f0b14dc8944dd3457b431162e59bf54ada..4f4667cb036e8f5700ce175da5bf94725c64c9a7 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/PumpkinBlock.java
|
||||
@@ -40,10 +40,18 @@ public class PumpkinBlock extends Block {
|
||||
} else if (world.isClientSide) {
|
||||
return ItemInteractionResult.sidedSuccess(world.isClientSide);
|
||||
} else {
|
||||
+ // Paper start - Add PlayerShearBlockEvent
|
||||
+ io.papermc.paper.event.block.PlayerShearBlockEvent event = new io.papermc.paper.event.block.PlayerShearBlockEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemStack), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand), new java.util.ArrayList<>());
|
||||
+ event.getDrops().add(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(new ItemStack(Items.PUMPKIN_SEEDS, 4)));
|
||||
+ if (!event.callEvent()) {
|
||||
+ return InteractionResult.PASS;
|
||||
+ }
|
||||
+ // Paper end - Add PlayerShearBlockEvent
|
||||
Direction direction = hit.getDirection();
|
||||
Direction direction2 = direction.getAxis() == Direction.Axis.Y ? player.getDirection().getOpposite() : direction;
|
||||
world.playSound(null, pos, SoundEvents.PUMPKIN_CARVE, SoundSource.BLOCKS, 1.0F, 1.0F);
|
||||
world.setBlock(pos, Blocks.CARVED_PUMPKIN.defaultBlockState().setValue(CarvedPumpkinBlock.FACING, direction2), 11);
|
||||
+ for (org.bukkit.inventory.ItemStack item : event.getDrops()) { // Paper - Add PlayerShearBlockEvent
|
||||
ItemEntity itemEntity = new ItemEntity(
|
||||
world,
|
||||
(double)pos.getX() + 0.5 + (double)direction2.getStepX() * 0.65,
|
||||
@@ -57,6 +65,7 @@ public class PumpkinBlock extends Block {
|
||||
0.05 * (double)direction2.getStepZ() + world.random.nextDouble() * 0.02
|
||||
);
|
||||
world.addFreshEntity(itemEntity);
|
||||
+ } // Paper - Add PlayerShearBlockEvent
|
||||
stack.hurtAndBreak(1, player, LivingEntity.getSlotForHand(hand));
|
||||
world.gameEvent(player, GameEvent.SHEAR, pos);
|
||||
player.awardStat(Stats.ITEM_USED.get(Items.SHEARS));
|
@ -5,10 +5,10 @@ Subject: [PATCH] Limit recipe packets
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 26c9d483810c8679fb2eff42c9176b8037cd56f8..f66c6167f24941b9cfdf4479d6cfbffcc29a7ba6 100644
|
||||
index 355b1726e90eb796fa2c1e21108bcf793637bf6c..10f0a84c119826e52fac6ca8e1d3e6276cc72392 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -257,6 +257,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -267,6 +267,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
// CraftBukkit start - multithreaded fields
|
||||
private final AtomicInteger chatSpamTickCount = new AtomicInteger();
|
||||
private final java.util.concurrent.atomic.AtomicInteger tabSpamLimiter = new java.util.concurrent.atomic.AtomicInteger(); // Paper - configurable tab spam limits
|
||||
@ -16,7 +16,7 @@ index 26c9d483810c8679fb2eff42c9176b8037cd56f8..f66c6167f24941b9cfdf4479d6cfbffc
|
||||
// CraftBukkit end
|
||||
private int dropSpamTickCount;
|
||||
private double firstGoodX;
|
||||
@@ -376,6 +377,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -390,6 +391,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
// CraftBukkit start
|
||||
for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ;
|
||||
if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - configurable tab spam limits
|
||||
@ -24,7 +24,7 @@ index 26c9d483810c8679fb2eff42c9176b8037cd56f8..f66c6167f24941b9cfdf4479d6cfbffc
|
||||
/* Use thread-safe field access instead
|
||||
if (this.chatSpamTickCount > 0) {
|
||||
--this.chatSpamTickCount;
|
||||
@@ -2978,6 +2980,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -3063,6 +3065,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
@Override
|
||||
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Player Chunk Load/Unload Events
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java
|
||||
index 51bc50111ff30856038245f2614543d84874d930..e890162e1cea3538ed7dea7b78ee2e5346a8ce7b 100644
|
||||
index 3548be0bfacc7ff2cf0ed5fac4d8de09bd2a415f..c502d9b85eb68b277ae17dfea34e0475f0156647 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/PlayerChunkSender.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/PlayerChunkSender.java
|
||||
@@ -44,6 +44,11 @@ public class PlayerChunkSender {
|
@ -12,10 +12,10 @@ 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 a24cc02a62585d7c04d36456739b11bddccf1a15..984e41619230db4579b028af18670c471aa13096 100644
|
||||
index d73bb05272d69471644b28f8c704a3bfceca72c2..8b4ea53b891bb7a5ceb791c4afaaf33814d9b6f6 100644
|
||||
--- a/src/main/java/com/mojang/serialization/Dynamic.java
|
||||
+++ b/src/main/java/com/mojang/serialization/Dynamic.java
|
||||
@@ -17,6 +17,7 @@ import java.util.stream.Stream;
|
||||
@@ -19,6 +19,7 @@ import java.util.stream.Stream;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Dynamic<T> extends DynamicLike<T> {
|
||||
@ -23,7 +23,7 @@ index a24cc02a62585d7c04d36456739b11bddccf1a15..984e41619230db4579b028af18670c47
|
||||
private final T value;
|
||||
|
||||
public Dynamic(final DynamicOps<T> ops) {
|
||||
@@ -113,7 +114,7 @@ public class Dynamic<T> extends DynamicLike<T> {
|
||||
@@ -120,7 +121,7 @@ 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) {
|
@ -5,23 +5,23 @@ Subject: [PATCH] Expose LivingEntity hurt direction
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index 603e003fbd39870a0e249151885b3b8f3e120afe..6fe21c29aa9d119490fbf1d69eb03c146674cde5 100644
|
||||
index 8fe41d4291736fd8c45d73429062a597d54ac30b..ecae1708feee507df1440ad2822e7af8c3c278de 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -180,7 +180,7 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -187,7 +187,7 @@ public abstract class Player extends LivingEntity {
|
||||
private Optional<GlobalPos> lastDeathLocation;
|
||||
@Nullable
|
||||
public FishingHook fishing;
|
||||
- protected float hurtDir;
|
||||
+ public float hurtDir; // Paper - protected -> public
|
||||
public boolean affectsSpawning = true; // Paper - Affects Spawning API
|
||||
|
||||
// CraftBukkit start
|
||||
@Nullable
|
||||
public Vec3 currentImpulseImpactPos;
|
||||
@Nullable
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
index d5a8f019e88de30400733cdc3178eb982ccca341..e7726862f99cb16b7335b06675af73db773b54e8 100644
|
||||
index 9393e9d21fcc41cb0f20b98d9f28c95b0e523f62..796945fb1a8b43987ed9f01375113b2c13ff67c0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
@@ -127,6 +127,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
@@ -125,6 +125,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,10 +36,10 @@ index d5a8f019e88de30400733cdc3178eb982ccca341..e7726862f99cb16b7335b06675af73db
|
||||
public int getSleepTicks() {
|
||||
return this.getHandle().sleepCounter;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 6848cdb3271b37972e98af78e85125409c650c4d..4ac52885618bf062eb34672b8fc60331a9c8f76a 100644
|
||||
index 7158f88e90c624b7ed3345ad7fb47745d4491d88..b88077ac1ed99057b8a9361ea550cd2b00040f88 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -1006,4 +1006,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -991,4 +991,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
this.getHandle().take(((CraftItem) item).getHandle(), quantity);
|
||||
}
|
||||
// Paper end - pickup animation API
|
@ -5,10 +5,10 @@ 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 657df7b4aa8c4a19bf8e085d8235aa0d1a1b08da..368c4bddbe6fe88ca408147df1fa58183dd513a4 100644
|
||||
index f0e1bb3d9e4254d2c32f28fb715ea429c7646cec..253563371aa05954c19607b98675e37450e772ef 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -303,6 +303,10 @@ public class CraftEventFactory {
|
||||
@@ -302,6 +302,10 @@ public class CraftEventFactory {
|
||||
return BedEnterResult.TOO_FAR_AWAY;
|
||||
case NOT_SAFE:
|
||||
return BedEnterResult.NOT_SAFE;
|
@ -6,10 +6,10 @@ Subject: [PATCH] Fix crash from invalid ingredient lists in
|
||||
|
||||
|
||||
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 ddc002f269527201724457c0b820788200441e0c..9bc5a9592cabe087effc03e5347ea1d75794960b 100644
|
||||
index 79e81fd5490a493b595dc1034641e13451e5a61a..6e29b5729b8184d13065c9c4e18f6e450c9d88a6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
||||
@@ -261,7 +261,11 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
||||
@@ -269,7 +269,11 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
}
|
||||
if (!event.isCancelled()) {
|
@ -5,12 +5,12 @@ Subject: [PATCH] Add TargetHitEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/TargetBlock.java b/src/main/java/net/minecraft/world/level/block/TargetBlock.java
|
||||
index 02f6d5b523c3d4185a68adb419b2710768ed249f..4ae14ee74a83c8b12ac2e3475863e6d77979af0a 100644
|
||||
index 549ca8e9b265635bd3d5863682fe240f3f9f3f58..ee4eb863b6c02f2bcbb03ca413fc98811d409ac5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/TargetBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/TargetBlock.java
|
||||
@@ -42,6 +42,10 @@ public class TargetBlock extends Block {
|
||||
@Override
|
||||
public void onProjectileHit(Level world, BlockState state, BlockHitResult hit, Projectile projectile) {
|
||||
protected void onProjectileHit(Level world, BlockState state, BlockHitResult hit, Projectile projectile) {
|
||||
int i = updateRedstoneOutput(world, state, hit, projectile);
|
||||
+ // Paper start - Add TargetHitEvent
|
||||
+ }
|
@ -28,10 +28,10 @@ index ffec3deb9bcd31d51974c1deda2e76bc8374e5c5..a3d247c93ac1a2d872ff0e3841efc3d7
|
||||
|
||||
public Vec3 decode(long x, long y, long z) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 82ccfd91dfd3cce35a35edf8f73ccdd1ddd1fd6a..c3ca11cc4abe85132b099af1cb27772dbf40bfe1 100644
|
||||
index 717d596b2479a66861a83445ed87f40c7c0f69d8..31911870e5056391d67c49fa68d59010534bf35f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4186,6 +4186,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -4212,6 +4212,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return;
|
||||
}
|
||||
// Paper end - Block invalid positions and bounding box
|
@ -8,36 +8,34 @@ Before this patch, instant effects would be applied before the potion ItemStack
|
||||
This patch makes it so that instant effects are applied after the potion ItemStack is removed, and the glass bottle is only put into the player's inventory if the player is not dead. Otherwise, the glass bottle is dropped on the ground.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/PotionItem.java b/src/main/java/net/minecraft/world/item/PotionItem.java
|
||||
index bb19a00c24e92058e05076b2ca0278dcae1890ae..5c62741e3a3854a7f674bfec49758f837f3bb9a0 100644
|
||||
index de0b68b128e6ffbd31aebb4361e4859d495f89b5..042a9cf9c15fd30bc30e03d0e0311c70e40e6950 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/PotionItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/PotionItem.java
|
||||
@@ -50,6 +50,7 @@ public class PotionItem extends Item {
|
||||
@@ -55,12 +55,13 @@ public class PotionItem extends Item {
|
||||
CriteriaTriggers.CONSUME_ITEM.trigger((ServerPlayer) entityhuman, stack);
|
||||
}
|
||||
|
||||
+ List<MobEffectInstance> instantLater = new java.util.ArrayList<>(); // Paper - Fix harming potion dupe
|
||||
+ List<net.minecraft.world.effect.MobEffectInstance> instantLater = new java.util.ArrayList<>(); // Paper - Fix harming potion dupe
|
||||
if (!world.isClientSide) {
|
||||
List<MobEffectInstance> list = PotionUtils.getMobEffects(stack);
|
||||
Iterator iterator = list.iterator();
|
||||
@@ -58,7 +59,7 @@ public class PotionItem extends Item {
|
||||
MobEffectInstance mobeffect = (MobEffectInstance) iterator.next();
|
||||
PotionContents potioncontents = (PotionContents) stack.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY);
|
||||
|
||||
if (mobeffect.getEffect().isInstantenous()) {
|
||||
- mobeffect.getEffect().applyInstantenousEffect(entityhuman, entityhuman, user, mobeffect.getAmplifier(), 1.0D);
|
||||
+ instantLater.add(mobeffect); // Paper - Fix harming potion dupe
|
||||
potioncontents.forEachEffect((mobeffect) -> {
|
||||
if (((MobEffect) mobeffect.getEffect().value()).isInstantenous()) {
|
||||
- ((MobEffect) mobeffect.getEffect().value()).applyInstantenousEffect(entityhuman, entityhuman, user, mobeffect.getAmplifier(), 1.0D);
|
||||
+ instantLater.add(mobeffect); // Paper
|
||||
} else {
|
||||
user.addEffect(new MobEffectInstance(mobeffect), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.POTION_DRINK); // CraftBukkit
|
||||
user.addEffect(mobeffect, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.POTION_DRINK); // CraftBukkit
|
||||
}
|
||||
@@ -72,7 +73,18 @@ public class PotionItem extends Item {
|
||||
}
|
||||
@@ -73,7 +74,18 @@ public class PotionItem extends Item {
|
||||
stack.consume(1, entityhuman);
|
||||
}
|
||||
|
||||
+ // Paper start - Fix harming potion dupe
|
||||
+ for (MobEffectInstance mobeffect : instantLater) {
|
||||
+ mobeffect.getEffect().applyInstantenousEffect(entityhuman, entityhuman, user, mobeffect.getAmplifier(), 1.0D);
|
||||
+ for (net.minecraft.world.effect.MobEffectInstance mobeffect : instantLater) {
|
||||
+ mobeffect.getEffect().value().applyInstantenousEffect(entityhuman, entityhuman, user, mobeffect.getAmplifier(), 1.0D);
|
||||
+ }
|
||||
+ // Paper end - Fix harming potion dupe
|
||||
if (entityhuman == null || !entityhuman.getAbilities().instabuild) {
|
||||
if (entityhuman == null || !entityhuman.hasInfiniteMaterials()) {
|
||||
+ // Paper start - Fix harming potion dupe
|
||||
+ if (user.getHealth() <= 0 && !user.level().getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_KEEPINVENTORY)) {
|
||||
+ user.spawnAtLocation(new ItemStack(Items.GLASS_BOTTLE), 0);
|
@ -5,10 +5,10 @@ Subject: [PATCH] Allow disabling mob spawner spawn egg transformation
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/SpawnEggItem.java b/src/main/java/net/minecraft/world/item/SpawnEggItem.java
|
||||
index 8176b64e49166cc24ef7f011881fda38bc68c2a4..3bfbf7daa190b03f978b9fc72233c18c383b6659 100644
|
||||
index 6e91fec416493b2fabe1e8a6214ab7673212e451..9cea8da84f39bb3f687139ef213ccea358724dee 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/SpawnEggItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/SpawnEggItem.java
|
||||
@@ -63,6 +63,8 @@ public class SpawnEggItem extends Item {
|
||||
@@ -69,6 +69,8 @@ public class SpawnEggItem extends Item {
|
||||
EntityType entitytypes;
|
||||
|
||||
if (tileentity instanceof Spawner) {
|
||||
@ -16,4 +16,4 @@ index 8176b64e49166cc24ef7f011881fda38bc68c2a4..3bfbf7daa190b03f978b9fc72233c18c
|
||||
+
|
||||
Spawner spawner = (Spawner) tileentity;
|
||||
|
||||
entitytypes = this.getType(itemstack.getTag());
|
||||
entitytypes = this.getType(itemstack);
|
@ -12,22 +12,22 @@ requesting the world.
|
||||
Track spigot issue to see when fixed: https://hub.spigotmc.org/jira/browse/SPIGOT-6181
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
index 8f144a357174bbe096ac9b38a5e67a61127d7b87..0ca0808c5eeeba969c048b422af37a273217ff52 100644
|
||||
index d42d39dff5aeb91c5b1e6a7fb967ce70f1a88b7e..38c0855a6f9398f8d075f304288cf9e9f695770a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
@@ -15,6 +15,8 @@ import net.minecraft.core.BlockPos;
|
||||
@@ -21,6 +21,8 @@ import net.minecraft.core.component.DataComponents;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.nbt.NbtOps;
|
||||
+import net.minecraft.nbt.NumericTag;
|
||||
+import net.minecraft.nbt.StringTag;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
@@ -108,7 +110,26 @@ public class MapItemSavedData extends SavedData {
|
||||
@@ -120,7 +122,26 @@ public class MapItemSavedData extends SavedData {
|
||||
}
|
||||
|
||||
public static MapItemSavedData load(CompoundTag nbt) {
|
||||
public static MapItemSavedData load(CompoundTag nbt, HolderLookup.Provider registryLookup) {
|
||||
- DataResult<ResourceKey<Level>> dataresult = DimensionType.parseLegacy(new Dynamic(NbtOps.INSTANCE, nbt.get("dimension"))); // CraftBukkit - decompile error
|
||||
+ // Paper start - fix "Not a string" spam
|
||||
+ Tag dimension = nbt.get("dimension");
|
48
patches/server/0473-Add-PlayerFlowerPotManipulateEvent.patch
Normal file
48
patches/server/0473-Add-PlayerFlowerPotManipulateEvent.patch
Normal file
@ -0,0 +1,48 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MisterVector <whizkid3000@hotmail.com>
|
||||
Date: Tue, 13 Aug 2019 19:45:06 -0700
|
||||
Subject: [PATCH] Add PlayerFlowerPotManipulateEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java b/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java
|
||||
index b0c950fa7426dc762b99080d98831b961fc19da2..7194565ad1a910fe300d8664a30b35c4eff18cb7 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/FlowerPotBlock.java
|
||||
@@ -63,6 +63,18 @@ public class FlowerPotBlock extends Block {
|
||||
} else if (!this.isEmpty()) {
|
||||
return ItemInteractionResult.CONSUME;
|
||||
} else {
|
||||
+ // Paper start - Add PlayerFlowerPotManipulateEvent
|
||||
+ org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos);
|
||||
+ org.bukkit.inventory.ItemStack placedStack = org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(stack);
|
||||
+
|
||||
+ io.papermc.paper.event.player.PlayerFlowerPotManipulateEvent event = new io.papermc.paper.event.player.PlayerFlowerPotManipulateEvent((org.bukkit.entity.Player) player.getBukkitEntity(), block, placedStack, true);
|
||||
+ if (!event.callEvent()) {
|
||||
+ // Update client
|
||||
+ player.containerMenu.sendAllDataToRemote();
|
||||
+
|
||||
+ return ItemInteractionResult.CONSUME;
|
||||
+ }
|
||||
+ // Paper end - Add PlayerFlowerPotManipulateEvent
|
||||
world.setBlock(pos, blockState, 3);
|
||||
world.gameEvent(player, GameEvent.BLOCK_CHANGE, pos);
|
||||
player.awardStat(Stats.POT_FLOWER);
|
||||
@@ -77,6 +89,18 @@ public class FlowerPotBlock extends Block {
|
||||
return InteractionResult.CONSUME;
|
||||
} else {
|
||||
ItemStack itemStack = new ItemStack(this.potted);
|
||||
+ // Paper start - Add PlayerFlowerPotManipulateEvent
|
||||
+ org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos);
|
||||
+ org.bukkit.inventory.ItemStack pottedStack = new org.bukkit.inventory.ItemStack(org.bukkit.craftbukkit.block.CraftBlockType.minecraftToBukkit(this.potted));
|
||||
+
|
||||
+ io.papermc.paper.event.player.PlayerFlowerPotManipulateEvent event = new io.papermc.paper.event.player.PlayerFlowerPotManipulateEvent((org.bukkit.entity.Player) player.getBukkitEntity(), block, pottedStack, false);
|
||||
+ if (!event.callEvent()) {
|
||||
+ // Update client
|
||||
+ player.containerMenu.sendAllDataToRemote();
|
||||
+
|
||||
+ return InteractionResult.PASS;
|
||||
+ }
|
||||
+ // Paper end - Add PlayerFlowerPotManipulateEvent
|
||||
if (!player.addItem(itemStack)) {
|
||||
player.drop(itemStack, false);
|
||||
}
|
@ -11,10 +11,10 @@ Subject: [PATCH] Fix interact event not being called sometimes
|
||||
Co-authored-by: Moulberry <james.jenour@protonmail.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index f66c6167f24941b9cfdf4479d6cfbffcc29a7ba6..a16751a23eb6aab8c25520127d4dbea0c991c32c 100644
|
||||
index 10f0a84c119826e52fac6ca8e1d3e6276cc72392..e0c11559295d00445d5ba0543a81f49dc2314266 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1760,7 +1760,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1765,7 +1765,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
MutableComponent ichatmutablecomponent = Component.translatable("build.tooHigh", i - 1).withStyle(ChatFormatting.RED);
|
||||
|
||||
this.player.sendSystemMessage(ichatmutablecomponent, true);
|
||||
@ -23,7 +23,7 @@ index f66c6167f24941b9cfdf4479d6cfbffcc29a7ba6..a16751a23eb6aab8c25520127d4dbea0
|
||||
this.player.swing(enumhand, true);
|
||||
}
|
||||
}
|
||||
@@ -2306,13 +2306,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -2381,13 +2381,20 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
double d3 = this.player.gameMode.getGameModeForPlayer() == GameType.CREATIVE ? 5.0D : 4.5D;
|
||||
// SPIGOT-5607: Only call interact event if no block or entity is being clicked. Use bukkit ray trace method, because it handles blocks and entities at the same time
|
||||
// SPIGOT-7429: Make sure to call PlayerInteractEvent for spectators and non-pickable entities
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix nerfed slime when splitting
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java
|
||||
index 00dcbcbf20995ab6aca508d7ffe703bcb0d9b1a9..0b8bcf9fc13ec6645c9e11cf52047272cdfce68c 100644
|
||||
index 7062ef1cfd7d6279a4c6693cbdb80da49f23c542..b32213c5a3a1ecaf602cf34bed44c537521c2846 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
|
||||
@@ -251,6 +251,7 @@ public class Slime extends Mob implements Enemy {
|
||||
@@ -252,6 +252,7 @@ public class Slime extends Mob implements Enemy {
|
||||
entityslime.setPersistenceRequired();
|
||||
}
|
||||
|
68
patches/server/0477-Add-EntityLoadCrossbowEvent.patch
Normal file
68
patches/server/0477-Add-EntityLoadCrossbowEvent.patch
Normal file
@ -0,0 +1,68 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: JRoy <joshroy126@gmail.com>
|
||||
Date: Wed, 7 Oct 2020 12:04:01 -0400
|
||||
Subject: [PATCH] Add EntityLoadCrossbowEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||
index 65f23bfb2de91be7560800ff87eab7ad88cb1849..0f6504a7160bc304b3af554f8740c65e2987cd37 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||
@@ -80,7 +80,14 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||
public void releaseUsing(ItemStack stack, Level world, LivingEntity user, int remainingUseTicks) {
|
||||
int i = this.getUseDuration(stack) - remainingUseTicks;
|
||||
float f = getPowerForTime(i, stack);
|
||||
- if (f >= 1.0F && !isCharged(stack) && tryLoadProjectiles(user, stack)) {
|
||||
+ // Paper start
|
||||
+ if (f >= 1.0F && !isCharged(stack)) {
|
||||
+ final io.papermc.paper.event.entity.EntityLoadCrossbowEvent event = new io.papermc.paper.event.entity.EntityLoadCrossbowEvent(user.getBukkitLivingEntity(), stack.asBukkitMirror(), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(user.getUsedItemHand()));
|
||||
+ if (!event.callEvent() || !tryLoadProjectiles(user, stack, event.shouldConsumeItem())) {
|
||||
+ if (user instanceof ServerPlayer player) player.containerMenu.sendAllDataToRemote();
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end - Add EntityLoadCrossbowEvent
|
||||
world.playSound(
|
||||
null,
|
||||
user.getX(),
|
||||
@@ -94,8 +101,14 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||
}
|
||||
}
|
||||
|
||||
- private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack crossbow) {
|
||||
- List<ItemStack> list = draw(crossbow, shooter.getProjectile(crossbow), shooter);
|
||||
+ @io.papermc.paper.annotation.DoNotUse // Paper - Add EntityLoadCrossbowEvent
|
||||
+ private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack crossbow) {
|
||||
+ // Paper start - Add EntityLoadCrossbowEvent
|
||||
+ return CrossbowItem.tryLoadProjectiles(shooter, crossbow, true);
|
||||
+ }
|
||||
+ private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack crossbow, boolean consume) {
|
||||
+ List<ItemStack> list = draw(crossbow, shooter.getProjectile(crossbow), shooter, consume);
|
||||
+ // Paper end - Add EntityLoadCrossbowEvent
|
||||
if (!list.isEmpty()) {
|
||||
crossbow.set(DataComponents.CHARGED_PROJECTILES, ChargedProjectiles.of(list));
|
||||
return true;
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java b/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java
|
||||
index 416bdff5cda842143038180592ad231a1d19d926..f91ce87491b18f4f4ae6458192d1f320b308102a 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java
|
||||
@@ -139,6 +139,11 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
}
|
||||
|
||||
protected static List<ItemStack> draw(ItemStack weaponStack, ItemStack projectileStack, LivingEntity shooter) {
|
||||
+ // Paper start
|
||||
+ return draw(weaponStack, projectileStack, shooter, false);
|
||||
+ }
|
||||
+ protected static List<ItemStack> draw(ItemStack weaponStack, ItemStack projectileStack, LivingEntity shooter, boolean consume) {
|
||||
+ // Paper end
|
||||
if (projectileStack.isEmpty()) {
|
||||
return List.of();
|
||||
} else {
|
||||
@@ -148,7 +153,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
ItemStack itemstack2 = projectileStack.copy();
|
||||
|
||||
for (int k = 0; k < j; ++k) {
|
||||
- list.add(ProjectileWeaponItem.useAmmo(weaponStack, k == 0 ? projectileStack : itemstack2, shooter, k > 0));
|
||||
+ list.add(ProjectileWeaponItem.useAmmo(weaponStack, k == 0 ? projectileStack : itemstack2, shooter, k > 0 || consume)); // Paper
|
||||
}
|
||||
|
||||
return list;
|
@ -18,10 +18,10 @@ index c8c358531dbc167e249bac2af246c5e34fbdd4df..10c1790226e25da3b9b599c9a40de57d
|
||||
return Component.translatable("commands.gamerule.set", key.getId(), t0.toString());
|
||||
}, true);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java
|
||||
index ba825ff3df79903aefe1a4cb14efab9a302397d7..ac7a5410b01a6741e3b548d153f37ea1d8c1a4cb 100644
|
||||
index 0b46ad360be919e4aeb0ffc0eebae9fe712fb861..51e560d7856f230c5aa2dc32706c3a4996720aa5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/GameRules.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/GameRules.java
|
||||
@@ -286,10 +286,10 @@ public class GameRules {
|
||||
@@ -293,10 +293,10 @@ public class GameRules {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ index ba825ff3df79903aefe1a4cb14efab9a302397d7..ac7a5410b01a6741e3b548d153f37ea1
|
||||
this.onChanged(((CommandSourceStack) context.getSource()).getLevel()); // CraftBukkit - per-world
|
||||
}
|
||||
|
||||
@@ -347,8 +347,11 @@ public class GameRules {
|
||||
@@ -354,8 +354,11 @@ public class GameRules {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -49,7 +49,7 @@ index ba825ff3df79903aefe1a4cb14efab9a302397d7..ac7a5410b01a6741e3b548d153f37ea1
|
||||
}
|
||||
|
||||
public boolean get() {
|
||||
@@ -412,8 +415,11 @@ public class GameRules {
|
||||
@@ -427,8 +430,11 @@ public class GameRules {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -64,10 +64,10 @@ index ba825ff3df79903aefe1a4cb14efab9a302397d7..ac7a5410b01a6741e3b548d153f37ea1
|
||||
|
||||
public int get() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index afb65de5fbff44b4ca455c778030c3387c2dafc8..3893b70926140f3658f6bab68c5c4f7c41dc603a 100644
|
||||
index 4d75cf0ec9e835b4274297275d52f08a6a65aeca..4a51d0125d59b1edd2da7aac1db1ca49374c008c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1884,8 +1884,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1883,8 +1883,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
if (!this.isGameRule(rule)) return false;
|
||||
|
||||
@ -82,7 +82,7 @@ index afb65de5fbff44b4ca455c778030c3387c2dafc8..3893b70926140f3658f6bab68c5c4f7c
|
||||
handle.onChanged(this.getHandle());
|
||||
return true;
|
||||
}
|
||||
@@ -1921,8 +1926,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1920,8 +1925,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
if (!this.isGameRule(rule.getName())) return false;
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add ServerResourcesReloadedEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 70ae9d44dd860014fd9a599e3a4e4a3fe80068ff..23d68feaa060514e6582a9d47a9ca7db9421c29c 100644
|
||||
index 18efcf55bf13fa17ac532cca4c213e5b6e14979f..b083298d2bcf0d4c6213d6ac8645b8c084cfc6de 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2036,7 +2036,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2097,7 +2097,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
return this.functionManager;
|
||||
}
|
||||
|
||||
@ -19,10 +19,10 @@ index 70ae9d44dd860014fd9a599e3a4e4a3fe80068ff..23d68feaa060514e6582a9d47a9ca7db
|
||||
+ }
|
||||
+ public CompletableFuture<Void> reloadResources(Collection<String> dataPacks, io.papermc.paper.event.server.ServerResourcesReloadedEvent.Cause cause) {
|
||||
+ // Paper end - Add ServerResourcesReloadedEvent
|
||||
RegistryAccess.Frozen iregistrycustom_dimension = this.registries.getAccessForLoading(RegistryLayer.RELOADABLE);
|
||||
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
|
||||
Stream<String> stream = dataPacks.stream(); // CraftBukkit - decompile error
|
||||
@@ -2069,6 +2075,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
PackRepository resourcepackrepository = this.packRepository;
|
||||
@@ -2129,6 +2135,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
||||
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
|
||||
org.bukkit.craftbukkit.block.data.CraftBlockData.reloadCache(); // Paper - cache block data strings; they can be defined by datapacks so refresh it here
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add world settings for mobs picking up loot
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
index dadb419a04b343d6ba59353c6caa1a50aa07b67f..117d466e1b4f545f6fd5006c3822c5586db96032 100644
|
||||
index a19a51a40d69ad71b85b2e7e8b4cfab6d8343196..7013f1b76311a11fb7e2543ab1e792479ecad610 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
@@ -153,7 +153,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
@@ -145,7 +145,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
this.populateDefaultEquipmentSlots(randomsource, difficulty);
|
||||
this.populateDefaultEquipmentEnchantments(randomsource, difficulty);
|
||||
this.reassessWeaponGoal();
|
||||
@ -18,11 +18,11 @@ index dadb419a04b343d6ba59353c6caa1a50aa07b67f..117d466e1b4f545f6fd5006c3822c558
|
||||
LocalDate localdate = LocalDate.now();
|
||||
int i = localdate.get(ChronoField.DAY_OF_MONTH);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
index 67aaa688b4db0c4304699fdd983730cdb4a68058..a0cd226d4f5c700c84604527ddde35466c7654bb 100644
|
||||
index eacfdfb47299af6900bd39595da8daedb640b959..c8ce36d67901e2897f521d5b4f5041348f235ae7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -507,7 +507,7 @@ public class Zombie extends Monster {
|
||||
Object object = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt);
|
||||
@@ -498,7 +498,7 @@ public class Zombie extends Monster {
|
||||
Object object = super.finalizeSpawn(world, difficulty, spawnReason, entityData);
|
||||
float f = difficulty.getSpecialMultiplier();
|
||||
|
||||
- this.setCanPickUpLoot(randomsource.nextFloat() < 0.55F * f);
|
@ -5,25 +5,25 @@ Subject: [PATCH] Add BlockFailedDispenseEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java
|
||||
index d77ca08832105e82cee265eea222e0d64a8876ef..5593a0aa9e618071b6521b213dde0f628348c3dc 100644
|
||||
index c7256ffbe57c594556ee85134c9ab166f8c0e0c7..94bcbaf7daf7dfe566f508d1170a433930d9d49a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java
|
||||
@@ -95,8 +95,10 @@ public class DispenserBlock extends BaseEntityBlock {
|
||||
@@ -101,8 +101,10 @@ public class DispenserBlock extends BaseEntityBlock {
|
||||
int i = tileentitydispenser.getRandomSlot(world.random);
|
||||
|
||||
if (i < 0) {
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFailedDispenseEvent(world, pos)) { // Paper - Add BlockFailedDispenseEvent
|
||||
world.levelEvent(1001, pos, 0);
|
||||
world.gameEvent(GameEvent.BLOCK_ACTIVATE, pos, GameEvent.Context.of(tileentitydispenser.getBlockState()));
|
||||
world.gameEvent((Holder) GameEvent.BLOCK_ACTIVATE, pos, GameEvent.Context.of(tileentitydispenser.getBlockState()));
|
||||
+ } // Paper - Add BlockFailedDispenseEvent
|
||||
} else {
|
||||
ItemStack itemstack = tileentitydispenser.getItem(i);
|
||||
DispenseItemBehavior idispensebehavior = this.getDispenseMethod(itemstack);
|
||||
DispenseItemBehavior idispensebehavior = this.getDispenseMethod(world, itemstack);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/DropperBlock.java b/src/main/java/net/minecraft/world/level/block/DropperBlock.java
|
||||
index 913ed110d8402d377152753325901eb7f3ac82d6..1d13f8a1009d6eda351c697052d499d594a6aaa8 100644
|
||||
index e772b6f8f78ad1292b8fa268e8bb4001a38706c6..efa7cf50b5577f87a2dfa61b59bf81052794fbf1 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/DropperBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/DropperBlock.java
|
||||
@@ -59,6 +59,7 @@ public class DropperBlock extends DispenserBlock {
|
||||
@@ -60,6 +60,7 @@ public class DropperBlock extends DispenserBlock {
|
||||
int i = tileentitydispenser.getRandomSlot(world.random);
|
||||
|
||||
if (i < 0) {
|
||||
@ -32,10 +32,10 @@ index 913ed110d8402d377152753325901eb7f3ac82d6..1d13f8a1009d6eda351c697052d499d5
|
||||
} else {
|
||||
ItemStack itemstack = tileentitydispenser.getItem(i);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 368c4bddbe6fe88ca408147df1fa58183dd513a4..ea26b27279b6e09015908f164a061891f4ab9002 100644
|
||||
index 253563371aa05954c19607b98675e37450e772ef..13e4cb7af50b3a03523d84dd72ca6a122ca041ad 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -2039,4 +2039,12 @@ public class CraftEventFactory {
|
||||
@@ -2034,4 +2034,12 @@ public class CraftEventFactory {
|
||||
return org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getPotion());
|
||||
}
|
||||
// Paper end - WitchReadyPotionEvent
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerLoomPatternSelectEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/LoomMenu.java b/src/main/java/net/minecraft/world/inventory/LoomMenu.java
|
||||
index a98157f600837898dd8ef12671c4bb713e30f30c..e8c755dc71d9818f025eb25224122b19c5f9e15b 100644
|
||||
index 4bd720a97da27c4fd97788d4c504c0174f0f6c25..03b6622ec13338005005c9a11e0e6395da1b15a7 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/LoomMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/LoomMenu.java
|
||||
@@ -173,8 +173,36 @@ public class LoomMenu extends AbstractContainerMenu {
|
||||
@@ -174,8 +174,36 @@ public class LoomMenu extends AbstractContainerMenu {
|
||||
@Override
|
||||
public boolean clickMenuButton(net.minecraft.world.entity.player.Player player, int id) {
|
||||
if (id >= 0 && id < this.selectablePatterns.size()) {
|
@ -10,10 +10,10 @@ public net.minecraft.world.entity.monster.Zombie DOOR_BREAKING_PREDICATE
|
||||
Co-authored-by: Doc <nachito94@msn.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
|
||||
index 89a05518e1b95f6edc1ac57f6ed9c3946b87b93e..0ee020848cdfd0c069f1e8d3a9516a339d82467c 100644
|
||||
index d4ed75afc61620cbc79da07b6511c247b829e41f..b3da310d6fd1d533da805c38c2f449cf06d01492 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java
|
||||
@@ -196,7 +196,7 @@ public class Vindicator extends AbstractIllager {
|
||||
@@ -176,7 +176,7 @@ public class Vindicator extends AbstractIllager {
|
||||
|
||||
static class VindicatorBreakDoorGoal extends BreakDoorGoal {
|
||||
public VindicatorBreakDoorGoal(Mob mob) {
|
||||
@ -23,10 +23,10 @@ index 89a05518e1b95f6edc1ac57f6ed9c3946b87b93e..0ee020848cdfd0c069f1e8d3a9516a33
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
index a0cd226d4f5c700c84604527ddde35466c7654bb..a41a2ffe3b0af5c244a513c839829da3f86e5ed3 100644
|
||||
index c8ce36d67901e2897f521d5b4f5041348f235ae7..e4fc7f96aac9cc2ed5b4158b6663de397ee1162f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -100,7 +100,7 @@ public class Zombie extends Monster {
|
||||
@@ -97,7 +97,7 @@ public class Zombie extends Monster {
|
||||
|
||||
public Zombie(EntityType<? extends Zombie> type, Level world) {
|
||||
super(type, world);
|
@ -5,10 +5,10 @@ Subject: [PATCH] Empty commands shall not be dispatched
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
||||
index d39743d9626eb01c942194387dafb1106f13601b..0741c0f85536c5188d8552e999943a9c771a548e 100644
|
||||
index 2fb4660147294de9e9dec70bc3527327f2d859ee..83091987b320171ef9071cbef6b10a1bd72d38e2 100644
|
||||
--- a/src/main/java/net/minecraft/commands/Commands.java
|
||||
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
||||
@@ -287,6 +287,7 @@ public class Commands {
|
||||
@@ -290,6 +290,7 @@ public class Commands {
|
||||
command = event.getCommand();
|
||||
|
||||
String[] args = command.split(" ");
|
@ -5,10 +5,10 @@ Subject: [PATCH] Remove stale POIs
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 283f686364691f54d9e9e925b33238526de74219..a2113c01d8ea3da13efbf4f0b23460e7fa4e8c68 100644
|
||||
index 4e1027f00fba2084073aa926805753224aa8b153..2c1ca55e1919c29956b3d95f65f8f08eb7529d1e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1795,6 +1795,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1743,6 +1743,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
});
|
||||
optional1.ifPresent((holder) -> {
|
||||
this.getServer().execute(() -> {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix villager boat exploit
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index b560d28562c27bfa2f4da5e79d73eed8eea80e15..6fed863a0400ba23e0e299b0f0a0f28af19fa226 100644
|
||||
index b665cad02cf3ec79270a99d6733cb075c7e1940c..c9f4d50834d8544bafe973258b59105b2b83bf1d 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -603,6 +603,14 @@ public abstract class PlayerList {
|
||||
@@ -601,6 +601,14 @@ public abstract class PlayerList {
|
||||
PlayerList.LOGGER.debug("Removing player mount");
|
||||
entityplayer.stopRiding();
|
||||
entity.getPassengersAndSelf().forEach((entity1) -> {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add sendOpLevel API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 6fed863a0400ba23e0e299b0f0a0f28af19fa226..65c11774b9e3c724b5ac67a557bd84efcd53fbab 100644
|
||||
index c9f4d50834d8544bafe973258b59105b2b83bf1d..dd360250ca784421e0f8fffe786bec88a8f38b3d 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1101,6 +1101,11 @@ public abstract class PlayerList {
|
||||
@@ -1100,6 +1100,11 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
private void sendPlayerPermissionLevel(ServerPlayer player, int permissionLevel) {
|
||||
@ -20,7 +20,7 @@ index 6fed863a0400ba23e0e299b0f0a0f28af19fa226..65c11774b9e3c724b5ac67a557bd84ef
|
||||
if (player.connection != null) {
|
||||
byte b0;
|
||||
|
||||
@@ -1115,8 +1120,10 @@ public abstract class PlayerList {
|
||||
@@ -1114,8 +1119,10 @@ public abstract class PlayerList {
|
||||
player.connection.send(new ClientboundEntityEventPacket(player, b0));
|
||||
}
|
||||
|
||||
@ -32,10 +32,10 @@ index 6fed863a0400ba23e0e299b0f0a0f28af19fa226..65c11774b9e3c724b5ac67a557bd84ef
|
||||
|
||||
public boolean isWhiteListed(GameProfile profile) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index b9f1848c382a52e6ef05c5d0c68015cfcfcde324..79a57bafc3b99e58f435bacbc65b9fd4c4c80b8a 100644
|
||||
index 8f437587d8989f3aa709ce36d1a10f237d28f0fa..0cfc8b5faa56ae2a3dd94c5dbcb22a7e208b38bd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -599,6 +599,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -674,6 +674,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
// Paper end
|
||||
|
@ -5,12 +5,12 @@ Subject: [PATCH] TODO Registry Modification API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
|
||||
index 826c45f35c80ae4bf536fbe3b48354e3626fe2e1..110987de809339b4ce14eaf377782ebf3460164a 100644
|
||||
index 4209a45af2bfe772f678b07b49070522de4195a8..480313506bf41410de090c59e047323345ea78da 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
|
||||
@@ -119,6 +119,7 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> {
|
||||
if (bukkitClass == DamageType.class) {
|
||||
return new CraftRegistry<>(DamageType.class, registryHolder.registryOrThrow(Registries.DAMAGE_TYPE), CraftDamageType::new);
|
||||
@@ -138,6 +138,7 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> {
|
||||
if (bukkitClass == Wolf.Variant.class) {
|
||||
return new CraftRegistry<>(Wolf.Variant.class, registryHolder.registryOrThrow(Registries.WOLF_VARIANT), CraftWolf.CraftVariant::new);
|
||||
}
|
||||
+ // TODO registry modification API
|
||||
|
@ -47,10 +47,10 @@ index 0000000000000000000000000000000000000000..2667067fd13f61e0464ba88ae4e4a707
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
index 4a731b9170222a5a2b0089ef5e9527dbd46a9ad5..edd968686292237e95afdf99a291f501386144ef 100644
|
||||
index 7cdb59cd2f2ffe1195d21519ef97dae0e430285b..a8768f1925d5824ca985be1b53694ee233273758 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java
|
||||
@@ -121,6 +121,24 @@ public abstract class ChunkGenerator {
|
||||
@@ -127,6 +127,24 @@ public abstract class ChunkGenerator {
|
||||
|
||||
@Nullable
|
||||
public Pair<BlockPos, Holder<Structure>> findNearestMapStructure(ServerLevel world, HolderSet<Structure> structures, BlockPos center, int radius, boolean skipReferencedStructures) {
|
||||
@ -76,11 +76,11 @@ index 4a731b9170222a5a2b0089ef5e9527dbd46a9ad5..edd968686292237e95afdf99a291f501
|
||||
Map<StructurePlacement, Set<Holder<Structure>>> map = new Object2ObjectArrayMap();
|
||||
Iterator iterator = structures.iterator();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
|
||||
index 110987de809339b4ce14eaf377782ebf3460164a..b12b99253543445475b73a1d3d7c6364856b49e8 100644
|
||||
index 480313506bf41410de090c59e047323345ea78da..c7d377dbb53cdc1f823a839e3a113136efc16349 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
|
||||
@@ -120,6 +120,11 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> {
|
||||
return new CraftRegistry<>(DamageType.class, registryHolder.registryOrThrow(Registries.DAMAGE_TYPE), CraftDamageType::new);
|
||||
@@ -139,6 +139,11 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> {
|
||||
return new CraftRegistry<>(Wolf.Variant.class, registryHolder.registryOrThrow(Registries.WOLF_VARIANT), CraftWolf.CraftVariant::new);
|
||||
}
|
||||
// TODO registry modification API
|
||||
+ // Paper start - remove this after a while along with all ConfiguredStructure stuff
|
@ -5,10 +5,10 @@ Subject: [PATCH] Collision option for requiring a player participant
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index c3ca11cc4abe85132b099af1cb27772dbf40bfe1..5b0502cfcc3d9317941d7444750a49832e1a52a1 100644
|
||||
index 31911870e5056391d67c49fa68d59010534bf35f..04581cd90272775208a0192ef36f9c7458ad3a0c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1848,6 +1848,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -1872,6 +1872,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public void push(Entity entity) {
|
||||
if (!this.isPassengerOfSameVehicle(entity)) {
|
||||
if (!entity.noPhysics && !this.noPhysics) {
|
||||
@ -17,10 +17,10 @@ index c3ca11cc4abe85132b099af1cb27772dbf40bfe1..5b0502cfcc3d9317941d7444750a4983
|
||||
double d1 = entity.getZ() - this.getZ();
|
||||
double d2 = Mth.absMax(d0, d1);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||
index be16ab6da56d2aa2a21ee378cfc44dbb14e108b3..9a6b6120c248a57d9dc86ca215146f6de980bd0d 100644
|
||||
index 1aecb6cc62b4b411ab0ff3b7fb11a5d9d050b959..2f73ca283f2d6e6bc5265c95ef767b3f606a3d69 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||
@@ -792,6 +792,7 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
||||
@@ -789,6 +789,7 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
||||
public void push(Entity entity) {
|
||||
if (!this.level().isClientSide) {
|
||||
if (!entity.noPhysics && !this.noPhysics) {
|
||||
@ -29,10 +29,10 @@ index be16ab6da56d2aa2a21ee378cfc44dbb14e108b3..9a6b6120c248a57d9dc86ca215146f6d
|
||||
// CraftBukkit start
|
||||
VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity());
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||
index 0178eb918179b12d7d8eb56cd72e5bfc34cfdbaf..1ced6d60a74fac028804b3c2d938e89af4706823 100644
|
||||
index d1eaadba8ce1f472a174afcfe8e0d059a121612c..549202706396fee91c23f6e34f7faa7672e4b03f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||
@@ -207,6 +207,7 @@ public class Boat extends VehicleEntity implements VariantHolder<Boat.Type> {
|
||||
@@ -200,6 +200,7 @@ public class Boat extends VehicleEntity implements VariantHolder<Boat.Type> {
|
||||
|
||||
@Override
|
||||
public void push(Entity entity) {
|
@ -7,10 +7,10 @@ The duplicate ProjectileHitEvent in EntityFireball was removed. The
|
||||
event was always called before the duplicate call.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
||||
index fba92238d8a025fa5d02a9f3b89980ddb99f84d2..20ce474b72894a8bb3fc21018b9d79bbdc8bb14b 100644
|
||||
index b5a46c2c8e7e139a1b5cdad69459a37d4448efb1..a81d6a52674ddf7f818a7665cccd21dd8ea86cbe 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
|
||||
@@ -102,7 +102,7 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
||||
@@ -92,7 +92,7 @@ public abstract class AbstractHurtingProjectile extends Projectile {
|
||||
|
||||
// CraftBukkit start - Fire ProjectileHitEvent
|
||||
if (this.isRemoved()) {
|
@ -6,7 +6,7 @@ Subject: [PATCH] Return chat component with empty text instead of throwing
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
index 52e57fa3b25dce10c17682964cbd4bcb4c130dc6..94fe6bd403222049e4e7a407bb6ca99bcaab6acb 100644
|
||||
index 810662eeb9ef7f2239a7937e58654a0407f9d8df..00031a013d8e1e9f40bc1ef9491da6df3b061d5f 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
@@ -89,7 +89,12 @@ public abstract class AbstractContainerMenu {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Make schedule command per-world
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/commands/ScheduleCommand.java b/src/main/java/net/minecraft/server/commands/ScheduleCommand.java
|
||||
index 569b645c6d795401c974069d0be7195590cd354a..7b4ee914fb7681760446f864cf3f2f8cab180dd6 100644
|
||||
index f2d1430d714debc9e9b53eef0cbcda0d8cdcd459..d090f94a9a8a314df01e83a031dd18d5c6f1caf9 100644
|
||||
--- a/src/main/java/net/minecraft/server/commands/ScheduleCommand.java
|
||||
+++ b/src/main/java/net/minecraft/server/commands/ScheduleCommand.java
|
||||
@@ -30,7 +30,7 @@ public class ScheduleCommand {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Configurable max leash distance
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java
|
||||
index 5e9cf929674888b3a143a0691dc6936b304467f1..85a9bcbd229b56317c2de15670a04c6d0eb51e18 100644
|
||||
index 5e2f10f5fd7219ebaefb1c5b5ac9bc7c71fae179..e92831739603ef1b5678c9d44e85ab70d62be0e7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/PathfinderMob.java
|
||||
@@ -55,7 +55,7 @@ public abstract class PathfinderMob extends Mob {
|
||||
@@ -71,7 +71,7 @@ public abstract class PathfinderMob extends Mob {
|
||||
float f = this.distanceTo(entity);
|
||||
|
||||
if (this instanceof TamableAnimal && ((TamableAnimal) this).isInSittingPose()) {
|
||||
@ -17,7 +17,7 @@ index 5e9cf929674888b3a143a0691dc6936b304467f1..85a9bcbd229b56317c2de15670a04c6d
|
||||
this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit
|
||||
this.dropLeash(true, true);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ public abstract class PathfinderMob extends Mob {
|
||||
@@ -80,7 +80,7 @@ public abstract class PathfinderMob extends Mob {
|
||||
}
|
||||
|
||||
this.onLeashDistance(f);
|
@ -5,11 +5,11 @@ Subject: [PATCH] Add BlockPreDispenseEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java
|
||||
index 5593a0aa9e618071b6521b213dde0f628348c3dc..644e64850479cea20a98b8a65503ccf3a34fd32a 100644
|
||||
index 94bcbaf7daf7dfe566f508d1170a433930d9d49a..f6edfea463b3725d3a79aca38825e86dbf82175c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java
|
||||
@@ -104,6 +104,7 @@ public class DispenserBlock extends BaseEntityBlock {
|
||||
DispenseItemBehavior idispensebehavior = this.getDispenseMethod(itemstack);
|
||||
@@ -110,6 +110,7 @@ public class DispenserBlock extends BaseEntityBlock {
|
||||
DispenseItemBehavior idispensebehavior = this.getDispenseMethod(world, itemstack);
|
||||
|
||||
if (idispensebehavior != DispenseItemBehavior.NOOP) {
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockPreDispenseEvent(world, pos, itemstack, i)) return; // Paper - Add BlockPreDispenseEvent
|
||||
@ -17,10 +17,10 @@ index 5593a0aa9e618071b6521b213dde0f628348c3dc..644e64850479cea20a98b8a65503ccf3
|
||||
tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/DropperBlock.java b/src/main/java/net/minecraft/world/level/block/DropperBlock.java
|
||||
index 1d13f8a1009d6eda351c697052d499d594a6aaa8..9a8a0fb958e8ec782111507bae957f854b2aac72 100644
|
||||
index efa7cf50b5577f87a2dfa61b59bf81052794fbf1..b4a742e8c513e458b34c216d1e907b47e3aac292 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/DropperBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/DropperBlock.java
|
||||
@@ -70,6 +70,7 @@ public class DropperBlock extends DispenserBlock {
|
||||
@@ -71,6 +71,7 @@ public class DropperBlock extends DispenserBlock {
|
||||
ItemStack itemstack1;
|
||||
|
||||
if (iinventory == null) {
|
||||
@ -29,10 +29,10 @@ index 1d13f8a1009d6eda351c697052d499d594a6aaa8..9a8a0fb958e8ec782111507bae957f85
|
||||
} else {
|
||||
// CraftBukkit start - Fire event when pushing items into other inventories
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index ea26b27279b6e09015908f164a061891f4ab9002..ec6bbab9787e5568e2be7d0a0004d8103ec38ff3 100644
|
||||
index 13e4cb7af50b3a03523d84dd72ca6a122ca041ad..e6bb82928af3378847722421ce3bad7f5b994890 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -2046,5 +2046,11 @@ public class CraftEventFactory {
|
||||
@@ -2041,5 +2041,11 @@ public class CraftEventFactory {
|
||||
io.papermc.paper.event.block.BlockFailedDispenseEvent event = new io.papermc.paper.event.block.BlockFailedDispenseEvent(block);
|
||||
return event.callEvent();
|
||||
}
|
@ -5,31 +5,32 @@ Subject: [PATCH] Add PlayerChangeBeaconEffectEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
|
||||
index e6a4e8dcdbc49b427c2802f1a358f8f9ad04d0f0..b670c0cb3886c99d38a91b5c13aa2cefaae702cf 100644
|
||||
index c2fa423e14fc08c10483415baa2148af269c3758..866dd476829bd59501021a8c24bde6d8e8778963 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
|
||||
@@ -170,12 +170,24 @@ public class BeaconMenu extends AbstractContainerMenu {
|
||||
@@ -171,12 +171,25 @@ public class BeaconMenu extends AbstractContainerMenu {
|
||||
return BeaconMenu.decodeEffect(this.beaconData.get(2));
|
||||
}
|
||||
|
||||
+ // Paper start - Add PlayerChangeBeaconEffectEvent
|
||||
+ private static @Nullable org.bukkit.potion.PotionEffectType convert(Optional<MobEffect> optionalEffect) {
|
||||
+ private static @Nullable org.bukkit.potion.PotionEffectType convert(Optional<Holder<MobEffect>> optionalEffect) {
|
||||
+ return optionalEffect.map(org.bukkit.craftbukkit.potion.CraftPotionEffectType::minecraftToBukkit).orElse(null);
|
||||
+ }
|
||||
+ // Paper end - Add PlayerChangeBeaconEffectEvent
|
||||
+
|
||||
public void updateEffects(Optional<MobEffect> primary, Optional<MobEffect> secondary) {
|
||||
public void updateEffects(Optional<Holder<MobEffect>> primary, Optional<Holder<MobEffect>> secondary) {
|
||||
if (this.paymentSlot.hasItem()) {
|
||||
- this.beaconData.set(1, BeaconMenu.encodeEffect((MobEffect) primary.orElse(null))); // CraftBukkit - decompile error
|
||||
- this.beaconData.set(2, BeaconMenu.encodeEffect((MobEffect) secondary.orElse(null))); // CraftBukkit - decompile error
|
||||
- this.beaconData.set(1, BeaconMenu.encodeEffect((Holder) primary.orElse(null)));// CraftBukkit - decompile error
|
||||
- this.beaconData.set(2, BeaconMenu.encodeEffect((Holder) secondary.orElse(null)));// CraftBukkit - decompile error
|
||||
+ // Paper start - Add PlayerChangeBeaconEffectEvent
|
||||
+ io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent event = new io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent((org.bukkit.entity.Player) this.player.player.getBukkitEntity(), convert(primary), convert(secondary), this.access.getLocation().getBlock());
|
||||
+ if (event.callEvent()) {
|
||||
+ this.beaconData.set(1, BeaconMenu.encodeEffect(event.getPrimary() == null ? null : org.bukkit.craftbukkit.potion.CraftPotionEffectType.bukkitToMinecraft(event.getPrimary())));
|
||||
+ this.beaconData.set(2, BeaconMenu.encodeEffect(event.getSecondary() == null ? null : org.bukkit.craftbukkit.potion.CraftPotionEffectType.bukkitToMinecraft(event.getSecondary())));
|
||||
+ if (event.willConsumeItem()) {
|
||||
+ // Paper end - Add PlayerChangeBeaconEffectEvent
|
||||
+ this.beaconData.set(1, BeaconMenu.encodeEffect(event.getPrimary() == null ? null : org.bukkit.craftbukkit.potion.CraftPotionEffectType.bukkitToMinecraftHolder(event.getPrimary())));// CraftBukkit - decompile error
|
||||
+ this.beaconData.set(2, BeaconMenu.encodeEffect(event.getSecondary() == null ? null : org.bukkit.craftbukkit.potion.CraftPotionEffectType.bukkitToMinecraftHolder(event.getSecondary())));// CraftBukkit - decompile error
|
||||
+ if (event.willConsumeItem()) { // Paper
|
||||
this.paymentSlot.remove(1);
|
||||
+ }
|
||||
+ } // Paper
|
||||
this.access.execute(Level::blockEntityChanged);
|
||||
+ } // Paper end - Add PlayerChangeBeaconEffectEvent
|
||||
}
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add toggle for always placing the dragon egg
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
index c4555320d1f283a41c47d08d68c2633717f6fda8..45b7efc85f2ec17288cad329c3a78483903c0ea2 100644
|
||||
index 3ea0ca395e0561d96044f0f84442a08b42b539bd..f81dab25fedeed08f4d3ba2d7435e2da526e6056 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
@@ -407,7 +407,7 @@ public class EndDragonFight {
|
@ -5,28 +5,28 @@ Subject: [PATCH] Expand EntityUnleashEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 3e6706671b3dc06b376eaa9d6d463c6a098104d1..d1833dcc92b1570e62a1941bbea6d66ff0b2ee5f 100644
|
||||
index 2b282ba23444110949508dac11a25fee4e472f5d..b7cc2b5ee85e8e6a5c8cb8ce1f3c934773be32e6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -1300,12 +1300,15 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1428,12 +1428,15 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
|
||||
return InteractionResult.PASS;
|
||||
} else if (this.getLeashHolder() == player) {
|
||||
// CraftBukkit start - fire PlayerUnleashEntityEvent
|
||||
- if (CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand).isCancelled()) {
|
||||
+ // Paper start - Expand EntityUnleashEvent
|
||||
+ org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand, !player.getAbilities().instabuild);
|
||||
+ org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand, !player.hasInfiniteMaterials());
|
||||
+ if (event.isCancelled()) {
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
((ServerPlayer) player).connection.send(new ClientboundSetEntityLinkPacket(this, this.getLeashHolder()));
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
// CraftBukkit end
|
||||
- this.dropLeash(true, !player.getAbilities().instabuild);
|
||||
- this.dropLeash(true, !player.hasInfiniteMaterials());
|
||||
+ this.dropLeash(true, event.isDropLeash()); // Paper - Expand EntityUnleashEvent
|
||||
this.gameEvent(GameEvent.ENTITY_INTERACT, player);
|
||||
return InteractionResult.sidedSuccess(this.level().isClientSide);
|
||||
} else {
|
||||
@@ -1473,8 +1476,11 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1601,8 +1604,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
|
||||
|
||||
if (this.leashHolder != null) {
|
||||
if (!this.isAlive() || !this.leashHolder.isAlive()) {
|
||||
@ -40,7 +40,7 @@ index 3e6706671b3dc06b376eaa9d6d463c6a098104d1..d1833dcc92b1570e62a1941bbea6d66f
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1537,8 +1543,11 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1670,8 +1676,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
|
||||
boolean flag1 = super.startRiding(entity, force);
|
||||
|
||||
if (flag1 && this.isLeashed()) {
|
||||
@ -54,7 +54,7 @@ index 3e6706671b3dc06b376eaa9d6d463c6a098104d1..d1833dcc92b1570e62a1941bbea6d66f
|
||||
}
|
||||
|
||||
return flag1;
|
||||
@@ -1728,8 +1737,11 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1848,8 +1857,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
|
||||
@Override
|
||||
protected void removeAfterChangingDimensions() {
|
||||
super.removeAfterChangingDimensions();
|
||||
@ -69,10 +69,10 @@ index 3e6706671b3dc06b376eaa9d6d463c6a098104d1..d1833dcc92b1570e62a1941bbea6d66f
|
||||
if (!itemstack.isEmpty()) {
|
||||
itemstack.setCount(0);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java
|
||||
index 85a9bcbd229b56317c2de15670a04c6d0eb51e18..d6393210cfee53685f83c8491bea8b9c13b01eea 100644
|
||||
index e92831739603ef1b5678c9d44e85ab70d62be0e7..cdd07093342521ff9944bf7a342bbf142ba3f0b7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/PathfinderMob.java
|
||||
@@ -56,8 +56,11 @@ public abstract class PathfinderMob extends Mob {
|
||||
@@ -72,8 +72,11 @@ public abstract class PathfinderMob extends Mob {
|
||||
|
||||
if (this instanceof TamableAnimal && ((TamableAnimal) this).isInSittingPose()) {
|
||||
if (f > entity.level().paperConfig().misc.maxLeashDistance) { // Paper - Configurable max leash distance
|
||||
@ -86,7 +86,7 @@ index 85a9bcbd229b56317c2de15670a04c6d0eb51e18..d6393210cfee53685f83c8491bea8b9c
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -65,8 +68,11 @@ public abstract class PathfinderMob extends Mob {
|
||||
@@ -81,8 +84,11 @@ public abstract class PathfinderMob extends Mob {
|
||||
|
||||
this.onLeashDistance(f);
|
||||
if (f > entity.level().paperConfig().misc.maxLeashDistance) { // Paper - Configurable max leash distance
|
||||
@ -101,10 +101,10 @@ index 85a9bcbd229b56317c2de15670a04c6d0eb51e18..d6393210cfee53685f83c8491bea8b9c
|
||||
} else if (f > 6.0F) {
|
||||
double d0 = (entity.getX() - this.getX()) / (double) f;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java
|
||||
index 6a6526b7b1b578e08a41f85c0443c5f04177efb0..0b88bd258c4f2bce100bf96bcbe61c20493f8e40 100644
|
||||
index b43b1f81828bf1d57e98c52964053db7127519ad..952321d4e34a6524bbb494a56d7658068f74124c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java
|
||||
@@ -127,11 +127,14 @@ public class LeashFenceKnotEntity extends HangingEntity {
|
||||
@@ -120,11 +120,14 @@ public class LeashFenceKnotEntity extends HangingEntity {
|
||||
|
||||
if (entityinsentient1.isLeashed() && entityinsentient1.getLeashHolder() == this) {
|
||||
// CraftBukkit start
|
||||
@ -122,10 +122,10 @@ index 6a6526b7b1b578e08a41f85c0443c5f04177efb0..0b88bd258c4f2bce100bf96bcbe61c20
|
||||
flag1 = true;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index ec6bbab9787e5568e2be7d0a0004d8103ec38ff3..ca0cb9ad99992ef2602781adf16da94ca56975f8 100644
|
||||
index e6bb82928af3378847722421ce3bad7f5b994890..dadb4f13ec6b9915108603aa34d4112c47337c44 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -1570,8 +1570,10 @@ public class CraftEventFactory {
|
||||
@@ -1565,8 +1565,10 @@ public class CraftEventFactory {
|
||||
Bukkit.getPluginManager().callEvent(new PlayerRecipeBookSettingsChangeEvent(player.getBukkitEntity(), bukkitType, open, filter));
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Reset shield blocking on dimension change
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index efe511fc6ab121263fe0c09763e09e0cf10a354a..19baf0ecd04ae058fac709889db34bf27679ab5e 100644
|
||||
index edfcfb91d907d6e1837e5a5d0e7abb8c8f6bcb66..2db78d991ef0595a0d8806414a959479e289c0fc 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1198,6 +1198,11 @@ public class ServerPlayer extends Player {
|
||||
@@ -1265,6 +1265,11 @@ public class ServerPlayer extends Player {
|
||||
this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
|
||||
// CraftBukkit end
|
||||
}
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add DragonEggFormEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
index 45b7efc85f2ec17288cad329c3a78483903c0ea2..1c9bfcf595bcb247c3b9ffe8b0e0cfee0d0ba91f 100644
|
||||
index f81dab25fedeed08f4d3ba2d7435e2da526e6056..609b20e2b222c5b1fddf22c2621d0d7a88cabcfa 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||
@@ -407,8 +407,22 @@ public class EndDragonFight {
|
@ -5,22 +5,22 @@ Subject: [PATCH] Add EntityMoveEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 23d68feaa060514e6582a9d47a9ca7db9421c29c..a596b3e52e902ed01a526aa9961910d8a3cc2e2d 100644
|
||||
index b083298d2bcf0d4c6213d6ac8645b8c084cfc6de..e9ea8ad5689c0e6edd2e7335ab9932b3a6abbbf3 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1526,6 +1526,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1583,6 +1583,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
while (iterator.hasNext()) {
|
||||
ServerLevel worldserver = (ServerLevel) iterator.next();
|
||||
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
|
||||
+ worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
|
||||
|
||||
this.profiler.push(() -> {
|
||||
return worldserver + " " + worldserver.dimension().location();
|
||||
String s = String.valueOf(worldserver);
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index a2113c01d8ea3da13efbf4f0b23460e7fa4e8c68..125e3425af05541e5c848ee0e9390cea44a29302 100644
|
||||
index 2c1ca55e1919c29956b3d95f65f8f08eb7529d1e..35ccccfea9aec44a85e08b0e383b6650554b8bd3 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -222,6 +222,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -227,6 +227,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
public final LevelStorageSource.LevelStorageAccess convertable;
|
||||
public final UUID uuid;
|
||||
public boolean hasPhysicsEvent = true; // Paper - BlockPhysicsEvent
|
||||
@ -29,10 +29,10 @@ index a2113c01d8ea3da13efbf4f0b23460e7fa4e8c68..125e3425af05541e5c848ee0e9390cea
|
||||
public LevelChunk getChunkIfLoaded(int x, int z) {
|
||||
return this.chunkSource.getChunk(x, z, false);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index ed32b3f1107210d56e5653b2d5eddcf1deb39dfc..d19a0733fe257eb66a02e263d4e053939f7ec978 100644
|
||||
index e38f0659836be4bebff06e8d8e7848abdcbda455..83730b9da452d27b420770adf6ff179b936f2bbd 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3382,6 +3382,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3471,6 +3471,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
this.pushEntities();
|
||||
this.level().getProfiler().pop();
|
@ -5,18 +5,18 @@ Subject: [PATCH] added option to disable pathfinding updates on block changes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 125e3425af05541e5c848ee0e9390cea44a29302..0f6a34776482a7eef638911fe01db819962b3ce8 100644
|
||||
index 35ccccfea9aec44a85e08b0e383b6650554b8bd3..93d66d85be2dcc52e8f3fa138561f2126d91c732 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1369,6 +1369,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1375,6 +1375,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
|
||||
this.getChunkSource().blockChanged(pos);
|
||||
+ if(this.paperConfig().misc.updatePathfindingOnBlockUpdate) { // Paper - option to disable pathfinding updates
|
||||
this.pathTypesByPosCache.invalidate(pos);
|
||||
VoxelShape voxelshape = oldState.getCollisionShape(this, pos);
|
||||
VoxelShape voxelshape1 = newState.getCollisionShape(this, pos);
|
||||
|
||||
@@ -1410,6 +1411,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1417,6 +1418,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
|
||||
}
|
@ -7,10 +7,10 @@ Removes a layer of indirection for EnumDirection.getAdjacent(X|Y|Z)(), which is
|
||||
critical section for much of the server, including the lighting engine.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/Direction.java b/src/main/java/net/minecraft/core/Direction.java
|
||||
index 14b57310811bb930b40396a02b263cdbccb1076b..75694cfd7d8adde6b9246518c20fe75774297a57 100644
|
||||
index c47e6acbd36737aa7af13b452f51b3f017d324f4..03c45ee77276462818a6f774b5945b25924aa3f0 100644
|
||||
--- a/src/main/java/net/minecraft/core/Direction.java
|
||||
+++ b/src/main/java/net/minecraft/core/Direction.java
|
||||
@@ -48,6 +48,12 @@ public enum Direction implements StringRepresentable {
|
||||
@@ -55,6 +55,12 @@ public enum Direction implements StringRepresentable {
|
||||
.sorted(Comparator.comparingInt(direction -> direction.data2d))
|
||||
.toArray(Direction[]::new);
|
||||
|
||||
@ -20,10 +20,10 @@ index 14b57310811bb930b40396a02b263cdbccb1076b..75694cfd7d8adde6b9246518c20fe757
|
||||
+ private final int adjZ;
|
||||
+ // Paper end - Perf: Inline shift direction fields
|
||||
+
|
||||
private Direction(int id, int idOpposite, int idHorizontal, String name, Direction.AxisDirection direction, Direction.Axis axis, Vec3i vector) {
|
||||
this.data3d = id;
|
||||
this.data2d = idHorizontal;
|
||||
@@ -56,6 +62,11 @@ public enum Direction implements StringRepresentable {
|
||||
private Direction(
|
||||
final int id,
|
||||
final int idOpposite,
|
||||
@@ -71,6 +77,11 @@ public enum Direction implements StringRepresentable {
|
||||
this.axis = axis;
|
||||
this.axisDirection = direction;
|
||||
this.normal = vector;
|
||||
@ -35,7 +35,7 @@ index 14b57310811bb930b40396a02b263cdbccb1076b..75694cfd7d8adde6b9246518c20fe757
|
||||
}
|
||||
|
||||
public static Direction[] orderedByNearest(Entity entity) {
|
||||
@@ -219,15 +230,15 @@ public enum Direction implements StringRepresentable {
|
||||
@@ -234,15 +245,15 @@ public enum Direction implements StringRepresentable {
|
||||
}
|
||||
|
||||
public int getStepX() {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Allow adding items to BlockDropItemEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index ca0cb9ad99992ef2602781adf16da94ca56975f8..5d4fe10d4e3a5d7a9430dbd5b3c850db482f5862 100644
|
||||
index dadb4f13ec6b9915108603aa34d4112c47337c44..ea9a12ff01203072975bb2f22a077d1d2e46376f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -452,13 +452,30 @@ public class CraftEventFactory {
|
||||
@@ -451,13 +451,30 @@ public class CraftEventFactory {
|
||||
}
|
||||
|
||||
public static void handleBlockDropItemEvent(Block block, BlockState state, ServerPlayer player, List<ItemEntity> items) {
|
@ -5,11 +5,11 @@ Subject: [PATCH] living entity allow attribute registration
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
index 4228d28b2f697e7dc320525c1ad48a8a2aa0fdb4..b99a080ab27e24d8131fda931ca70d6d271bb01c 100644
|
||||
index f03f40e2624d0e8e27a6fb7ae33d82cb614252f4..b02c8514aac174db1c04a6c8240851eff474906f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
@@ -138,4 +138,12 @@ public class AttributeMap {
|
||||
}, () -> LOGGER.warn("Ignoring unknown attribute '{}'", string));
|
||||
@@ -106,4 +106,12 @@ public class AttributeMap {
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
@ -22,7 +22,7 @@ index 4228d28b2f697e7dc320525c1ad48a8a2aa0fdb4..b99a080ab27e24d8131fda931ca70d6d
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java
|
||||
index ea48f1119a940056c37d1d203437bfbfdf13663b..8a678df56fcf30535957e111d81ad07be5b501ec 100644
|
||||
index a0a34f680e21007ebf2c2497d2e6505eedae6481..5314905063e62f0f5ed56e476718ba7610bb711f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttributeMap.java
|
||||
@@ -35,4 +35,11 @@ public class CraftAttributeMap implements Attributable {
|
||||
@ -38,10 +38,10 @@ index ea48f1119a940056c37d1d203437bfbfdf13663b..8a678df56fcf30535957e111d81ad07b
|
||||
+ // Paper end - living entity allow attribute registration
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 4ac52885618bf062eb34672b8fc60331a9c8f76a..0a4df9971c66676dba90fb03c840e25a41103bc0 100644
|
||||
index b88077ac1ed99057b8a9361ea550cd2b00040f88..2701e53086f4be07c341cd1e4fcd7a351e77c486 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -755,6 +755,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -754,6 +754,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
return this.getHandle().craftAttributes.getAttribute(attribute);
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Expose Tracked Players
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index ef8f8b3f97405250ebe058c67c4099da66a8e773..524d3118663f5531e530dcdfa5da4ded2415468f 100644
|
||||
index 2080733ebae1af51b7b4d3cd2fbd1a4a2703a920..d30e1dd1b4525674c8a52da9b677c09a251b2467 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1042,4 +1042,19 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -1052,4 +1052,19 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
return getHandle().isTicking();
|
||||
}
|
||||
// Paper end - isTicking API
|
@ -38,7 +38,7 @@ index f93373d28d741e1f8a53e07b4e328ce9c4e1657f..039a86034928a5eb7aaa2d7ca76a7bdd
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
index 2bbc57b4869caf690f53618d60359c5133ec62a8..c42a9949c4d37d45883867a54222a7ab33944b39 100644
|
||||
index 8b570b0c3967a22c085f390110cb29cbd9c8feff..4d3fe4f56e0b264fa030409919caf52d5f421d46 100644
|
||||
--- a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
+++ b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
@@ -59,6 +59,15 @@ public class MinecraftServerGui extends JComponent {
|
@ -21,10 +21,10 @@ index 929f59bce01c8e6ed4b0b551744d42e131b8fc80..22c4f8dea99f92a1eb3da2baf0a15bf9
|
||||
this.saveUserBanList();
|
||||
this.loadIpBanList();
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index ebea8a827aad108dd6d4222e8dfd251d2cea657a..2a0d3212edeee828b9fe04c153ee05ea5b0875ec 100644
|
||||
index 4d7c2832a9cd9a88b99c837a02df7fa91e572658..4b00c14332f3d514f402fc82345a02d51c3ac58a 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -199,6 +199,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -212,6 +212,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
|
||||
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
|
||||
// Paper end - initialize global and world-defaults configuration
|
||||
@ -37,7 +37,7 @@ index ebea8a827aad108dd6d4222e8dfd251d2cea657a..2a0d3212edeee828b9fe04c153ee05ea
|
||||
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
|
||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
||||
@@ -253,9 +259,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -266,9 +272,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
|
||||
}
|
||||
|
||||
@ -48,10 +48,10 @@ index ebea8a827aad108dd6d4222e8dfd251d2cea657a..2a0d3212edeee828b9fe04c153ee05ea
|
||||
if (!OldUsersConverter.serverReadyAfterUserconversion(this)) {
|
||||
return false;
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 65c11774b9e3c724b5ac67a557bd84efcd53fbab..6a00304ea9eac600162eae03e70aa28f39149c5f 100644
|
||||
index dd360250ca784421e0f8fffe786bec88a8f38b3d..b1cf71350661baf027bd45ebd9c80e8273cbad1e 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -177,6 +177,7 @@ public abstract class PlayerList {
|
||||
@@ -179,6 +179,7 @@ public abstract class PlayerList {
|
||||
this.maxPlayers = maxPlayers;
|
||||
this.playerIo = saveHandler;
|
||||
}
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add worldborder events
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/border/WorldBorder.java b/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
||||
index bf5ac907507bf3b5bfcef45b566c0bc12626e2c0..350aabd20329f429248c84d73ab8b5eb145943a7 100644
|
||||
index 580eb275942570da9e68287ca75da886ba1248c0..6c6eb7deed281678c05ef27f933e1693b11dae7c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/border/WorldBorder.java
|
||||
@@ -123,6 +123,14 @@ public class WorldBorder {
|
@ -5,24 +5,22 @@ Subject: [PATCH] Add PlayerNameEntityEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/NameTagItem.java b/src/main/java/net/minecraft/world/item/NameTagItem.java
|
||||
index af072de68435d1678651bdf2fa13b314ca9c9d58..a0b3c2d3b3f86ecd6cb80ff767839d29ca4f4f68 100644
|
||||
index 3ce8c725270510dbaaf2c1edc895d37ea9ca424c..774c982f28b4f127fc3f036c19dfb47fb9ae3264 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/NameTagItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/NameTagItem.java
|
||||
@@ -15,9 +15,14 @@ public class NameTagItem extends Item {
|
||||
public InteractionResult interactLivingEntity(ItemStack stack, Player user, LivingEntity entity, InteractionHand hand) {
|
||||
if (stack.hasCustomHoverName() && !(entity instanceof Player)) {
|
||||
@@ -18,8 +18,13 @@ public class NameTagItem extends Item {
|
||||
Component component = stack.get(DataComponents.CUSTOM_NAME);
|
||||
if (component != null && !(entity instanceof Player)) {
|
||||
if (!user.level().isClientSide && entity.isAlive()) {
|
||||
- entity.setCustomName(stack.getHoverName());
|
||||
- if (entity instanceof Mob) {
|
||||
- ((Mob)entity).setPersistenceRequired();
|
||||
- entity.setCustomName(component);
|
||||
- if (entity instanceof Mob mob) {
|
||||
+ // Paper start - Add PlayerNameEntityEvent
|
||||
+ io.papermc.paper.event.player.PlayerNameEntityEvent event = new io.papermc.paper.event.player.PlayerNameEntityEvent(((net.minecraft.server.level.ServerPlayer) user).getBukkitEntity(), entity.getBukkitLivingEntity(), io.papermc.paper.adventure.PaperAdventure.asAdventure(stack.getHoverName()), true);
|
||||
+ if (!event.callEvent()) return InteractionResult.PASS;
|
||||
+ LivingEntity newEntity = ((org.bukkit.craftbukkit.entity.CraftLivingEntity) event.getEntity()).getHandle();
|
||||
+ newEntity.setCustomName(event.getName() != null ? io.papermc.paper.adventure.PaperAdventure.asVanilla(event.getName()) : null);
|
||||
+ if (event.isPersistent() && newEntity instanceof Mob) {
|
||||
+ ((Mob) newEntity).setPersistenceRequired();
|
||||
+ // Paper end - Add PlayerNameEntityEvent
|
||||
+ if (event.isPersistent() && newEntity instanceof Mob mob) {
|
||||
+ // Paper end - Add PlayerNameEntityEvent
|
||||
mob.setPersistenceRequired();
|
||||
}
|
||||
|
||||
stack.shrink(1);
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add recipe to cook events
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
index 8f7029e602300f68b3c8411caa2d9e0b1e8be62e..d975e80b6a7849bcbabf20bf12f7d63ab1a6335f 100644
|
||||
index 4cd7232f538649d99892f3b31f2741b1d7e792e8..e18ebeef377411f1e921e3d769c4a1d379a12be4 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
|
||||
@@ -438,7 +438,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
@@ -443,7 +443,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
CraftItemStack source = CraftItemStack.asCraftMirror(itemstack);
|
||||
org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1);
|
||||
|
||||
@ -18,10 +18,10 @@ index 8f7029e602300f68b3c8411caa2d9e0b1e8be62e..d975e80b6a7849bcbabf20bf12f7d63a
|
||||
|
||||
if (furnaceSmeltEvent.isCancelled()) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
|
||||
index 3a2afa6c1f6dfad7dc18d93b743cbea1eef0e4b8..5da0c6bf4f04448f640a11931b2cc5b91cf83f12 100644
|
||||
index 66fbad74c2ec2f853ec6c74482c6cae1c1746007..e858d32c7e8e228a1f0327a33054671ad105c2eb 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
|
||||
@@ -63,7 +63,10 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
|
||||
@@ -68,7 +68,10 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
|
||||
|
||||
if (campfire.cookingProgress[i] >= campfire.cookingTime[i]) {
|
||||
SimpleContainer inventorysubcontainer = new SimpleContainer(new ItemStack[]{itemstack});
|
||||
@ -33,7 +33,7 @@ index 3a2afa6c1f6dfad7dc18d93b743cbea1eef0e4b8..5da0c6bf4f04448f640a11931b2cc5b9
|
||||
return ((CampfireCookingRecipe) recipeholder.value()).assemble(inventorysubcontainer, world.registryAccess());
|
||||
}).orElse(itemstack);
|
||||
|
||||
@@ -72,7 +75,7 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
|
||||
@@ -77,7 +80,7 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
|
||||
CraftItemStack source = CraftItemStack.asCraftMirror(itemstack);
|
||||
org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1);
|
||||
|
@ -5,15 +5,16 @@ Subject: [PATCH] Allow using signs inside spawn protection
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index a16751a23eb6aab8c25520127d4dbea0c991c32c..9f9ac6b67123339b77ff85830f7cf2419b0fc330 100644
|
||||
index e0c11559295d00445d5ba0543a81f49dc2314266..9446d6c2b2f8e535588264af7e1c852005658a17 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1752,7 +1752,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1753,8 +1753,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
int i = this.player.level().getMaxBuildHeight();
|
||||
|
||||
if (blockposition.getY() < i) {
|
||||
- if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.mayInteract(this.player, blockposition)) {
|
||||
+ if (this.awaitingPositionFromClient == null && this.player.distanceToSqr((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && (worldserver.mayInteract(this.player, blockposition) || (worldserver.paperConfig().spawn.allowUsingSignsInsideSpawnProtection && worldserver.getBlockState(blockposition).getBlock() instanceof net.minecraft.world.level.block.SignBlock))) { // Paper - Allow using signs inside spawn protection
|
||||
this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706
|
||||
- if (this.awaitingPositionFromClient == null && worldserver.mayInteract(this.player, blockposition)) {
|
||||
- this.player.stopUsingItem(); // CraftBukkit - SPIGOT-4706
|
||||
+ if (this.awaitingPositionFromClient == null && (worldserver.mayInteract(this.player, blockposition) || (worldserver.paperConfig().spawn.allowUsingSignsInsideSpawnProtection && worldserver.getBlockState(blockposition).getBlock() instanceof net.minecraft.world.level.block.SignBlock))) { // Paper - Allow using signs inside spawn protection
|
||||
InteractionResult enuminteractionresult = this.player.gameMode.useItemOn(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);
|
||||
|
||||
if (enuminteractionresult.consumesAction()) {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Expand world key API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
index bb9b4ff9f5c983ef6fe0b295bc868bc1125921d5..b9262b681b51cb68024156b28d33624fddd17b26 100644
|
||||
index 9801f78f1d44fd5a72fbdb319681b683e8fb85c4..1e720b96f0367652db6924b8654deaa9467e3d2c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
@@ -511,5 +511,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
@ -20,10 +20,10 @@ index bb9b4ff9f5c983ef6fe0b295bc868bc1125921d5..b9262b681b51cb68024156b28d33624f
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index c353f7a3a9ad0099ef7330dde988d1a174a0e327..b453673f7bab09a1b10898a7d1f85d133e63ac72 100644
|
||||
index 99fa8f65801b1816b788fa42d49d6672bf331579..6debfd5866d4411ef8d51995bd07a0e2ece781b3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1149,9 +1149,15 @@ public final class CraftServer implements Server {
|
||||
@@ -1150,9 +1150,15 @@ public final class CraftServer implements Server {
|
||||
File folder = new File(this.getWorldContainer(), name);
|
||||
World world = this.getWorld(name);
|
||||
|
||||
@ -41,7 +41,7 @@ index c353f7a3a9ad0099ef7330dde988d1a174a0e327..b453673f7bab09a1b10898a7d1f85d13
|
||||
|
||||
if (folder.exists()) {
|
||||
Preconditions.checkArgument(folder.isDirectory(), "File (%s) exists and isn't a folder", name);
|
||||
@@ -1275,7 +1281,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1278,7 +1284,7 @@ public final class CraftServer implements Server {
|
||||
} else if (name.equals(levelName + "_the_end")) {
|
||||
worldKey = net.minecraft.world.level.Level.END;
|
||||
} else {
|
||||
@ -49,8 +49,8 @@ index c353f7a3a9ad0099ef7330dde988d1a174a0e327..b453673f7bab09a1b10898a7d1f85d13
|
||||
+ worldKey = ResourceKey.create(Registries.DIMENSION, new net.minecraft.resources.ResourceLocation(creator.key().getNamespace().toLowerCase(java.util.Locale.ENGLISH), creator.key().getKey().toLowerCase(java.util.Locale.ENGLISH))); // Paper
|
||||
}
|
||||
|
||||
ServerLevel internal = (ServerLevel) new ServerLevel(this.console, this.console.executor, worldSession, worlddata, worldKey, worlddimension, this.getServer().progressListenerFactory.create(11),
|
||||
@@ -1368,6 +1374,15 @@ public final class CraftServer implements Server {
|
||||
// If set to not keep spawn in memory (changed from default) then adjust rule accordingly
|
||||
@@ -1374,6 +1380,15 @@ public final class CraftServer implements Server {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -67,10 +67,10 @@ index c353f7a3a9ad0099ef7330dde988d1a174a0e327..b453673f7bab09a1b10898a7d1f85d13
|
||||
// Check if a World already exists with the UID.
|
||||
if (this.getWorld(world.getUID()) != null) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index f10457466cbaaba2d3aa49a64092847f635ce752..0768a70cdd48cf03a6dfb3a6a3c7ed4844ea132e 100644
|
||||
index c0878cf9948774986996127e250004f0f21d6b31..788a85a65cc77b7c826a9804e52ef5883bb2ab61 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -536,6 +536,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -533,6 +533,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
public int nextEntityId() {
|
||||
return net.minecraft.world.entity.Entity.nextEntityId();
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user