From 636439f61093b16c4242c48d1dcc83a8904349d1 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Tue, 3 Dec 2024 22:37:48 +0100 Subject: [PATCH] Fix jd gson version, move back mc util diff --- patches/api/Adventure.patch | 2 +- patches/api/Build-system-changes.patch | 2 +- patches/server/MC-Utils.patch | 31 ++++++++++ .../Moonrise-optimisation-patches.patch | 58 ------------------- 4 files changed, 33 insertions(+), 60 deletions(-) diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index 62802b6f08..c1c82e2368 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -65,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", // Paper - don't link to bungee chat // Paper start - add missing javadoc links "https://javadoc.io/doc/org.joml/joml/1.10.8/index.html", - "https://www.javadoc.io/doc/com.google.code.gson/gson/2.11.1", + "https://www.javadoc.io/doc/com.google.code.gson/gson/2.11.0", "https://jspecify.dev/docs/api/", // Paper end + // Paper start diff --git a/patches/api/Build-system-changes.patch b/patches/api/Build-system-changes.patch index 227710b61f..cd48481b33 100644 --- a/patches/api/Build-system-changes.patch +++ b/patches/api/Build-system-changes.patch @@ -46,7 +46,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", + // Paper start - add missing javadoc links + "https://javadoc.io/doc/org.joml/joml/1.10.8/index.html", -+ "https://www.javadoc.io/doc/com.google.code.gson/gson/2.11.1", ++ "https://www.javadoc.io/doc/com.google.code.gson/gson/2.11.0", + "https://jspecify.dev/docs/api/", + // Paper end ) diff --git a/patches/server/MC-Utils.patch b/patches/server/MC-Utils.patch index 0d507f4b6a..777179bc56 100644 --- a/patches/server/MC-Utils.patch +++ b/patches/server/MC-Utils.patch @@ -4477,6 +4477,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import com.mojang.datafixers.DSL; +import com.mojang.datafixers.DataFixer; +import com.mojang.serialization.Dynamic; ++import java.util.Collection; +import net.minecraft.core.BlockPos; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.NbtOps; @@ -4485,6 +4486,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.Entity; ++import net.minecraft.world.entity.boss.EnderDragonPart; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.ChunkPos; +import net.minecraft.world.level.Level; @@ -4569,12 +4571,41 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public void addToGetEntities(final Level world, final Entity entity, final AABB boundingBox, final Predicate predicate, final List into) { ++ final Collection parts = world.dragonParts(); ++ if (parts.isEmpty()) { ++ return; ++ } + ++ for (final EnderDragonPart part : parts) { ++ if (part != entity && part.getBoundingBox().intersects(boundingBox) && (predicate == null || predicate.test(part))) { ++ into.add(part); ++ } ++ } + } + + @Override + public void addToGetEntities(final Level world, final EntityTypeTest entityTypeTest, final AABB boundingBox, final Predicate predicate, final List into, final int maxCount) { ++ if (into.size() >= maxCount) { ++ // fix neoforge issue: do not add if list is already full ++ return; ++ } + ++ final Collection parts = world.dragonParts(); ++ if (parts.isEmpty()) { ++ return; ++ } ++ for (final EnderDragonPart part : parts) { ++ if (!part.getBoundingBox().intersects(boundingBox)) { ++ continue; ++ } ++ final T casted = (T)entityTypeTest.tryCast(part); ++ if (casted != null && (predicate == null || predicate.test(casted))) { ++ into.add(casted); ++ if (into.size() >= maxCount) { ++ break; ++ } ++ } ++ } + } + + @Override diff --git a/patches/server/Moonrise-optimisation-patches.patch b/patches/server/Moonrise-optimisation-patches.patch index 90b9d5abd9..3cbff59f84 100644 --- a/patches/server/Moonrise-optimisation-patches.patch +++ b/patches/server/Moonrise-optimisation-patches.patch @@ -382,64 +382,6 @@ diff --git a/src/main/java/ca/spottedleaf/moonrise/paper/PaperHooks.java b/src/m index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/ca/spottedleaf/moonrise/paper/PaperHooks.java +++ b/src/main/java/ca/spottedleaf/moonrise/paper/PaperHooks.java -@@ -0,0 +0,0 @@ import ca.spottedleaf.moonrise.common.PlatformHooks; - import com.mojang.datafixers.DSL; - import com.mojang.datafixers.DataFixer; - import com.mojang.serialization.Dynamic; -+import java.util.Collection; - import net.minecraft.core.BlockPos; - import net.minecraft.nbt.CompoundTag; - import net.minecraft.nbt.NbtOps; -@@ -0,0 +0,0 @@ import net.minecraft.server.level.GenerationChunkHolder; - import net.minecraft.server.level.ServerLevel; - import net.minecraft.server.level.ServerPlayer; - import net.minecraft.world.entity.Entity; -+import net.minecraft.world.entity.boss.EnderDragonPart; - import net.minecraft.world.level.BlockGetter; - import net.minecraft.world.level.ChunkPos; - import net.minecraft.world.level.Level; -@@ -0,0 +0,0 @@ public final class PaperHooks implements PlatformHooks { - - @Override - public void addToGetEntities(final Level world, final Entity entity, final AABB boundingBox, final Predicate predicate, final List into) { -+ final Collection parts = world.dragonParts(); -+ if (parts.isEmpty()) { -+ return; -+ } - -+ for (final EnderDragonPart part : parts) { -+ if (part != entity && part.getBoundingBox().intersects(boundingBox) && (predicate == null || predicate.test(part))) { -+ into.add(part); -+ } -+ } - } - - @Override - public void addToGetEntities(final Level world, final EntityTypeTest entityTypeTest, final AABB boundingBox, final Predicate predicate, final List into, final int maxCount) { -+ if (into.size() >= maxCount) { -+ // fix neoforge issue: do not add if list is already full -+ return; -+ } - -+ final Collection parts = world.dragonParts(); -+ if (parts.isEmpty()) { -+ return; -+ } -+ for (final EnderDragonPart part : parts) { -+ if (!part.getBoundingBox().intersects(boundingBox)) { -+ continue; -+ } -+ final T casted = (T)entityTypeTest.tryCast(part); -+ if (casted != null && (predicate == null || predicate.test(casted))) { -+ into.add(casted); -+ if (into.size() >= maxCount) { -+ break; -+ } -+ } -+ } - } - - @Override @@ -0,0 +0,0 @@ public final class PaperHooks implements PlatformHooks { @Override