531/1053
Dieser Commit ist enthalten in:
Ursprung
27e29ccaf2
Commit
083bd9e75c
@ -17,7 +17,7 @@ index 94bcbaf7daf7dfe566f508d1170a433930d9d49a..f6edfea463b3725d3a79aca38825e86d
|
||||
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 efa7cf50b5577f87a2dfa61b59bf81052794fbf1..b4a742e8c513e458b34c216d1e907b47e3aac292 100644
|
||||
index 083ddfb8fffa04dad6eeca2274f290a08e62b5eb..45fafee2cf1893dccf477939dad05e9e1938ec8c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/DropperBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/DropperBlock.java
|
||||
@@ -71,6 +71,7 @@ public class DropperBlock extends DispenserBlock {
|
||||
@ -29,10 +29,10 @@ index efa7cf50b5577f87a2dfa61b59bf81052794fbf1..b4a742e8c513e458b34c216d1e907b47
|
||||
} 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 fbdb2e595d8fa2fdd35c2ccea2bb48b520df6ea7..676528008a90d9af916a96c3f3518f8d1bd090fb 100644
|
||||
index 6d335dd7f3642fa3313d5bcfe6b59cae561e656f..eb6df1a88bea4d2449e67871a27d75b974a006ce 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -2057,5 +2057,11 @@ public class CraftEventFactory {
|
||||
@@ -2063,5 +2063,11 @@ public class CraftEventFactory {
|
||||
io.papermc.paper.event.block.BlockFailedDispenseEvent event = new io.papermc.paper.event.block.BlockFailedDispenseEvent(block);
|
||||
return event.callEvent();
|
||||
}
|
@ -6,10 +6,10 @@ Subject: [PATCH] Add PlayerStonecutterRecipeSelectEvent
|
||||
Co-Authored-By: MiniDigger <admin@benndorf.dev>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
|
||||
index e40d9dbdbe5359c38af6d764d01c9be422654aaa..1a5d8debc053b24e5856de916f1d248b36f645ba 100644
|
||||
index bb29107cb15e2ec644a14cabb3cf91f4bde5471d..977ccef3c9fa7685209f3eca894a3b69501ebcc1 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
|
||||
@@ -63,7 +63,7 @@ public class StonecutterMenu extends AbstractContainerMenu {
|
||||
@@ -64,7 +64,7 @@ public class StonecutterMenu extends AbstractContainerMenu {
|
||||
|
||||
public StonecutterMenu(int syncId, Inventory playerInventory, final ContainerLevelAccess context) {
|
||||
super(MenuType.STONECUTTER, syncId);
|
||||
@ -18,7 +18,7 @@ index e40d9dbdbe5359c38af6d764d01c9be422654aaa..1a5d8debc053b24e5856de916f1d248b
|
||||
this.recipes = Lists.newArrayList();
|
||||
this.input = ItemStack.EMPTY;
|
||||
this.slotUpdateListener = () -> {
|
||||
@@ -161,7 +161,30 @@ public class StonecutterMenu extends AbstractContainerMenu {
|
||||
@@ -162,7 +162,30 @@ public class StonecutterMenu extends AbstractContainerMenu {
|
||||
@Override
|
||||
public boolean clickMenuButton(net.minecraft.world.entity.player.Player player, int id) {
|
||||
if (this.isValidRecipeIndex(id)) {
|
139
patches/server/0487-Expand-EntityUnleashEvent.patch
Normale Datei
139
patches/server/0487-Expand-EntityUnleashEvent.patch
Normale Datei
@ -0,0 +1,139 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nassim Jahnke <nassim@njahnke.dev>
|
||||
Date: Fri, 29 Jan 2021 15:13:11 +0100
|
||||
Subject: [PATCH] Expand EntityUnleashEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 959a3f1abd2a2d6224f9d130fc6136aef20ef904..64e0dafe15bbf8e0f5892337df69063982a9d82a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2576,12 +2576,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
if (leashable.getLeashHolder() == player) {
|
||||
if (!this.level().isClientSide()) {
|
||||
// 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.hasInfiniteMaterials());
|
||||
+ if (event.isCancelled()) {
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
((ServerPlayer) player).connection.send(new ClientboundSetEntityLinkPacket(this, leashable.getLeashHolder()));
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
// CraftBukkit end
|
||||
- leashable.dropLeash(true, !player.hasInfiniteMaterials());
|
||||
+ leashable.dropLeash(true, event.isDropLeash()); // Paper - Expand EntityUnleashEvent
|
||||
this.gameEvent(GameEvent.ENTITY_INTERACT, player);
|
||||
}
|
||||
|
||||
@@ -3452,8 +3455,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
protected void removeAfterChangingDimensions() {
|
||||
this.setRemoved(Entity.RemovalReason.CHANGED_DIMENSION, null); // CraftBukkit - add Bukkit remove cause
|
||||
if (this instanceof Leashable leashable) {
|
||||
- this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit
|
||||
- leashable.dropLeash(true, false);
|
||||
+ // Paper start - Expand EntityUnleashEvent
|
||||
+ final EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN, false); // CraftBukkit
|
||||
+ event.callEvent();
|
||||
+ leashable.dropLeash(true, event.isDropLeash());
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
}
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Leashable.java b/src/main/java/net/minecraft/world/entity/Leashable.java
|
||||
index 30d7dd9646ba9d6a9396dc140a61eb2cac07dfc6..674713a611e709542990f748027bdc5b800d6650 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Leashable.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Leashable.java
|
||||
@@ -166,8 +166,11 @@ public interface Leashable {
|
||||
|
||||
if (leashable_a != null && leashable_a.leashHolder != null) {
|
||||
if (!entity.isAlive() || !leashable_a.leashHolder.isAlive()) {
|
||||
- entity.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(entity.getBukkitEntity(), (!entity.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE)); // CraftBukkit
|
||||
- Leashable.dropLeash(entity, true, !entity.pluginRemoved); // CraftBukkit - SPIGOT-7487: Don't drop leash, when the holder was removed by a plugin
|
||||
+ // Paper start - Expand EntityUnleashEvent
|
||||
+ final EntityUnleashEvent event = new EntityUnleashEvent(entity.getBukkitEntity(), (!entity.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE, !entity.pluginRemoved);
|
||||
+ event.callEvent();
|
||||
+ Leashable.dropLeash(entity, true, event.isDropLeash()); // CraftBukkit - SPIGOT-7487: Don't drop leash, when the holder was removed by a plugin
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
}
|
||||
|
||||
Entity entity1 = ((Leashable) entity).getLeashHolder();
|
||||
@@ -198,11 +201,16 @@ public interface Leashable {
|
||||
|
||||
default void leashTooFarBehaviour() {
|
||||
// CraftBukkit start
|
||||
+ boolean dropLeash = true; // Paper
|
||||
if (this instanceof Entity entity) {
|
||||
- entity.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(entity.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE));
|
||||
+ // Paper start - Expand EntityUnleashEvent
|
||||
+ final EntityUnleashEvent event = new EntityUnleashEvent(entity.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE, true);
|
||||
+ dropLeash = event.isDropLeash();
|
||||
+ event.callEvent();
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
}
|
||||
// CraftBukkit end
|
||||
- this.dropLeash(true, true);
|
||||
+ this.dropLeash(true, dropLeash); // Paper
|
||||
}
|
||||
|
||||
default void closeRangeLeashBehaviour(Entity entity) {}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 4b0e269f3580c1c6dac1e5f2dd3cdac1d8e1118a..3988782c51b9d517ec003185c7b64605249206e2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -1619,8 +1619,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
boolean flag1 = super.startRiding(entity, force);
|
||||
|
||||
if (flag1 && this.isLeashed()) {
|
||||
- this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit
|
||||
- this.dropLeash(true, true);
|
||||
+ // Paper start - Expand EntityUnleashEvent
|
||||
+ EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.UNKNOWN, true);
|
||||
+ if (!event.callEvent()) { return flag1; }
|
||||
+ this.dropLeash(true, event.isDropLeash());
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
}
|
||||
|
||||
return flag1;
|
||||
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 3c0af74ed65610b1d5e3b72fdcf28c5a3423f0da..01173fc7177d78588978e087e63efda0b0527c2f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java
|
||||
@@ -118,13 +118,18 @@ public class LeashFenceKnotEntity extends BlockAttachedEntity {
|
||||
|
||||
if (leashable1.isLeashed() && leashable1.getLeashHolder() == this) {
|
||||
// CraftBukkit start
|
||||
+ boolean dropLeash = !player.hasInfiniteMaterials();
|
||||
if (leashable1 instanceof Entity leashed) {
|
||||
- if (CraftEventFactory.callPlayerUnleashEntityEvent(leashed, player, hand).isCancelled()) {
|
||||
+ // Paper start - Expand EntityUnleashEvent
|
||||
+ org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(leashed, player, hand, dropLeash);
|
||||
+ dropLeash = event.isDropLeash();
|
||||
+ if (event.isCancelled()) {
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
die = false;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
- leashable1.dropLeash(true, !player.getAbilities().instabuild); // false -> survival mode boolean
|
||||
+ leashable1.dropLeash(true, dropLeash); // false -> survival mode boolean // Paper - Expand EntityUnleashEvent
|
||||
// CraftBukkit end
|
||||
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 eb6df1a88bea4d2449e67871a27d75b974a006ce..f1dcb98fc8e91f2636b51e752ae231749df33d7c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -1568,8 +1568,10 @@ public class CraftEventFactory {
|
||||
Bukkit.getPluginManager().callEvent(new PlayerRecipeBookSettingsChangeEvent(player.getBukkitEntity(), bukkitType, open, filter));
|
||||
}
|
||||
|
||||
- public static PlayerUnleashEntityEvent callPlayerUnleashEntityEvent(Entity entity, net.minecraft.world.entity.player.Player player, InteractionHand enumhand) {
|
||||
- PlayerUnleashEntityEvent event = new PlayerUnleashEntityEvent(entity.getBukkitEntity(), (Player) player.getBukkitEntity(), CraftEquipmentSlot.getHand(enumhand));
|
||||
+ // Paper start - Expand EntityUnleashEvent
|
||||
+ public static PlayerUnleashEntityEvent callPlayerUnleashEntityEvent(Entity entity, net.minecraft.world.entity.player.Player player, InteractionHand enumhand, boolean dropLeash) {
|
||||
+ PlayerUnleashEntityEvent event = new PlayerUnleashEntityEvent(entity.getBukkitEntity(), (Player) player.getBukkitEntity(), CraftEquipmentSlot.getHand(enumhand), dropLeash);
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
entity.level().getCraftServer().getPluginManager().callEvent(event);
|
||||
return event;
|
||||
}
|
22
patches/server/0488-Reset-shield-blocking-on-dimension-change.patch
Normale Datei
22
patches/server/0488-Reset-shield-blocking-on-dimension-change.patch
Normale Datei
@ -0,0 +1,22 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Yive <admin@yive.me>
|
||||
Date: Sun, 24 Jan 2021 08:55:19 -0800
|
||||
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 2c24de44e48a1c55b81e2ecfb92c57e42546cc41..8afd1245316d9df8f1a1b45c669c9a8b7de77aa6 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1352,6 +1352,11 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
|
||||
PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld());
|
||||
this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
|
||||
// CraftBukkit end
|
||||
+ // Paper start - Reset shield blocking on dimension change
|
||||
+ if (this.isBlocking()) {
|
||||
+ this.stopUsingItem();
|
||||
+ }
|
||||
+ // Paper end - Reset shield blocking on dimension change
|
||||
return this;
|
||||
}
|
||||
}
|
@ -5,10 +5,10 @@ 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 9284466fb576b3320f17fc946da03d362cb67dde..b3a0e75f8a807ae378c777d12165c85b9680af6f 100644
|
||||
index 691d9d18e72a07b85bf13c6990b44e5cf56dffb5..64a334c368152656f0dbb811220ae20fbd3d5f85 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1580,6 +1580,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1608,6 +1608,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
|
||||
@ -17,10 +17,10 @@ index 9284466fb576b3320f17fc946da03d362cb67dde..b3a0e75f8a807ae378c777d12165c85b
|
||||
this.profiler.push(() -> {
|
||||
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 a9a39c99874001f1024f71bfc97130e8c9a507e7..19333b61bcb50f2171ac2c75d7f4ca4fdf4d4743 100644
|
||||
index deabbf30a550ff1835530257177b8f47e4710414..6b2d00878a373680bc3d59e19ae11a2d545146cc 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -227,6 +227,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -228,6 +228,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 a9a39c99874001f1024f71bfc97130e8c9a507e7..19333b61bcb50f2171ac2c75d7f4ca4f
|
||||
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 e2cd1097756832a2bb60cdd73fdd05d1c64e38d0..ab220fcc5301e91e76671c5a11ddbbc9ac604bf9 100644
|
||||
index f26f7760a2452af9b59c1b64d27700f56b32af97..d23b13c1d2f53aa1a9085576e4ebf5ccc768b92d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3461,6 +3461,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3481,6 +3481,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
this.pushEntities();
|
||||
this.level().getProfiler().pop();
|
@ -5,10 +5,10 @@ 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 19333b61bcb50f2171ac2c75d7f4ca4fdf4d4743..3816b445279fcd562acc06f08b8cd04bffa49592 100644
|
||||
index 6b2d00878a373680bc3d59e19ae11a2d545146cc..58c56636f324f1073bbb03d94f51cd69600a80c4 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1376,6 +1376,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1374,6 +1374,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
this.getChunkSource().blockChanged(pos);
|
||||
this.pathTypesByPosCache.invalidate(pos);
|
||||
@ -16,7 +16,7 @@ index 19333b61bcb50f2171ac2c75d7f4ca4fdf4d4743..3816b445279fcd562acc06f08b8cd04b
|
||||
VoxelShape voxelshape = oldState.getCollisionShape(this, pos);
|
||||
VoxelShape voxelshape1 = newState.getCollisionShape(this, pos);
|
||||
|
||||
@@ -1417,6 +1418,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1415,6 +1416,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
|
||||
}
|
@ -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 54635efbc71c3c80b44342bf5fb213bfb66408c4..b3aceea0a7f57f32da3924ed73231a0dc65ccc51 100644
|
||||
index f1dcb98fc8e91f2636b51e752ae231749df33d7c..388f0a53e993b84376ce2549c6b041bed283b8a7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -451,13 +451,30 @@ public class CraftEventFactory {
|
||||
@@ -452,13 +452,30 @@ public class CraftEventFactory {
|
||||
}
|
||||
|
||||
public static void handleBlockDropItemEvent(Block block, BlockState state, ServerPlayer player, List<ItemEntity> items) {
|
@ -5,10 +5,10 @@ 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 f03f40e2624d0e8e27a6fb7ae33d82cb614252f4..9ef8f014af332da129bfcd3370da983ec035ecc6 100644
|
||||
index cd03d705337a0ea34c7c06a581294112433afb50..69992ebc999ea3ff9e47e4e049bcc514c01150ca 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
|
||||
@@ -106,4 +106,12 @@ public class AttributeMap {
|
||||
@@ -140,4 +140,12 @@ public class AttributeMap {
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -38,10 +38,10 @@ index 5678d2007d5adf45dec0638c5dd848b601801814..0a7ed5a4f1644a70d8f98ad7a6962b81
|
||||
+ // 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 b88077ac1ed99057b8a9361ea550cd2b00040f88..2701e53086f4be07c341cd1e4fcd7a351e77c486 100644
|
||||
index aad17b34fedd7030939f3b834b313b7f79b69ce1..36ec4032ade4b0f7ae9428e7871354ef9527f0c8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -754,6 +754,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -756,6 +756,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 2080733ebae1af51b7b4d3cd2fbd1a4a2703a920..d30e1dd1b4525674c8a52da9b677c09a251b2467 100644
|
||||
index 98e8ad81b8c9c0636abe59f70ce891fe926a37fe..4134bfb3579e91367644df517c161c1b40cdbe66 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1052,4 +1052,19 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -1069,4 +1069,19 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
return getHandle().isTicking();
|
||||
}
|
||||
// Paper end - isTicking API
|
@ -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 1bc8217cf1df95edadd57e18a91885808d31cb93..a0d0e334dfe63e62c6c4a83099c9953205ada5cc 100644
|
||||
index 2b1d7a2360a9ee7bca9d93a2dc8c61d1648a8348..d5153f804cfcfd1a70c46975e3fb1e50c8a82999 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -212,6 +212,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -216,6 +216,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 1bc8217cf1df95edadd57e18a91885808d31cb93..a0d0e334dfe63e62c6c4a83099c99532
|
||||
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
|
||||
@@ -266,9 +272,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -270,9 +276,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,7 +48,7 @@ index 1bc8217cf1df95edadd57e18a91885808d31cb93..a0d0e334dfe63e62c6c4a83099c99532
|
||||
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 d5071f9f2d433706fc378f77906bb5f04fca0540..130a50380232b67a50e5a6923dad4a6e67858550 100644
|
||||
index 05365355fe54d2ed37724d17b174b32fbe6f417f..0e3aa2a16ecdc607efba8db92aedf877657f1026 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -179,6 +179,7 @@ public abstract class PlayerList {
|
@ -5,10 +5,10 @@ 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 580eb275942570da9e68287ca75da886ba1248c0..6c6eb7deed281678c05ef27f933e1693b11dae7c 100644
|
||||
index 3442e33a1146318228c4727a2a5afde685f69bf7..04e62c54f224f7949fde9ceded208e700db55aa1 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 {
|
||||
@@ -140,6 +140,14 @@ public class WorldBorder {
|
||||
}
|
||||
|
||||
public void setCenter(double x, double z) {
|
||||
@ -23,7 +23,7 @@ index 580eb275942570da9e68287ca75da886ba1248c0..6c6eb7deed281678c05ef27f933e1693
|
||||
this.centerX = x;
|
||||
this.centerZ = z;
|
||||
this.extent.onCenterChange();
|
||||
@@ -149,6 +157,17 @@ public class WorldBorder {
|
||||
@@ -166,6 +174,17 @@ public class WorldBorder {
|
||||
}
|
||||
|
||||
public void setSize(double size) {
|
||||
@ -41,7 +41,7 @@ index 580eb275942570da9e68287ca75da886ba1248c0..6c6eb7deed281678c05ef27f933e1693
|
||||
this.extent = new WorldBorder.StaticBorderExtent(size);
|
||||
Iterator iterator = this.getListeners().iterator();
|
||||
|
||||
@@ -161,6 +180,20 @@ public class WorldBorder {
|
||||
@@ -178,6 +197,20 @@ public class WorldBorder {
|
||||
}
|
||||
|
||||
public void lerpSizeBetween(double fromSize, double toSize, long time) {
|
||||
@ -62,7 +62,7 @@ index 580eb275942570da9e68287ca75da886ba1248c0..6c6eb7deed281678c05ef27f933e1693
|
||||
this.extent = (WorldBorder.BorderExtent) (fromSize == toSize ? new WorldBorder.StaticBorderExtent(toSize) : new WorldBorder.MovingBorderExtent(fromSize, toSize, time));
|
||||
Iterator iterator = this.getListeners().iterator();
|
||||
|
||||
@@ -472,6 +505,7 @@ public class WorldBorder {
|
||||
@@ -489,6 +522,7 @@ public class WorldBorder {
|
||||
|
||||
@Override
|
||||
public WorldBorder.BorderExtent update() {
|
@ -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 4cd7232f538649d99892f3b31f2741b1d7e792e8..e18ebeef377411f1e921e3d769c4a1d379a12be4 100644
|
||||
index b5a26a44b3cf7d864eae909acf619d857c4fa397..92a1173dc8be632a4ff4b6137dbe1a9244f64742 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
|
||||
@@ -443,7 +443,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
@@ -444,7 +444,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
CraftItemStack source = CraftItemStack.asCraftMirror(itemstack);
|
||||
org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1);
|
||||
|
||||
@ -18,22 +18,22 @@ index 4cd7232f538649d99892f3b31f2741b1d7e792e8..e18ebeef377411f1e921e3d769c4a1d3
|
||||
|
||||
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 66fbad74c2ec2f853ec6c74482c6cae1c1746007..e858d32c7e8e228a1f0327a33054671ad105c2eb 100644
|
||||
index 80f911692c97585a696a19ebbe616d6aa312b2d9..0c20a334be4b1c4cf7999826f8d9bff5e36bc2b8 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
|
||||
@@ -68,7 +68,10 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
|
||||
@@ -67,7 +67,10 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
|
||||
|
||||
if (campfire.cookingProgress[i] >= campfire.cookingTime[i]) {
|
||||
SimpleContainer inventorysubcontainer = new SimpleContainer(new ItemStack[]{itemstack});
|
||||
- ItemStack itemstack1 = (ItemStack) campfire.quickCheck.getRecipeFor(inventorysubcontainer, world).map((recipeholder) -> {
|
||||
+ // Paper start - Add recipe to cook events; re-use recipeHolderOptional below
|
||||
+ Optional<RecipeHolder<CampfireCookingRecipe>> recipeHolderOptional = campfire.quickCheck.getRecipeFor(inventorysubcontainer, world);
|
||||
+ ItemStack itemstack1 = (ItemStack) recipeHolderOptional.map((recipeholder) -> {
|
||||
SingleRecipeInput singlerecipeinput = new SingleRecipeInput(itemstack);
|
||||
- ItemStack itemstack1 = (ItemStack) campfire.quickCheck.getRecipeFor(singlerecipeinput, world).map((recipeholder) -> {
|
||||
+ // Paper start - add recipe to cook events
|
||||
+ Optional<RecipeHolder<CampfireCookingRecipe>> recipeHolderOptional = campfire.quickCheck.getRecipeFor(singlerecipeinput, world);
|
||||
+ ItemStack itemstack1 = recipeHolderOptional.map((recipeholder) -> {
|
||||
+ // Paper end - Add recipe to cook events
|
||||
return ((CampfireCookingRecipe) recipeholder.value()).assemble(inventorysubcontainer, world.registryAccess());
|
||||
return ((CampfireCookingRecipe) recipeholder.value()).assemble(singlerecipeinput, world.registryAccess());
|
||||
}).orElse(itemstack);
|
||||
|
||||
@@ -77,7 +80,7 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
|
||||
@@ -76,7 +79,7 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
|
||||
CraftItemStack source = CraftItemStack.asCraftMirror(itemstack);
|
||||
org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1);
|
||||
|
@ -5,10 +5,10 @@ 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 362bd15dc359762095bdc5120a25460227a0175e..55c311ddc8add7d5838d112bc3a71baeb52356a8 100644
|
||||
index 1725451dcd7c62319b282ee7543202e56ca49b26..c6382cb0fb56e3c1ffc37545fbe3e592f9a31b55 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1747,8 +1747,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1759,8 +1759,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
int i = this.player.level().getMaxBuildHeight();
|
||||
|
||||
if (blockposition.getY() < i) {
|
@ -5,10 +5,10 @@ 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 f129fa38d079dc57ca2cf3b6738dd9dc0fa95991..9bf4d9eaa961196873b3be89c2ca05e701025871 100644
|
||||
index 1963e826548c5a8859c50f57654784c3aef50e44..04a39cb6c13c26e2cb1d73a9da98df5d04df69bc 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
@@ -514,5 +514,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
@@ -515,5 +515,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
public io.papermc.paper.world.MoonPhase getMoonPhase() {
|
||||
return io.papermc.paper.world.MoonPhase.getPhase(this.getHandle().dayTime() / 24000L);
|
||||
}
|
||||
@ -20,10 +20,10 @@ index f129fa38d079dc57ca2cf3b6738dd9dc0fa95991..9bf4d9eaa961196873b3be89c2ca05e7
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 740b34322aeb566248abfe0e34b8919078982217..144d09f65aca6456b060c5874b61f55a1cd5ae59 100644
|
||||
index 24c8e9a43affa8ca99c03562aefc3d6402c23281..ec92033fef581e42fb3f36acaba626894b369f56 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1169,9 +1169,15 @@ public final class CraftServer implements Server {
|
||||
@@ -1172,9 +1172,15 @@ public final class CraftServer implements Server {
|
||||
File folder = new File(this.getWorldContainer(), name);
|
||||
World world = this.getWorld(name);
|
||||
|
||||
@ -41,16 +41,16 @@ index 740b34322aeb566248abfe0e34b8919078982217..144d09f65aca6456b060c5874b61f55a
|
||||
|
||||
if (folder.exists()) {
|
||||
Preconditions.checkArgument(folder.isDirectory(), "File (%s) exists and isn't a folder", name);
|
||||
@@ -1297,7 +1303,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1300,7 +1306,7 @@ public final class CraftServer implements Server {
|
||||
} else if (name.equals(levelName + "_the_end")) {
|
||||
worldKey = net.minecraft.world.level.Level.END;
|
||||
} else {
|
||||
- worldKey = ResourceKey.create(Registries.DIMENSION, new ResourceLocation(name.toLowerCase(Locale.ROOT)));
|
||||
+ worldKey = ResourceKey.create(Registries.DIMENSION, new net.minecraft.resources.ResourceLocation(creator.key().getNamespace().toLowerCase(java.util.Locale.ROOT), creator.key().getKey().toLowerCase(java.util.Locale.ROOT))); // Paper
|
||||
- worldKey = ResourceKey.create(Registries.DIMENSION, ResourceLocation.withDefaultNamespace(name.toLowerCase(Locale.ROOT)));
|
||||
+ worldKey = ResourceKey.create(Registries.DIMENSION, ResourceLocation.fromNamespaceAndPath(creator.key().namespace(), creator.key().value()));
|
||||
}
|
||||
|
||||
// If set to not keep spawn in memory (changed from default) then adjust rule accordingly
|
||||
@@ -1393,6 +1399,15 @@ public final class CraftServer implements Server {
|
||||
@@ -1396,6 +1402,15 @@ public final class CraftServer implements Server {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -67,7 +67,7 @@ index 740b34322aeb566248abfe0e34b8919078982217..144d09f65aca6456b060c5874b61f55a
|
||||
// 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 176557c1910eff297cfedc11ae95f0f03c73812d..6898e89b19f028736b5eb736746000bf7023145a 100644
|
||||
index 50322927460ec9464363617e3f7fe5ff8faa1f6f..00e4e899cf7ee5da89a77175e417115e7ba97afd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -541,6 +541,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
@ -7,10 +7,10 @@ Fixes disappearance of held items, when a player gets disconnected and PlayerDro
|
||||
Closes #5036
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 130a50380232b67a50e5a6923dad4a6e67858550..975cd4530e1ad903df32bb8b3d760ca462b42b5c 100644
|
||||
index 0e3aa2a16ecdc607efba8db92aedf877657f1026..d6c5a664b9e08083e856e79522b85b2e75e677a8 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -594,6 +594,14 @@ public abstract class PlayerList {
|
||||
@@ -588,6 +588,14 @@ public abstract class PlayerList {
|
||||
}
|
||||
// Paper end - Configurable player collision
|
||||
|
@ -5,15 +5,15 @@ Subject: [PATCH] forced whitelist: use configurable kick message
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index b3a0e75f8a807ae378c777d12165c85b9680af6f..5c47573843c25b0d15037a28e55b616c829f694d 100644
|
||||
index 64a334c368152656f0dbb811220ae20fbd3d5f85..fa37c6b43f76af0b82b056cf87ba350abf92e7bb 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2266,7 +2266,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2294,7 +2294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
|
||||
|
||||
if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420)
|
||||
- entityplayer.connection.disconnect(Component.translatable("multiplayer.disconnect.not_whitelisted"));
|
||||
+ entityplayer.connection.disconnect(org.spigotmc.SpigotConfig.whitelistMessage); // Paper - use configurable message
|
||||
- entityplayer.connection.disconnect((Component) Component.translatable("multiplayer.disconnect.not_whitelisted"));
|
||||
+ entityplayer.connection.disconnect(net.kyori.adventure.text.Component.text(org.spigotmc.SpigotConfig.whitelistMessage));
|
||||
}
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Don't ignore result of PlayerEditBookEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 55c311ddc8add7d5838d112bc3a71baeb52356a8..cf53e6270ef3cdd3baa251e813eeb3526919bbcc 100644
|
||||
index c6382cb0fb56e3c1ffc37545fbe3e592f9a31b55..404de2d141c7c436a04d82c637648922c3290ac2 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1152,7 +1152,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1155,7 +1155,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
List<Filterable<String>> list1 = pages.stream().map(this::filterableFromOutgoing).toList();
|
||||
|
||||
itemstack.set(DataComponents.WRITABLE_BOOK_CONTENT, new WritableBookContent(list1));
|
@ -5,7 +5,7 @@ Subject: [PATCH] Expose protocol version
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 6898e89b19f028736b5eb736746000bf7023145a..b89dcdf4b303042024dec1bf07f92fb08327f061 100644
|
||||
index 00e4e899cf7ee5da89a77175e417115e7ba97afd..a71717fe99e78c480747cc61ab30b53b6667fde7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -546,6 +546,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
@ -208,10 +208,10 @@ index 0000000000000000000000000000000000000000..dd9d77d7c7f1a5a130a1f4c15e5b1e68
|
||||
+ public void setErrorIndex(final int errorIndex) {}
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index a0d0e334dfe63e62c6c4a83099c9953205ada5cc..8f04770e479f2ee832edf55698153cd62524d9e8 100644
|
||||
index d5153f804cfcfd1a70c46975e3fb1e50c8a82999..764395fe8e49d811294ca82887fee91ca6cd01fc 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -186,7 +186,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -190,7 +190,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
|
||||
thread.setDaemon(true);
|
||||
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER));
|
||||
@ -220,7 +220,7 @@ index a0d0e334dfe63e62c6c4a83099c9953205ada5cc..8f04770e479f2ee832edf55698153cd6
|
||||
DedicatedServer.LOGGER.info("Starting minecraft server version {}", SharedConstants.getCurrentVersion().getName());
|
||||
if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) {
|
||||
DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
|
||||
@@ -219,6 +219,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -223,6 +223,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
this.getPlayerList().loadAndSaveFiles(); // Must be after convertNames
|
||||
// Paper end - fix converting txt to json file
|
||||
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread
|
@ -9,10 +9,10 @@ till their item is switched.
|
||||
This patch clears the active item when the event is cancelled
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index ab220fcc5301e91e76671c5a11ddbbc9ac604bf9..5b03665a04a68dc49fb0100b58148ffa2d8f6000 100644
|
||||
index d23b13c1d2f53aa1a9085576e4ebf5ccc768b92d..55381753736e3ec4a84730f22731544cdddfcb29 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3955,6 +3955,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3982,6 +3982,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
this.level().getCraftServer().getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
@ -8,10 +8,10 @@ Paper.bypassHostCheck
|
||||
Seriously, fix your firewalls. -.-
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
index ffe3048d16809b177d2fb495a25a16ed78b50e6b..b5d8ef9dd24687b99f5cf547574351c359fb85ba 100644
|
||||
index 0c1bdf2329936ce479a2cc53e8a46bd2ad685ec1..a5bbea6a073e00c10c3c5facd997eb8473fd9a5f 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
@@ -31,6 +31,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
@@ -32,6 +32,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
private static final Component IGNORE_STATUS_REASON = Component.translatable("disconnect.ignoring_status_request");
|
||||
private final MinecraftServer server;
|
||||
private final Connection connection;
|
||||
@ -19,7 +19,7 @@ index ffe3048d16809b177d2fb495a25a16ed78b50e6b..b5d8ef9dd24687b99f5cf547574351c3
|
||||
|
||||
public ServerHandshakePacketListenerImpl(MinecraftServer server, Connection connection) {
|
||||
this.server = server;
|
||||
@@ -163,7 +164,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
@@ -164,7 +165,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
String[] split = packet.hostName().split("\00");
|
||||
if (!handledByEvent && proxyLogicEnabled) { // Paper
|
||||
// if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above!
|
@ -5,10 +5,10 @@ Subject: [PATCH] Set area affect cloud rotation
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
index 3bbd314d94de3736e039b4b2d836afa8cc892511..abcfb3accb715a5a041de4b798cf3582d1fde325 100644
|
||||
index 9b2b0bbb1755b6be1c23cf56e29a68b0002fd755..481f0c62fcd4435d655cfe2f94f46262b24a7144 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
@@ -373,7 +373,7 @@ public final class CraftEntityTypes {
|
||||
@@ -374,7 +374,7 @@ public final class CraftEntityTypes {
|
||||
register(new EntityTypeData<>(EntityType.EXPERIENCE_ORB, ExperienceOrb.class, CraftExperienceOrb::new,
|
||||
spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null) // Paper
|
||||
));
|
@ -5,10 +5,10 @@ Subject: [PATCH] add consumeFuel to FurnaceBurnEvent
|
||||
|
||||
|
||||
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 e18ebeef377411f1e921e3d769c4a1d379a12be4..614ddebb92aba91694951fc22900fed362b3426d 100644
|
||||
index 92a1173dc8be632a4ff4b6137dbe1a9244f64742..35061cb17850789e40b0e4bca453df92f1178546 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
|
||||
@@ -364,7 +364,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
@@ -365,7 +365,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
|
||||
if (blockEntity.isLit() && furnaceBurnEvent.isBurning()) {
|
||||
// CraftBukkit end
|
||||
flag1 = true;
|
@ -5,10 +5,10 @@ Subject: [PATCH] fix PigZombieAngerEvent cancellation
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
||||
index 6db402d0c515956af8a2462a2461fac783f0c1e2..a6def4133f06c41be287e9942643e80a7b8e8218 100644
|
||||
index f4adf67392402faedd47c4a759fa2c13d85a1c26..10388cf33f6f33070aa84b3b2d7bd14fc50ceea8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
||||
@@ -55,6 +55,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
|
||||
@@ -56,6 +56,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
|
||||
private static final int ALERT_RANGE_Y = 10;
|
||||
private static final UniformInt ALERT_INTERVAL = TimeUtil.rangeOfSeconds(4, 6);
|
||||
private int ticksUntilNextAlert;
|
||||
@ -16,7 +16,7 @@ index 6db402d0c515956af8a2462a2461fac783f0c1e2..a6def4133f06c41be287e9942643e80a
|
||||
|
||||
public ZombifiedPiglin(EntityType<? extends ZombifiedPiglin> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -70,7 +71,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
|
||||
@@ -71,7 +72,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
|
||||
protected void addBehaviourGoals() {
|
||||
this.goalSelector.addGoal(2, new ZombieAttackGoal(this, 1.0D, false));
|
||||
this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0D));
|
||||
@ -25,7 +25,7 @@ index 6db402d0c515956af8a2462a2461fac783f0c1e2..a6def4133f06c41be287e9942643e80a
|
||||
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt));
|
||||
this.targetSelector.addGoal(3, new ResetUniversalAngerTargetGoal<>(this, true));
|
||||
}
|
||||
@@ -178,6 +179,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
|
||||
@@ -179,6 +180,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
|
||||
this.level().getCraftServer().getPluginManager().callEvent(event);
|
||||
if (event.isCancelled()) {
|
||||
this.setPersistentAngerTarget(null);
|
@ -5,10 +5,10 @@ Subject: [PATCH] fix PlayerItemHeldEvent firing twice
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index cf53e6270ef3cdd3baa251e813eeb3526919bbcc..22da7f7c4b033d31b7a71878e34562a4370a4bd4 100644
|
||||
index 404de2d141c7c436a04d82c637648922c3290ac2..b1b833383c5196c2aee07fb7118cfef069abc3cd 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1917,6 +1917,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1934,6 +1934,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
if (this.player.isImmobile()) return; // CraftBukkit
|
||||
if (packet.getSlot() >= 0 && packet.getSlot() < Inventory.getSelectionSize()) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerDeepSleepEvent
|
||||
|
||||
|
||||
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 389da4ed8d166f840e881579db51058f44e9ee24..444e226a32062efff45e3d3d42fdc756787bc6ac 100644
|
||||
index 5abd72b1a80967bd2502537978d8f5456075f357..6ce03f49f5085cf468ae2114f08f1faa1b099aaa 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -260,6 +260,13 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -261,6 +261,13 @@ public abstract class Player extends LivingEntity {
|
||||
|
||||
if (this.isSleeping()) {
|
||||
++this.sleepCounter;
|
@ -5,7 +5,7 @@ Subject: [PATCH] More World API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index a78922dc4a1f0719753d7349fc6abd473fd96eed..0f1f5e4cbe476f45f9473cc9ce4e50f837eba652 100644
|
||||
index ab5b7ed7ebc1205cb9e4aa017f5d69ccb4fc8ac2..ab8a2906ee2c5eb3d11001f421e76ddde1172d46 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2153,6 +2153,53 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
@ -42,10 +42,10 @@ index 0000000000000000000000000000000000000000..dd6012b6a097575b2d1471be5069ecce
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 8f04770e479f2ee832edf55698153cd62524d9e8..c0261c3cd6de850edbd197272c2d1c52f76e6ebe 100644
|
||||
index 764395fe8e49d811294ca82887fee91ca6cd01fc..4057ade698a227b4f6efd3aa30b16d78c777be83 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -223,6 +223,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -227,6 +227,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
|
||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
@ -0,0 +1,26 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: HexedHero <6012891+HexedHero@users.noreply.github.com>
|
||||
Date: Fri, 23 Apr 2021 22:42:42 +0100
|
||||
Subject: [PATCH] Expand PlayerRespawnEvent, fix passed parameter issues
|
||||
|
||||
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 8afd1245316d9df8f1a1b45c669c9a8b7de77aa6..1cc771bfecc8d86d103879fbef28dbf993a7903e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1197,7 +1197,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
|
||||
Player respawnPlayer = this.getBukkitEntity();
|
||||
Location location = CraftLocation.toBukkit(dimensionTransition.pos(), dimensionTransition.newLevel().getWorld(), dimensionTransition.yRot(), dimensionTransition.xRot());
|
||||
|
||||
- PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn, isAnchorSpawn, reason);
|
||||
+ // Paper start - respawn flags
|
||||
+ com.google.common.collect.ImmutableSet.Builder<org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag> builder = com.google.common.collect.ImmutableSet.builder();
|
||||
+ if (reason == org.bukkit.event.player.PlayerRespawnEvent.RespawnReason.END_PORTAL) {
|
||||
+ builder.add(org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag.END_PORTAL);
|
||||
+ }
|
||||
+ PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn, isAnchorSpawn, reason, builder);
|
||||
+ // Paper end - respawn flags
|
||||
this.level().getCraftServer().getPluginManager().callEvent(respawnEvent);
|
||||
// Spigot Start
|
||||
if (this.connection.isDisconnected()) {
|
@ -1,140 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nassim Jahnke <nassim@njahnke.dev>
|
||||
Date: Fri, 29 Jan 2021 15:13:11 +0100
|
||||
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 2d2f2f8320df7650a6fc746d7071c9ffdbb8e2d4..5b169de9c2a34044dcf46c613291ae56a83ad5d2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -1431,12 +1431,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.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.hasInfiniteMaterials());
|
||||
+ this.dropLeash(true, event.isDropLeash()); // Paper - Expand EntityUnleashEvent
|
||||
this.gameEvent(GameEvent.ENTITY_INTERACT, player);
|
||||
return InteractionResult.sidedSuccess(this.level().isClientSide);
|
||||
} else {
|
||||
@@ -1605,8 +1608,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
|
||||
|
||||
if (this.leashHolder != null) {
|
||||
if (!this.isAlive() || !this.leashHolder.isAlive()) {
|
||||
- this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), (!this.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE)); // CraftBukkit
|
||||
- this.dropLeash(true, !this.leashHolder.pluginRemoved);// CraftBukkit - SPIGOT-7487: Don't drop leash, when the holder was removed by a plugin
|
||||
+ // Paper start - Expand EntityUnleashEvent
|
||||
+ EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), (!this.isAlive()) ? EntityUnleashEvent.UnleashReason.PLAYER_UNLEASH : EntityUnleashEvent.UnleashReason.HOLDER_GONE, !this.leashHolder.pluginRemoved);
|
||||
+ this.level().getCraftServer().getPluginManager().callEvent(event); // CraftBukkit
|
||||
+ this.dropLeash(true, event.isDropLeash());
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1674,8 +1680,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
|
||||
boolean flag1 = super.startRiding(entity, force);
|
||||
|
||||
if (flag1 && this.isLeashed()) {
|
||||
- this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit
|
||||
- this.dropLeash(true, true);
|
||||
+ // Paper start - Expand EntityUnleashEvent
|
||||
+ EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.UNKNOWN, true);
|
||||
+ if (!event.callEvent()) { return flag1; }
|
||||
+ this.dropLeash(true, event.isDropLeash());
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
}
|
||||
|
||||
return flag1;
|
||||
@@ -1852,8 +1861,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
|
||||
@Override
|
||||
protected void removeAfterChangingDimensions() {
|
||||
super.removeAfterChangingDimensions();
|
||||
- this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit
|
||||
- this.dropLeash(true, false);
|
||||
+ // Paper start - Expand EntityUnleashEvent
|
||||
+ EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.UNKNOWN, false);
|
||||
+ this.level().getCraftServer().getPluginManager().callEvent(event); // CraftBukkit
|
||||
+ this.dropLeash(true, event.isDropLeash());
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
this.getAllSlots().forEach((itemstack) -> {
|
||||
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 e92831739603ef1b5678c9d44e85ab70d62be0e7..cdd07093342521ff9944bf7a342bbf142ba3f0b7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/PathfinderMob.java
|
||||
@@ -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
|
||||
- this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit
|
||||
- this.dropLeash(true, true);
|
||||
+ // Paper start - Expand EntityUnleashEvent
|
||||
+ EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE, true);
|
||||
+ if (!event.callEvent()) return;
|
||||
+ this.dropLeash(true, event.isDropLeash());
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -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
|
||||
- this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit
|
||||
- this.dropLeash(true, true);
|
||||
+ // Paper start - Expand EntityUnleashEvent
|
||||
+ EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE, true);
|
||||
+ if (!event.callEvent()) return;
|
||||
+ this.dropLeash(true, event.isDropLeash());
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
this.goalSelector.disableControlFlag(Goal.Flag.MOVE);
|
||||
} 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 dfb0db42e335fd7334b752ac62f8adb7bffbb2ef..65d140a3e3c42763ce4d162f8c9f5b9d79d4e501 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java
|
||||
@@ -121,11 +121,14 @@ public class LeashFenceKnotEntity extends HangingEntity {
|
||||
|
||||
if (entityinsentient1.isLeashed() && entityinsentient1.getLeashHolder() == this) {
|
||||
// CraftBukkit start
|
||||
- if (CraftEventFactory.callPlayerUnleashEntityEvent(entityinsentient1, player, hand).isCancelled()) {
|
||||
+ // Paper start - Expand EntityUnleashEvent
|
||||
+ org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(entityinsentient1, player, hand, !player.getAbilities().instabuild);
|
||||
+ if (event.isCancelled()) {
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
die = false;
|
||||
continue;
|
||||
}
|
||||
- entityinsentient1.dropLeash(true, !player.getAbilities().instabuild); // false -> survival mode boolean
|
||||
+ entityinsentient1.dropLeash(true, event.isDropLeash()); // false -> survival mode boolean // Paper - Expand EntityUnleashEvent
|
||||
// CraftBukkit end
|
||||
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 676528008a90d9af916a96c3f3518f8d1bd090fb..54635efbc71c3c80b44342bf5fb213bfb66408c4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -1567,8 +1567,10 @@ public class CraftEventFactory {
|
||||
Bukkit.getPluginManager().callEvent(new PlayerRecipeBookSettingsChangeEvent(player.getBukkitEntity(), bukkitType, open, filter));
|
||||
}
|
||||
|
||||
- public static PlayerUnleashEntityEvent callPlayerUnleashEntityEvent(Mob entity, net.minecraft.world.entity.player.Player player, InteractionHand enumhand) {
|
||||
- PlayerUnleashEntityEvent event = new PlayerUnleashEntityEvent(entity.getBukkitEntity(), (Player) player.getBukkitEntity(), CraftEquipmentSlot.getHand(enumhand));
|
||||
+ // Paper start - Expand EntityUnleashEvent
|
||||
+ public static PlayerUnleashEntityEvent callPlayerUnleashEntityEvent(Mob entity, net.minecraft.world.entity.player.Player player, InteractionHand enumhand, boolean dropLeash) {
|
||||
+ PlayerUnleashEntityEvent event = new PlayerUnleashEntityEvent(entity.getBukkitEntity(), (Player) player.getBukkitEntity(), CraftEquipmentSlot.getHand(enumhand), dropLeash);
|
||||
+ // Paper end - Expand EntityUnleashEvent
|
||||
entity.level().getCraftServer().getPluginManager().callEvent(event);
|
||||
return event;
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Yive <admin@yive.me>
|
||||
Date: Sun, 24 Jan 2021 08:55:19 -0800
|
||||
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 d262946f729a5621f311e266b6b316d445b9e02a..d7a8664e9ccccdb4b4618399c72fa38c24354e46 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1275,6 +1275,11 @@ public class ServerPlayer extends Player {
|
||||
this.level().getCraftServer().getPluginManager().callEvent(changeEvent);
|
||||
// CraftBukkit end
|
||||
}
|
||||
+ // Paper start - Reset shield blocking on dimension change
|
||||
+ if (this.isBlocking()) {
|
||||
+ this.stopUsingItem();
|
||||
+ }
|
||||
+ // Paper end - Reset shield blocking on dimension change
|
||||
|
||||
return this;
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: HexedHero <6012891+HexedHero@users.noreply.github.com>
|
||||
Date: Fri, 23 Apr 2021 22:42:42 +0100
|
||||
Subject: [PATCH] Expand PlayerRespawnEvent, fix passed parameter issues
|
||||
|
||||
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 22da7f7c4b033d31b7a71878e34562a4370a4bd4..c8124bf451f5d03374f32a04b9b28fc9d97897ae 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2706,7 +2706,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
case PERFORM_RESPAWN:
|
||||
if (this.player.wonGame) {
|
||||
this.player.wonGame = false;
|
||||
- this.player = this.server.getPlayerList().respawn(this.player, true, RespawnReason.END_PORTAL);
|
||||
+ this.player = this.server.getPlayerList().respawn(this.player, this.server.getLevel(this.player.getRespawnDimension()), true, null, true, RespawnReason.END_PORTAL, org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag.END_PORTAL); // Paper - Expand PlayerRespawnEvent
|
||||
CriteriaTriggers.CHANGED_DIMENSION.trigger(this.player, Level.END, Level.OVERWORLD);
|
||||
} else {
|
||||
if (this.player.getHealth() > 0.0F) {
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 975cd4530e1ad903df32bb8b3d760ca462b42b5c..40d1451b43228b802aabe8c021ad781ceb8d8df8 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -779,6 +779,12 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation, RespawnReason reason) {
|
||||
+ // Paper start - Expand PlayerRespawnEvent
|
||||
+ return respawn(entityplayer, worldserver, flag, location, avoidSuffocation, reason, new org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag[0]);
|
||||
+ }
|
||||
+
|
||||
+ public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation, RespawnReason reason, org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag...respawnFlags) {
|
||||
+ // Paper end - Expand PlayerRespawnEvent
|
||||
entityplayer.stopRiding(); // CraftBukkit
|
||||
this.players.remove(entityplayer);
|
||||
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
|
||||
@@ -820,6 +826,7 @@ public abstract class PlayerList {
|
||||
|
||||
// Paper start - Add PlayerPostRespawnEvent
|
||||
boolean isBedSpawn = false;
|
||||
+ boolean isAnchorSpawn = false; // Paper - Fix PlayerRespawnEvent
|
||||
boolean isRespawn = false;
|
||||
boolean isLocAltered = false; // Paper - Fix SPIGOT-5989
|
||||
// Paper end - Add PlayerPostRespawnEvent
|
||||
@@ -840,6 +847,7 @@ public abstract class PlayerList {
|
||||
if (optional.isPresent()) {
|
||||
BlockState iblockdata = worldserver1.getBlockState(blockposition);
|
||||
boolean flag3 = iblockdata.is(Blocks.RESPAWN_ANCHOR);
|
||||
+ isAnchorSpawn = flag3; // Paper - Fix PlayerRespawnEvent
|
||||
Vec3 vec3d = (Vec3) optional.get();
|
||||
float f1;
|
||||
|
||||
@@ -868,7 +876,7 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
Player respawnPlayer = entityplayer1.getBukkitEntity();
|
||||
- PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !flag2, flag2, reason);
|
||||
+ PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn && !isAnchorSpawn, isAnchorSpawn, reason, com.google.common.collect.ImmutableSet.<org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag>builder().add(respawnFlags)); // Paper - PlayerRespawnEvent changes
|
||||
this.cserver.getPluginManager().callEvent(respawnEvent);
|
||||
// Spigot Start
|
||||
if (entityplayer.connection.isDisconnected()) {
|
In neuem Issue referenzieren
Einen Benutzer sperren