mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2026-01-04 15:41:38 +00:00
稍微减少冗余代码
This commit is contained in:
@@ -1,22 +1,17 @@
|
||||
package net.momirealms.craftengine.core.world;
|
||||
|
||||
import net.momirealms.craftengine.core.block.BlockStateWrapper;
|
||||
import net.momirealms.craftengine.core.entity.Entity;
|
||||
import net.momirealms.craftengine.core.entity.player.Player;
|
||||
import net.momirealms.craftengine.core.item.Item;
|
||||
import net.momirealms.craftengine.core.plugin.context.Context;
|
||||
import net.momirealms.craftengine.core.sound.SoundData;
|
||||
import net.momirealms.craftengine.core.sound.SoundSource;
|
||||
import net.momirealms.craftengine.core.util.Key;
|
||||
import net.momirealms.craftengine.core.world.collision.AABB;
|
||||
import net.momirealms.craftengine.core.world.particle.ParticleData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public interface World {
|
||||
|
||||
@@ -34,18 +29,6 @@ public interface World {
|
||||
|
||||
void setBlockAt(int x, int y, int z, BlockStateWrapper blockState, int flags);
|
||||
|
||||
List<Entity> getEntities(@Nullable Entity entity, AABB aabb, Predicate<? super Entity> predicate);
|
||||
|
||||
default List<Entity> getEntities(@Nullable Entity entity, AABB aabb) {
|
||||
Predicate<Entity> noSpectator = player -> {
|
||||
if (player instanceof Player) {
|
||||
return !((Player) player).isSpectatorMode();
|
||||
}
|
||||
return true;
|
||||
};
|
||||
return this.getEntities(entity, aabb, noSpectator);
|
||||
}
|
||||
|
||||
String name();
|
||||
|
||||
Path directory();
|
||||
|
||||
Reference in New Issue
Block a user