Fix jd gson version, move back mc util diff

This commit is contained in:
Nassim Jahnke 2024-12-03 22:37:48 +01:00
parent 6eb70d323b
commit 636439f610
4 changed files with 33 additions and 60 deletions

View file

@ -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

View file

@ -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
)

View file

@ -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<? super Entity> predicate, final List<Entity> into) {
+ final Collection<EnderDragonPart> 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 <T extends Entity> void addToGetEntities(final Level world, final EntityTypeTest<Entity, T> entityTypeTest, final AABB boundingBox, final Predicate<? super T> predicate, final List<? super T> into, final int maxCount) {
+ if (into.size() >= maxCount) {
+ // fix neoforge issue: do not add if list is already full
+ return;
+ }
+
+ final Collection<EnderDragonPart> 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

View file

@ -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<? super Entity> predicate, final List<Entity> into) {
+ final Collection<EnderDragonPart> 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 <T extends Entity> void addToGetEntities(final Level world, final EntityTypeTest<Entity, T> entityTypeTest, final AABB boundingBox, final Predicate<? super T> predicate, final List<? super T> into, final int maxCount) {
+ if (into.size() >= maxCount) {
+ // fix neoforge issue: do not add if list is already full
+ return;
+ }
+ final Collection<EnderDragonPart> 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