From ea9a831a7fbd963c7fc0ab1b45db256dbd848857 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sun, 29 May 2022 12:54:25 -0700 Subject: [PATCH] Update ForgeFlower (#7857) --- build.gradle.kts | 2 +- ...dition-of-entities-to-entity-ticklis.patch | 2 +- patches/server/Anti-Xray.patch | 2 +- patches/server/Fire-event-on-GS4-query.patch | 72 +++++++++---------- ...ix-swamp-hut-cat-generation-deadlock.patch | 2 +- .../Flat-bedrock-generator-settings.patch | 2 +- ...le-Oversized-Tile-Entities-in-chunks.patch | 2 +- ...single-and-multi-AABB-VoxelShapes-an.patch | 2 +- patches/server/Implement-TargetHitEvent.patch | 4 +- patches/server/MC-Dev-fixes.patch | 4 +- .../Optimize-Bit-Operations-by-inlining.patch | 2 +- ...from-classes-related-villager-gossip.patch | 2 +- 12 files changed, 49 insertions(+), 49 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 59a0a1abd6..5307f62687 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -63,7 +63,7 @@ repositories { dependencies { paramMappings("net.fabricmc:yarn:1.18.2+build.2:mergedv2") remapper("net.fabricmc:tiny-remapper:0.8.2:fat") - decompiler("net.minecraftforge:forgeflower:1.5.498.29") + decompiler("net.minecraftforge:forgeflower:1.5.605.7") spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.4") paperclip("io.papermc:paperclip:3.0.2") } diff --git a/patches/server/Allow-removal-addition-of-entities-to-entity-ticklis.patch b/patches/server/Allow-removal-addition-of-entities-to-entity-ticklis.patch index 8029d4bf43..61ade74f6b 100644 --- a/patches/server/Allow-removal-addition-of-entities-to-entity-ticklis.patch +++ b/patches/server/Allow-removal-addition-of-entities-to-entity-ticklis.patch @@ -28,7 +28,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - if (this.iterated == this.active) { - this.passive.clear(); - -- for(Entry entry : Int2ObjectMaps.fastIterable(this.active)) { +- for(Int2ObjectMap.Entry entry : Int2ObjectMaps.fastIterable(this.active)) { - this.passive.put(entry.getIntKey(), entry.getValue()); - } - diff --git a/patches/server/Anti-Xray.patch b/patches/server/Anti-Xray.patch index 0fbd59d3ae..845acc30d9 100644 --- a/patches/server/Anti-Xray.patch +++ b/patches/server/Anti-Xray.patch @@ -1064,7 +1064,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end this.heightmaps = new CompoundTag(); - for(Entry entry : chunk.getHeightmaps()) { + for(Map.Entry entry : chunk.getHeightmaps()) { @@ -0,0 +0,0 @@ public class ClientboundLevelChunkPacketData { } diff --git a/patches/server/Fire-event-on-GS4-query.patch b/patches/server/Fire-event-on-GS4-query.patch index 2b41e4d5be..042134a152 100644 --- a/patches/server/Fire-event-on-GS4-query.patch +++ b/patches/server/Fire-event-on-GS4-query.patch @@ -30,44 +30,44 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java +++ b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java @@ -0,0 +0,0 @@ public class QueryThreadGs4 extends GenericThread { - NetworkDataOutputStream networkDataOutputStream = new NetworkDataOutputStream(1460); - networkDataOutputStream.write(0); - networkDataOutputStream.writeBytes(this.getIdentBytes(packet.getSocketAddress())); -- networkDataOutputStream.writeString(this.serverName); + NetworkDataOutputStream networkDataOutputStream = new NetworkDataOutputStream(1460); + networkDataOutputStream.write(0); + networkDataOutputStream.writeBytes(this.getIdentBytes(packet.getSocketAddress())); +- networkDataOutputStream.writeString(this.serverName); + -+ com.destroystokyo.paper.event.server.GS4QueryEvent.QueryType queryType = -+ com.destroystokyo.paper.event.server.GS4QueryEvent.QueryType.BASIC; -+ com.destroystokyo.paper.event.server.GS4QueryEvent.QueryResponse queryResponse = com.destroystokyo.paper.event.server.GS4QueryEvent.QueryResponse.builder() -+ .motd(this.serverName) -+ .map(this.worldName) -+ .currentPlayers(this.serverInterface.getPlayerCount()) -+ .maxPlayers(this.maxPlayers) -+ .port(this.serverPort) -+ .hostname(this.hostIp) -+ .gameVersion(this.serverInterface.getServerVersion()) -+ .serverVersion(org.bukkit.Bukkit.getServer().getName() + " on " + org.bukkit.Bukkit.getServer().getBukkitVersion()) -+ .build(); -+ com.destroystokyo.paper.event.server.GS4QueryEvent queryEvent = -+ new com.destroystokyo.paper.event.server.GS4QueryEvent(queryType, packet.getAddress(), queryResponse); -+ queryEvent.callEvent(); -+ queryResponse = queryEvent.getResponse(); ++ com.destroystokyo.paper.event.server.GS4QueryEvent.QueryType queryType = ++ com.destroystokyo.paper.event.server.GS4QueryEvent.QueryType.BASIC; ++ com.destroystokyo.paper.event.server.GS4QueryEvent.QueryResponse queryResponse = com.destroystokyo.paper.event.server.GS4QueryEvent.QueryResponse.builder() ++ .motd(this.serverName) ++ .map(this.worldName) ++ .currentPlayers(this.serverInterface.getPlayerCount()) ++ .maxPlayers(this.maxPlayers) ++ .port(this.serverPort) ++ .hostname(this.hostIp) ++ .gameVersion(this.serverInterface.getServerVersion()) ++ .serverVersion(org.bukkit.Bukkit.getServer().getName() + " on " + org.bukkit.Bukkit.getServer().getBukkitVersion()) ++ .build(); ++ com.destroystokyo.paper.event.server.GS4QueryEvent queryEvent = ++ new com.destroystokyo.paper.event.server.GS4QueryEvent(queryType, packet.getAddress(), queryResponse); ++ queryEvent.callEvent(); ++ queryResponse = queryEvent.getResponse(); + -+ networkDataOutputStream.writeString(queryResponse.getMotd()); - networkDataOutputStream.writeString("SMP"); -- networkDataOutputStream.writeString(this.worldName); -- networkDataOutputStream.writeString(Integer.toString(this.serverInterface.getPlayerCount())); -- networkDataOutputStream.writeString(Integer.toString(this.maxPlayers)); -- networkDataOutputStream.writeShort((short)this.serverPort); -- networkDataOutputStream.writeString(this.hostIp); -+ networkDataOutputStream.writeString(queryResponse.getMap()); -+ networkDataOutputStream.writeString(Integer.toString(queryResponse.getCurrentPlayers())); -+ networkDataOutputStream.writeString(Integer.toString(queryResponse.getMaxPlayers())); -+ networkDataOutputStream.writeShort((short) queryResponse.getPort()); -+ networkDataOutputStream.writeString(queryResponse.getHostname()); -+ // Paper end - this.sendTo(networkDataOutputStream.toByteArray(), packet); - LOGGER.debug("Status [{}]", (Object)socketAddress); - } ++ networkDataOutputStream.writeString(queryResponse.getMotd()); + networkDataOutputStream.writeString("SMP"); +- networkDataOutputStream.writeString(this.worldName); +- networkDataOutputStream.writeString(Integer.toString(this.serverInterface.getPlayerCount())); +- networkDataOutputStream.writeString(Integer.toString(this.maxPlayers)); +- networkDataOutputStream.writeShort((short)this.serverPort); +- networkDataOutputStream.writeString(this.hostIp); ++ networkDataOutputStream.writeString(queryResponse.getMap()); ++ networkDataOutputStream.writeString(Integer.toString(queryResponse.getCurrentPlayers())); ++ networkDataOutputStream.writeString(Integer.toString(queryResponse.getMaxPlayers())); ++ networkDataOutputStream.writeShort((short) queryResponse.getPort()); ++ networkDataOutputStream.writeString(queryResponse.getHostname()); ++ // Paper end + this.sendTo(networkDataOutputStream.toByteArray(), packet); + LOGGER.debug("Status [{}]", (Object)socketAddress); + } @@ -0,0 +0,0 @@ public class QueryThreadGs4 extends GenericThread { this.rulesResponse.writeString("splitnum"); this.rulesResponse.write(128); diff --git a/patches/server/Fix-swamp-hut-cat-generation-deadlock.patch b/patches/server/Fix-swamp-hut-cat-generation-deadlock.patch index c982e3698c..d1f2ee8104 100644 --- a/patches/server/Fix-swamp-hut-cat-generation-deadlock.patch +++ b/patches/server/Fix-swamp-hut-cat-generation-deadlock.patch @@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public List startsForFeature(SectionPos sectionPos, ConfiguredStructureFeature configuredStructureFeature, ServerLevelAccessor world) { + LongSet longSet = (world == null ? this.level : world).getChunk(sectionPos.x(), sectionPos.z(), ChunkStatus.STRUCTURE_REFERENCES).getReferencesForFeature(configuredStructureFeature); + // Paper end - add world option - Builder builder = ImmutableList.builder(); + ImmutableList.Builder builder = ImmutableList.builder(); this.fillStartsForFeature(configuredStructureFeature, longSet, builder::add); return builder.build(); @@ -0,0 +0,0 @@ public class StructureFeatureManager { diff --git a/patches/server/Flat-bedrock-generator-settings.patch b/patches/server/Flat-bedrock-generator-settings.patch index de448ae4e7..3ffcc6045a 100644 --- a/patches/server/Flat-bedrock-generator-settings.patch +++ b/patches/server/Flat-bedrock-generator-settings.patch @@ -92,7 +92,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 SurfaceRules.ConditionSource conditionSource2 = SurfaceRules.yBlockCheck(VerticalAnchor.absolute(256), 0); @@ -0,0 +0,0 @@ public class SurfaceRuleData { SurfaceRules.RuleSource ruleSource9 = SurfaceRules.sequence(SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR, SurfaceRules.sequence(SurfaceRules.ifTrue(SurfaceRules.isBiome(Biomes.WOODED_BADLANDS), SurfaceRules.ifTrue(conditionSource, SurfaceRules.sequence(SurfaceRules.ifTrue(conditionSource15, COARSE_DIRT), SurfaceRules.ifTrue(conditionSource16, COARSE_DIRT), SurfaceRules.ifTrue(conditionSource17, COARSE_DIRT), ruleSource))), SurfaceRules.ifTrue(SurfaceRules.isBiome(Biomes.SWAMP), SurfaceRules.ifTrue(conditionSource5, SurfaceRules.ifTrue(SurfaceRules.not(conditionSource6), SurfaceRules.ifTrue(SurfaceRules.noiseCondition(Noises.SWAMP, 0.0D), WATER)))))), SurfaceRules.ifTrue(SurfaceRules.isBiome(Biomes.BADLANDS, Biomes.ERODED_BADLANDS, Biomes.WOODED_BADLANDS), SurfaceRules.sequence(SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR, SurfaceRules.sequence(SurfaceRules.ifTrue(conditionSource2, ORANGE_TERRACOTTA), SurfaceRules.ifTrue(conditionSource4, SurfaceRules.sequence(SurfaceRules.ifTrue(conditionSource15, TERRACOTTA), SurfaceRules.ifTrue(conditionSource16, TERRACOTTA), SurfaceRules.ifTrue(conditionSource17, TERRACOTTA), SurfaceRules.bandlands())), SurfaceRules.ifTrue(conditionSource7, SurfaceRules.sequence(SurfaceRules.ifTrue(SurfaceRules.ON_CEILING, RED_SANDSTONE), RED_SAND)), SurfaceRules.ifTrue(SurfaceRules.not(conditionSource10), ORANGE_TERRACOTTA), SurfaceRules.ifTrue(conditionSource9, WHITE_TERRACOTTA), ruleSource3)), SurfaceRules.ifTrue(conditionSource3, SurfaceRules.sequence(SurfaceRules.ifTrue(conditionSource6, SurfaceRules.ifTrue(SurfaceRules.not(conditionSource4), ORANGE_TERRACOTTA)), SurfaceRules.bandlands())), SurfaceRules.ifTrue(SurfaceRules.UNDER_FLOOR, SurfaceRules.ifTrue(conditionSource9, WHITE_TERRACOTTA)))), SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR, SurfaceRules.ifTrue(conditionSource7, SurfaceRules.sequence(SurfaceRules.ifTrue(conditionSource11, SurfaceRules.ifTrue(conditionSource10, SurfaceRules.sequence(SurfaceRules.ifTrue(conditionSource8, AIR), SurfaceRules.ifTrue(SurfaceRules.temperature(), ICE), WATER))), ruleSource8))), SurfaceRules.ifTrue(conditionSource9, SurfaceRules.sequence(SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR, SurfaceRules.ifTrue(conditionSource11, SurfaceRules.ifTrue(conditionSource10, WATER))), SurfaceRules.ifTrue(SurfaceRules.UNDER_FLOOR, ruleSource7), SurfaceRules.ifTrue(conditionSource13, SurfaceRules.ifTrue(SurfaceRules.DEEP_UNDER_FLOOR, SANDSTONE)), SurfaceRules.ifTrue(conditionSource14, SurfaceRules.ifTrue(SurfaceRules.VERY_DEEP_UNDER_FLOOR, SANDSTONE)))), SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR, SurfaceRules.sequence(SurfaceRules.ifTrue(SurfaceRules.isBiome(Biomes.FROZEN_PEAKS, Biomes.JAGGED_PEAKS), STONE), SurfaceRules.ifTrue(SurfaceRules.isBiome(Biomes.WARM_OCEAN, Biomes.LUKEWARM_OCEAN, Biomes.DEEP_LUKEWARM_OCEAN), ruleSource2), ruleSource3))); - Builder builder = ImmutableList.builder(); + ImmutableList.Builder builder = ImmutableList.builder(); if (bedrockRoof) { - builder.add(SurfaceRules.ifTrue(SurfaceRules.not(SurfaceRules.verticalGradient("bedrock_roof", VerticalAnchor.belowTop(5), VerticalAnchor.top())), BEDROCK)); + builder.add(SurfaceRules.ifTrue(SurfaceRules.not(new PaperBedrockConditionSource("bedrock_roof", VerticalAnchor.belowTop(5), VerticalAnchor.top(), true)), BEDROCK)); // Paper diff --git a/patches/server/Handle-Oversized-Tile-Entities-in-chunks.patch b/patches/server/Handle-Oversized-Tile-Entities-in-chunks.patch index 9c0b1578d9..638d5681dc 100644 --- a/patches/server/Handle-Oversized-Tile-Entities-in-chunks.patch +++ b/patches/server/Handle-Oversized-Tile-Entities-in-chunks.patch @@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.blockEntitiesData = Lists.newArrayList(); + int totalTileEntities = 0; // Paper - for(Entry entry2 : chunk.getBlockEntities().entrySet()) { + for(Map.Entry entry2 : chunk.getBlockEntities().entrySet()) { + // Paper start + if (++totalTileEntities > TE_LIMIT) { + var packet = entry2.getValue().getUpdatePacket(); diff --git a/patches/server/Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch b/patches/server/Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch index ac1d30249c..5b14cbbe0d 100644 --- a/patches/server/Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch +++ b/patches/server/Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch @@ -1751,7 +1751,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override @@ -0,0 +0,0 @@ public class ArrayVoxelShape extends VoxelShape { - throw new IllegalArgumentException(); + throw new IllegalArgumentException(); } } + diff --git a/patches/server/Implement-TargetHitEvent.patch b/patches/server/Implement-TargetHitEvent.patch index 3b94d70401..b8c9f4da01 100644 --- a/patches/server/Implement-TargetHitEvent.patch +++ b/patches/server/Implement-TargetHitEvent.patch @@ -17,8 +17,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + private static void awardTargetHitCriteria(Projectile projectile, BlockHitResult hit, int i) { + // Paper end Entity entity = projectile.getOwner(); - if (entity instanceof ServerPlayer) { - ServerPlayer serverPlayer = (ServerPlayer)entity; + if (entity instanceof ServerPlayer serverPlayer) { + serverPlayer.awardStat(Stats.TARGET_HIT); @@ -0,0 +0,0 @@ public class TargetBlock extends Block { private static int updateRedstoneOutput(LevelAccessor world, BlockState state, BlockHitResult hitResult, Entity entity) { int i = getRedstoneStrength(hitResult, hitResult.getLocation()); diff --git a/patches/server/MC-Dev-fixes.patch b/patches/server/MC-Dev-fixes.patch index b7604ea5f5..28657bb557 100644 --- a/patches/server/MC-Dev-fixes.patch +++ b/patches/server/MC-Dev-fixes.patch @@ -11,9 +11,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class Util { } - public static Strategy identityStrategy() { + public static Hash.Strategy identityStrategy() { - return Util.IdentityStrategy.INSTANCE; -+ return (Strategy) Util.IdentityStrategy.INSTANCE; // Paper - decompile fix ++ return (Hash.Strategy) Util.IdentityStrategy.INSTANCE; // Paper - decompile fix } public static CompletableFuture> sequence(List> futures) { diff --git a/patches/server/Optimize-Bit-Operations-by-inlining.patch b/patches/server/Optimize-Bit-Operations-by-inlining.patch index 87ba1931d5..2b6ccba107 100644 --- a/patches/server/Optimize-Bit-Operations-by-inlining.patch +++ b/patches/server/Optimize-Bit-Operations-by-inlining.patch @@ -210,4 +210,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return betweenClosedStream(center.x - radius, 0, center.z - radius, center.x + radius, 15, center.z + radius); // Paper - simplify/inline } - public static Stream betweenClosedStream(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) { + public static Stream betweenClosedStream(final int minX, final int minY, final int minZ, final int maxX, final int maxY, final int maxZ) { 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 34dd4b2c8c..953198eab2 100644 --- a/patches/server/Remove-streams-from-classes-related-villager-gossip.patch +++ b/patches/server/Remove-streams-from-classes-related-villager-gossip.patch @@ -14,8 +14,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; // Paper import it.unimi.dsi.fastutil.objects.ObjectIterator; - import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry; import java.util.Arrays; + import java.util.Collection; @@ -0,0 +0,0 @@ public class GossipContainer { }); }