mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-02 05:02:10 -07: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:
@@ -2057,9 +2057,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
+import io.papermc.paper.adventure.ChatProcessor; // Paper
|
+import io.papermc.paper.adventure.ChatProcessor; // Paper
|
||||||
+import io.papermc.paper.adventure.PaperAdventure; // Paper
|
+import io.papermc.paper.adventure.PaperAdventure; // Paper
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import net.minecraft.network.chat.OutgoingPlayerChatMessage;
|
|
||||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||||
return this.server.isSingleplayerOwner(this.player.getGameProfile());
|
return this.server.isSingleplayerOwner(this.player.getGameProfile());
|
||||||
}
|
}
|
||||||
|
@@ -17,6 +17,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
// Paper end
|
// 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
|
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
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- 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
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/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
|
@@ -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 PlayerList playerList;
|
||||||
private volatile boolean running;
|
private volatile boolean running;
|
||||||
+ private volatile boolean isRestarting = false; // Paper - flag to signify we're attempting to restart
|
+ 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());
|
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.initWorld(world, worlddata, worldData, worlddata.worldGenSettings());
|
||||||
|
|
||||||
- this.levels.put(world.dimension(), world);
|
- this.addLevel(world);
|
||||||
+ // Paper - move up
|
+ // Paper - move up
|
||||||
this.getPlayerList().addWorldborderListener(world);
|
this.getPlayerList().addWorldborderListener(world);
|
||||||
|
|
||||||
@@ -30,11 +30,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
return null;
|
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());
|
this.console.initWorld(internal, worlddata, worlddata, worlddata.worldGenSettings());
|
||||||
|
|
||||||
internal.setSpawnSettings(true, true);
|
internal.setSpawnSettings(true, true);
|
||||||
- console.levels.put(internal.dimension(), internal);
|
- this.console.addLevel(internal);
|
||||||
+ // Paper - move up
|
+ // Paper - move up
|
||||||
|
|
||||||
this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal);
|
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 {
|
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
||||||
@Override
|
@Override
|
||||||
public World createWorld(WorldCreator creator) {
|
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
|
+ Preconditions.checkState(!this.console.isIteratingOverLevels, "Cannot create a world while worlds are being ticked"); // Paper
|
||||||
Validate.notNull(creator, "Creator may not be null");
|
Validate.notNull(creator, "Creator may not be null");
|
||||||
|
|
||||||
|
@@ -31,13 +31,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
// Refresh the current entity metadata
|
// Refresh the current entity metadata
|
||||||
- ServerGamePacketListenerImpl.this.send(new ClientboundSetEntityDataPacket(entity.getId(), entity.getEntityData(), true));
|
- ServerGamePacketListenerImpl.this.send(new ClientboundSetEntityDataPacket(entity.getId(), entity.getEntityData(), true));
|
||||||
+ // Paper start - update entity for all players
|
+ // 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) {
|
+ if (entity.tracker != null) {
|
||||||
+ entity.tracker.broadcast(packet1);
|
+ entity.tracker.broadcast(entityDataPacket);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ ServerGamePacketListenerImpl.this.send(packet1);
|
+ ServerGamePacketListenerImpl.this.send(entityDataPacket);
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
}
|
// SPIGOT-7136 - Allays
|
||||||
|
if (entity instanceof Allay) {
|
||||||
if (event.isCancelled()) {
|
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())));
|
||||||
|
Submodule work/CraftBukkit updated: c379a6b4e4...ead719a65b
Submodule work/Spigot updated: 584b459dce...450dcaa86e
Reference in New Issue
Block a user