mirror of
https://github.com/Samsuik/Sakura.git
synced 2026-01-06 15:41:49 +00:00
All source patches applied and starts
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
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/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||
index 1fad004f07270e8a27a85557de6fcf5e693751db..39148fe540d616cdd4d63c4d1a02b422cab0f6eb 100644
|
||||
--- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||
@@ -297,6 +297,12 @@ public final class ChunkEntitySlices {
|
||||
return true;
|
||||
}
|
||||
|
||||
+ // Sakura start - add utility methods to entity slices
|
||||
+ public Entity[] getSectionEntities(int sectionY) {
|
||||
+ return this.allEntities.getSectionEntities(sectionY);
|
||||
+ }
|
||||
+ // Sakura end - add utility methods to entity slices
|
||||
+
|
||||
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);
|
||||
}
|
||||
@@ -512,6 +518,18 @@ public final class ChunkEntitySlices {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Sakura start - add utility methods to entity slices
|
||||
+ public Entity[] getSectionEntities(int sectionY) {
|
||||
+ BasicEntityList<Entity> list = this.entitiesBySection[sectionY - this.slices.minSection];
|
||||
+
|
||||
+ if (list != null) {
|
||||
+ return list.storage;
|
||||
+ }
|
||||
+
|
||||
+ return new Entity[0];
|
||||
+ }
|
||||
+ // Sakura end - add utility methods to entity slices
|
||||
+
|
||||
public void getEntities(final Entity except, final AABB box, final List<Entity> into, final Predicate<? super Entity> predicate) {
|
||||
if (this.count == 0) {
|
||||
return;
|
||||
Reference in New Issue
Block a user