9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-21 15:59:26 +00:00
Files
SakuraMC/patches/server/0017-Add-utility-methods-to-EntitySlices.patch
Samsuik 90d5b445b2 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@3ea95ef Do not access world state to see if we can see a Player
PaperMC/Paper@71c84c8 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
PaperMC/Paper@e3bc4c4 Make debug mode print current configuration phase
PaperMC/Paper@d0ebfbb Fix corrupted plugin.yml breaking plugin loading (#10279)
PaperMC/Paper@681bbff Fix spawnreason saving
2024-02-26 17:34:05 +00:00

43 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samsuik <40902469+Samsuik@users.noreply.github.com>
Date: Thu, 3 Aug 2023 13:48:27 +0100
Subject: [PATCH] Add utility methods to EntitySlices
diff --git a/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java b/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
index 01701cdd0d984e35ff3453e6253ba9bcaa0db7b9..8fcaa00e461c7f4413bf655ddd8165a2b908f900 100644
--- a/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
+++ b/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
@@ -252,6 +252,12 @@ public final class ChunkEntitySlices {
return true;
}
+
+ // Sakura start
+ public Entity[] getSectionEntities(int sectionY) {
+ return this.allEntities.getSectionEntities(sectionY);
+ }
+ // Sakura end
public void getHardCollidingEntities(final Entity except, final AABB box, final List<Entity> into, final Predicate<? super Entity> predicate) {
this.hardCollidingEntities.getEntities(except, box, into, predicate);
@@ -430,6 +436,18 @@ public final class ChunkEntitySlices {
this.nonEmptyBitset[sectionIndex >>> 6] ^= (1L << (sectionIndex & (Long.SIZE - 1)));
}
}
+
+ // Sakura start
+ public Entity[] getSectionEntities(int sectionY) {
+ var list = entitiesBySection[sectionY - this.manager.minSection];
+
+ if (list != null) {
+ return list.storage;
+ }
+
+ return new Entity[0];
+ }
+ // Sakura end
public void getEntities(final Entity except, final AABB box, final List<Entity> into, final Predicate<? super Entity> predicate) {
if (this.count == 0) {