diff --git a/patches/server/Add-PlayerKickEvent-causes.patch b/patches/server/Add-PlayerKickEvent-causes.patch index c55c864e6b..949f82d4f0 100644 --- a/patches/server/Add-PlayerKickEvent-causes.patch +++ b/patches/server/Add-PlayerKickEvent-causes.patch @@ -127,6 +127,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit start - fire PlayerKickEvent if (this.processedDisconnect) { @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + Waitable waitable = new Waitable() { + @Override + protected Object evaluate() { +- ServerGamePacketListenerImpl.this.disconnect(reason); // Paper - adventure ++ ServerGamePacketListenerImpl.this.disconnect(reason, cause); // Paper - adventure, kick event cause + return null; + } + }; +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? this.player.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(this.player.getScoreboardName())); // Paper - Adventure diff --git a/patches/server/Add-TNTPrimeEvent.patch b/patches/server/Add-TNTPrimeEvent.patch index 3d64dcc597..4ae0742501 100644 --- a/patches/server/Add-TNTPrimeEvent.patch +++ b/patches/server/Add-TNTPrimeEvent.patch @@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } + // Paper start - TNTPrimeEvent + org.bukkit.block.Block tntBlock = level.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); -+ if(!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.EXPLOSION, explosionSource.getSourceMob().getBukkitEntity()).callEvent()) ++ if(!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.EXPLOSION, explosionSource.getIndirectSourceEntity().getBukkitEntity()).callEvent()) + continue; + // Paper end nmsBlock.wasExploded(level, blockposition, explosionSource); diff --git a/patches/server/Add-villager-reputation-API.patch b/patches/server/Add-villager-reputation-API.patch index f14af843be..d8fdecaedf 100644 --- a/patches/server/Add-villager-reputation-API.patch +++ b/patches/server/Add-villager-reputation-API.patch @@ -6,20 +6,12 @@ Subject: [PATCH] Add villager reputation API == AT == public net.minecraft.world.entity.ai.gossip.GossipContainer$EntityGossips public net.minecraft.world.entity.ai.gossip.GossipContainer$EntityGossips ()V +public net.minecraft.world.entity.ai.gossip.GossipContainer gossips diff --git a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java +++ b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java -@@ -0,0 +0,0 @@ import org.slf4j.Logger; - public class GossipContainer { - private static final Logger LOGGER = LogUtils.getLogger(); - public static final int DISCARD_THRESHOLD = 2; -- private final Map gossips = Maps.newHashMap(); -+ private final Map gossips = Maps.newHashMap(); public Map getReputations() { return this.gossips; } // Paper - add getter for reputations - - @VisibleForDebug - public Map> getGossipEntries() { @@ -0,0 +0,0 @@ public class GossipContainer { public void remove(GossipType gossipType) { this.entries.removeInt(gossipType); @@ -90,7 +82,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - Add villager reputation API + @Override + public Reputation getReputation(UUID uniqueId) { -+ net.minecraft.world.entity.ai.gossip.GossipContainer.EntityGossips rep = getHandle().getGossips().getReputations().get(uniqueId); ++ net.minecraft.world.entity.ai.gossip.GossipContainer.EntityGossips rep = getHandle().getGossips().gossips.get(uniqueId); + if (rep == null) { + return new Reputation(new java.util.EnumMap<>(com.destroystokyo.paper.entity.villager.ReputationType.class)); + } @@ -100,7 +92,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public Map getReputations() { -+ return getHandle().getGossips().getReputations().entrySet() ++ return getHandle().getGossips().gossips.entrySet() + .stream() + .collect(java.util.stream.Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().getPaperReputation())); + } @@ -108,7 +100,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Override + public void setReputation(UUID uniqueId, Reputation reputation) { + net.minecraft.world.entity.ai.gossip.GossipContainer.EntityGossips nmsReputation = -+ getHandle().getGossips().getReputations().computeIfAbsent( ++ getHandle().getGossips().gossips.computeIfAbsent( + uniqueId, + key -> new net.minecraft.world.entity.ai.gossip.GossipContainer.EntityGossips() + ); @@ -124,7 +116,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public void clearReputations() { -+ getHandle().getGossips().getReputations().clear(); ++ getHandle().getGossips().gossips.clear(); + } + // Paper end } diff --git a/patches/server/Fix-PotionSplashEvent-for-water-splash-potions.patch b/patches/server/Fix-PotionSplashEvent-for-water-splash-potions.patch index f488a39ec7..64f1efe89d 100644 --- a/patches/server/Fix-PotionSplashEvent-for-water-splash-potions.patch +++ b/patches/server/Fix-PotionSplashEvent-for-water-splash-potions.patch @@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } -+ private static final Predicate APPLY_WATER_GET_ENTITIES_PREDICATE = ThrownPotion.WATER_SENSITIVE.or(Axolotl.class::isInstance); // Paper ++ private static final Predicate APPLY_WATER_GET_ENTITIES_PREDICATE = ThrownPotion.WATER_SENSITIVE_OR_ON_FIRE.or(Axolotl.class::isInstance); // Paper private void applyWater() { AABB axisalignedbb = this.getBoundingBox().inflate(4.0D, 2.0D, 4.0D); - List list = this.level.getEntitiesOfClass(net.minecraft.world.entity.LivingEntity.class, axisalignedbb, ThrownPotion.WATER_SENSITIVE_OR_ON_FIRE); diff --git a/patches/server/Fix-curing-zombie-villager-discount-exploit.patch b/patches/server/Fix-curing-zombie-villager-discount-exploit.patch index 18ce09278c..ef550076ea 100644 --- a/patches/server/Fix-curing-zombie-villager-discount-exploit.patch +++ b/patches/server/Fix-curing-zombie-villager-discount-exploit.patch @@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (interaction == ReputationEventType.ZOMBIE_VILLAGER_CURED) { + // Paper start - fix MC-181190 + if (level.paperConfig().fixes.fixCuringZombieVillagerDiscountExploit) { -+ final GossipContainer.EntityGossips playerReputation = this.getGossips().getReputations().get(entity.getUUID()); ++ final GossipContainer.EntityGossips playerReputation = this.getGossips().gossips.get(entity.getUUID()); + if (playerReputation != null) { + playerReputation.remove(GossipType.MAJOR_POSITIVE); + playerReputation.remove(GossipType.MINOR_POSITIVE); diff --git a/patches/server/MC-Dev-fixes.patch b/patches/server/MC-Dev-fixes.patch index cd4cd90ab2..363279c168 100644 --- a/patches/server/MC-Dev-fixes.patch +++ b/patches/server/MC-Dev-fixes.patch @@ -144,6 +144,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 })); this.byName = Maps.newHashMap(builder.build()); // CraftBukkit RecipeManager.LOGGER.info("Loaded {} recipes", map1.size()); +diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java ++++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +@@ -0,0 +0,0 @@ public class PalettedContainer implements PaletteResize, PalettedContainer + } + + private static > Codec codec(IdMap idList, Codec entryCodec, PalettedContainer.Strategy provider, T defaultValue, PalettedContainerRO.Unpacker reader) { +- return RecordCodecBuilder.create((instance) -> { ++ return RecordCodecBuilder.>create((instance) -> { // Paper - decompile fix + return instance.group(entryCodec.mapResult(ExtraCodecs.orElsePartial(defaultValue)).listOf().fieldOf("palette").forGetter(PalettedContainerRO.PackedData::paletteEntries), Codec.LONG_STREAM.optionalFieldOf("data").forGetter(PalettedContainerRO.PackedData::storage)).apply(instance, PalettedContainerRO.PackedData::new); + }).comapFlatMap((serialized) -> { + return reader.read(idList, provider, serialized); diff --git a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java b/src/main/java/net/minecraft/world/level/entity/EntityLookup.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java diff --git a/patches/server/Remove-streams-from-classes-related-villager-gossip.patch b/patches/server/Remove-streams-from-classes-related-villager-gossip.patch index f164335d26..c0ae3bba9f 100644 --- a/patches/server/Remove-streams-from-classes-related-villager-gossip.patch +++ b/patches/server/Remove-streams-from-classes-related-villager-gossip.patch @@ -8,15 +8,6 @@ diff --git a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer. index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java +++ b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java -@@ -0,0 +0,0 @@ import org.slf4j.Logger; - public class GossipContainer { - private static final Logger LOGGER = LogUtils.getLogger(); - public static final int DISCARD_THRESHOLD = 2; -- private final Map gossips = Maps.newHashMap(); public Map getReputations() { return this.gossips; } // Paper - add getter for reputations -+ private final Map gossips = Maps.newHashMap(); - - @VisibleForDebug - public Map> getGossipEntries() { @@ -0,0 +0,0 @@ public class GossipContainer { }); }