13
0
geforkt von Mirrors/Paper

1.20: Fix a bunch of compile issues (#9273)

Dieser Commit ist enthalten in:
Noah van der Aa 2023-06-08 01:21:20 +02:00
Ursprung ffc53909f5
Commit 0ec23e4426
10 geänderte Dateien mit 578 neuen und 645 gelöschten Zeilen

Datei anzeigen

@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
Player entityhuman = (Player) iterator.next(); Player entityhuman = (Player) iterator.next();
if (Phantom.this.canAttack(entityhuman, TargetingConditions.DEFAULT)) { if (Phantom.this.canAttack(entityhuman, TargetingConditions.DEFAULT)) {
+ if (!level.paperConfig().entities.behavior.phantomsOnlyAttackInsomniacs || EntitySelector.isInsomniac.test(entityhuman)) // Paper + if (!level().paperConfig().entities.behavior.phantomsOnlyAttackInsomniacs || EntitySelector.isInsomniac.test(entityhuman)) // Paper
Phantom.this.setTarget(entityhuman, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit - reason Phantom.this.setTarget(entityhuman, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit - reason
return true; return true;
} }

Datei anzeigen

@ -479,7 +479,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ final Set<Audience> viewers = event.viewers(); + final Set<Audience> viewers = event.viewers();
+ final ResourceKey<ChatType> chatTypeKey = renderer instanceof ChatRenderer.Default ? ChatType.CHAT : ChatType.RAW; + final ResourceKey<ChatType> chatTypeKey = renderer instanceof ChatRenderer.Default ? ChatType.CHAT : ChatType.RAW;
+ final ChatType.Bound chatType = ChatType.bind(chatTypeKey, this.player.level.registryAccess(), PaperAdventure.asVanilla(displayName(player))); + final ChatType.Bound chatType = ChatType.bind(chatTypeKey, this.player().level.registryAccess(), PaperAdventure.asVanilla(displayName(player)));
+ +
+ OutgoingChat outgoingChat = viewers instanceof LazyChatAudienceSet lazyAudienceSet && lazyAudienceSet.isLazy() ? new ServerOutgoingChat() : new ViewersOutgoingChat(); + OutgoingChat outgoingChat = viewers instanceof LazyChatAudienceSet lazyAudienceSet && lazyAudienceSet.isLazy() ? new ServerOutgoingChat() : new ViewersOutgoingChat();
+ /* if (this.flags.get(FORCE_PREVIEW_USE)) { // TODO (future, maybe?) + /* if (this.flags.get(FORCE_PREVIEW_USE)) { // TODO (future, maybe?)

Datei anzeigen

@ -45,7 +45,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (net.minecraft.server.level.ChunkMap.checkDupeUUID(level, entity)) { + if (net.minecraft.server.level.ChunkMap.checkDupeUUID(level, entity)) {
+ return; + return;
+ } + }
+ if (net.minecraft.world.level.Level.DEBUG_ENTITIES && ((Entity) entity).level.paperConfig().entities.spawning.duplicateUuid.mode != io.papermc.paper.configuration.WorldConfiguration.Entities.Spawning.DuplicateUUID.DuplicateUUIDMode.NOTHING) { + if (net.minecraft.world.level.Level.DEBUG_ENTITIES && ((Entity) entity).level().paperConfig().entities.spawning.duplicateUuid.mode != io.papermc.paper.configuration.WorldConfiguration.Entities.Spawning.DuplicateUUID.DuplicateUUIDMode.NOTHING) {
+ if (((Entity) entity).addedToWorldStack != null) { + if (((Entity) entity).addedToWorldStack != null) {
+ ((Entity) entity).addedToWorldStack.printStackTrace(); + ((Entity) entity).addedToWorldStack.printStackTrace();
+ } + }

Datei anzeigen

@ -76,7 +76,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
player.sentListPacket = true; player.sentListPacket = true;
+ player.supressTrackerForLogin = false; // Paper + player.supressTrackerForLogin = false; // Paper
+ ((ServerLevel)player.level).getChunkSource().chunkMap.addEntity(player); // Paper - track entity now + ((ServerLevel)player.level()).getChunkSource().chunkMap.addEntity(player); // Paper - track entity now
// CraftBukkit end // CraftBukkit end
player.getEntityData().refresh(player); // CraftBukkit - BungeeCord#2321, send complete data to self on spawn player.getEntityData().refresh(player); // CraftBukkit - BungeeCord#2321, send complete data to self on spawn

Datei anzeigen

@ -81,7 +81,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ @Override + @Override
+ public Level getNMSWorld() { + public Level getNMSWorld() {
+ return entity.getLevel(); + return entity.level();
+ } + }
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableBlockInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableBlockInventory.java diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableBlockInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableBlockInventory.java

Datei anzeigen

@ -76,7 +76,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ +
+ if (blockState == null) { + if (blockState == null) {
+ if (!(source instanceof net.minecraft.server.level.ServerPlayer) || source.level.paperConfig().chunks.preventMovingIntoUnloadedChunks) { + if (!(source instanceof net.minecraft.server.level.ServerPlayer) || source.level().paperConfig().chunks.preventMovingIntoUnloadedChunks) {
+ return Shapes.create(far ? source.getBoundingBox() : new AABB(new BlockPos(x, y, z))); + return Shapes.create(far ? source.getBoundingBox() : new AABB(new BlockPos(x, y, z)));
+ } + }
+ // Paper end + // Paper end

Datei anzeigen

@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - Optional prevent TNT from moving in water + // Paper start - Optional prevent TNT from moving in water
+ @Override + @Override
+ public boolean isPushedByFluid() { + public boolean isPushedByFluid() {
+ return !level.paperConfig().fixes.preventTntFromMovingInWater && super.isPushedByFluid(); + return !level().paperConfig().fixes.preventTntFromMovingInWater && super.isPushedByFluid();
+ } + }
+ // Paper end + // Paper end
} }

Datei anzeigen

@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void addEntity(Entity entity) { public void addEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot
+ // Paper start - ignore and warn about illegal addEntity calls instead of crashing server + // Paper start - ignore and warn about illegal addEntity calls instead of crashing server
+ if (!entity.valid || entity.level != this.level || this.entityMap.containsKey(entity.getId())) { + if (!entity.valid || entity.level() != this.level || this.entityMap.containsKey(entity.getId())) {
+ LOGGER.error("Illegal ChunkMap::addEntity for world " + this.level.getWorld().getName() + LOGGER.error("Illegal ChunkMap::addEntity for world " + this.level.getWorld().getName()
+ + ": " + entity + (this.entityMap.containsKey(entity.getId()) ? " ALREADY CONTAINED (This would have crashed your server)" : ""), new Throwable()); + + ": " + entity + (this.entityMap.containsKey(entity.getId()) ? " ALREADY CONTAINED (This would have crashed your server)" : ""), new Throwable());
+ return; + return;

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -4409,7 +4409,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ CraftPlayer player = (CraftPlayer) sender; + CraftPlayer player = (CraftPlayer) sender;
+ ServerPlayer handle = player.getHandle(); + ServerPlayer handle = player.getHandle();
+ ServerLevel world = (ServerLevel) handle.level; + ServerLevel world = (ServerLevel) handle.level();
+ ThreadedLevelLightEngine lightengine = world.getChunkSource().getLightEngine(); + ThreadedLevelLightEngine lightengine = world.getChunkSource().getLightEngine();
+ this.starlightFixLight(handle, world, lightengine, radius, post); + this.starlightFixLight(handle, world, lightengine, radius, post);
+ } + }