补充实体获取判断条件
This commit is contained in:
parent
1a691bc523
commit
82c30075f4
1 changed files with 2 additions and 2 deletions
|
@ -27,7 +27,7 @@ public abstract class LevelMixin {
|
||||||
public void getEntities(Entity pEntity, AABB pBoundingBox, Predicate<? super Entity> pPredicate, CallbackInfoReturnable<List<Entity>> cir) {
|
public void getEntities(Entity pEntity, AABB pBoundingBox, Predicate<? super Entity> pPredicate, CallbackInfoReturnable<List<Entity>> cir) {
|
||||||
if (pEntity instanceof ProjectileEntity) {
|
if (pEntity instanceof ProjectileEntity) {
|
||||||
this.getEntities().get(pBoundingBox.inflate(3), entity -> {
|
this.getEntities().get(pBoundingBox.inflate(3), entity -> {
|
||||||
if (entity instanceof OBBEntity obbEntity) {
|
if (entity instanceof OBBEntity obbEntity && pPredicate.test(entity)) {
|
||||||
for (OBB obb : obbEntity.getOBBs()) {
|
for (OBB obb : obbEntity.getOBBs()) {
|
||||||
if (OBB.isColliding(obb, pBoundingBox)) {
|
if (OBB.isColliding(obb, pBoundingBox)) {
|
||||||
if (!cir.getReturnValue().contains(entity)) {
|
if (!cir.getReturnValue().contains(entity)) {
|
||||||
|
@ -39,7 +39,7 @@ public abstract class LevelMixin {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.getEntities().get(pBoundingBox, entity -> {
|
this.getEntities().get(pBoundingBox, entity -> {
|
||||||
if (entity instanceof OBBEntity obbEntity) {
|
if (entity instanceof OBBEntity obbEntity && pPredicate.test(entity)) {
|
||||||
for (OBB obb : obbEntity.getOBBs()) {
|
for (OBB obb : obbEntity.getOBBs()) {
|
||||||
if (OBB.isColliding(obb, pBoundingBox)) {
|
if (OBB.isColliding(obb, pBoundingBox)) {
|
||||||
if (!cir.getReturnValue().contains(entity)) {
|
if (!cir.getReturnValue().contains(entity)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue