mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Updated Upstream (CraftBukkit/Spigot)
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes: ead719a65 SPIGOT-7136: Cancelling PlayerInteractEntityEvent with the Allay desyncs 8468e167e SPIGOT-7137: StructureGrowEvent isFromBonemeal and getPlayer have incorrect values d45057c59 SPIGOT-7089: Crash when command blocks attempt to load worlds Spigot Changes: 450dcaa8 Rebuild patches
This commit is contained in:
parent
f7b33b60b0
commit
4c6f66a6a3
8 changed files with 30 additions and 15 deletions
|
@ -2057,9 +2057,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
// CraftBukkit start
|
||||
+import io.papermc.paper.adventure.ChatProcessor; // Paper
|
||||
+import io.papermc.paper.adventure.PaperAdventure; // Paper
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import net.minecraft.network.chat.OutgoingPlayerChatMessage;
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
return this.server.isSingleplayerOwner(this.player.getGameProfile());
|
||||
}
|
||||
|
|
|
@ -17,6 +17,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
// Paper end
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
}
|
||||
// Paper end
|
||||
// SPIGOT-7136 - Allays
|
||||
- if (entity instanceof Allay) {
|
||||
- ServerGamePacketListenerImpl.this.send(new ClientboundSetEquipmentPacket(entity.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, ((LivingEntity) entity).getItemBySlot(slot).copy())).collect(Collectors.toList())));
|
||||
+ if (entity instanceof Allay allay) { // Paper
|
||||
+ ServerGamePacketListenerImpl.this.send(new ClientboundSetEquipmentPacket(entity.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, allay.stripMeta(allay.getItemBySlot(slot), true))).collect(Collectors.toList()))); // Paper - remove unnecessary item meta
|
||||
player.containerMenu.sendAllDataToRemote();
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
|
|
|
@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public final Map<ResourceKey<Level>, ServerLevel> levels;
|
||||
private Map<ResourceKey<Level>, ServerLevel> levels;
|
||||
private PlayerList playerList;
|
||||
private volatile boolean running;
|
||||
+ private volatile boolean isRestarting = false; // Paper - flag to signify we're attempting to restart
|
||||
|
|
|
@ -14,10 +14,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
|
||||
worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
|
||||
+ this.levels.put(world.dimension(), world); // Paper - move up
|
||||
+ this.addLevel(world); // Paper - move up
|
||||
this.initWorld(world, worlddata, worldData, worlddata.worldGenSettings());
|
||||
|
||||
- this.levels.put(world.dimension(), world);
|
||||
- this.addLevel(world);
|
||||
+ // Paper - move up
|
||||
this.getPlayerList().addWorldborderListener(world);
|
||||
|
||||
|
@ -30,11 +30,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
return null;
|
||||
}
|
||||
|
||||
+ console.levels.put(internal.dimension(), internal); // Paper - move up
|
||||
+ this.console.addLevel(internal); // Paper - move up
|
||||
this.console.initWorld(internal, worlddata, worlddata, worlddata.worldGenSettings());
|
||||
|
||||
internal.setSpawnSettings(true, true);
|
||||
- console.levels.put(internal.dimension(), internal);
|
||||
- this.console.addLevel(internal);
|
||||
+ // Paper - move up
|
||||
|
||||
this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal);
|
||||
|
|
|
@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
||||
@Override
|
||||
public World createWorld(WorldCreator creator) {
|
||||
Preconditions.checkState(!console.levels.isEmpty(), "Cannot create additional worlds on STARTUP");
|
||||
Preconditions.checkState(this.console.getAllLevels().iterator().hasNext(), "Cannot create additional worlds on STARTUP");
|
||||
+ Preconditions.checkState(!this.console.isIteratingOverLevels, "Cannot create a world while worlds are being ticked"); // Paper
|
||||
Validate.notNull(creator, "Creator may not be null");
|
||||
|
||||
|
|
|
@ -31,13 +31,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
// Refresh the current entity metadata
|
||||
- ServerGamePacketListenerImpl.this.send(new ClientboundSetEntityDataPacket(entity.getId(), entity.getEntityData(), true));
|
||||
+ // Paper start - update entity for all players
|
||||
+ ClientboundSetEntityDataPacket packet1 = new ClientboundSetEntityDataPacket(entity.getId(), entity.getEntityData(), true);
|
||||
+ ClientboundSetEntityDataPacket entityDataPacket = new ClientboundSetEntityDataPacket(entity.getId(), entity.getEntityData(), true);
|
||||
+ if (entity.tracker != null) {
|
||||
+ entity.tracker.broadcast(packet1);
|
||||
+ entity.tracker.broadcast(entityDataPacket);
|
||||
+ } else {
|
||||
+ ServerGamePacketListenerImpl.this.send(packet1);
|
||||
+ ServerGamePacketListenerImpl.this.send(entityDataPacket);
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
// SPIGOT-7136 - Allays
|
||||
if (entity instanceof Allay) {
|
||||
ServerGamePacketListenerImpl.this.send(new ClientboundSetEquipmentPacket(entity.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, ((LivingEntity) entity).getItemBySlot(slot).copy())).collect(Collectors.toList())));
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit c379a6b4e421561edd6e1a62e2e4410f48bf1ab1
|
||||
Subproject commit ead719a65bf1202e32a4d81442a8bde1a62c07fd
|
|
@ -1 +1 @@
|
|||
Subproject commit 584b459dceac6e6f4708b70706671206d7a2c8ea
|
||||
Subproject commit 450dcaa86efd759674bbdeae0f6a37c97977618e
|
Loading…
Reference in a new issue