mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-27 07:26:48 +01:00
Fresh loaded entities here!
- Remove loaded chunk check from entity instance manager
This commit is contained in:
parent
06454a713f
commit
738514b86b
1 changed files with 4 additions and 11 deletions
|
@ -6,9 +6,7 @@ import com.jozufozu.flywheel.backend.instancing.AbstractInstance;
|
||||||
import com.jozufozu.flywheel.backend.instancing.InstanceManager;
|
import com.jozufozu.flywheel.backend.instancing.InstanceManager;
|
||||||
import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry;
|
import com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.level.BlockGetter;
|
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
|
||||||
public class EntityInstanceManager extends InstanceManager<Entity> {
|
public class EntityInstanceManager extends InstanceManager<Entity> {
|
||||||
|
@ -29,18 +27,13 @@ public class EntityInstanceManager extends InstanceManager<Entity> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canCreateInstance(Entity entity) {
|
protected boolean canCreateInstance(Entity entity) {
|
||||||
if (!entity.isAlive()) return false;
|
if (!entity.isAlive()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Level world = entity.level;
|
Level world = entity.level;
|
||||||
|
|
||||||
if (Backend.isFlywheelWorld(world)) {
|
return Backend.isFlywheelWorld(world);
|
||||||
BlockPos pos = entity.blockPosition();
|
|
||||||
|
|
||||||
BlockGetter existingChunk = world.getChunkForCollisions(pos.getX() >> 4, pos.getZ() >> 4);
|
|
||||||
|
|
||||||
return existingChunk != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue