Updated Hydrazine to 1.4.2

This commit is contained in:
themode 2020-09-01 21:16:07 +02:00
parent 78dd2cb005
commit e484e4a4d6
4 changed files with 21 additions and 7 deletions

View File

@ -110,7 +110,7 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok:1.18.12'
// Path finding
api 'com.github.MadMartian:hydrazine-path-finding:1.3.4'
api 'com.github.MadMartian:hydrazine-path-finding:1.4.2'
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
api 'com.github.jglrxavpok:Hephaistos:v1.0.5'

View File

@ -4,7 +4,10 @@ import net.minestom.server.MinecraftServer;
import net.minestom.server.command.CommandProcessor;
import net.minestom.server.command.CommandSender;
import net.minestom.server.entity.Player;
import net.minestom.server.instance.*;
import net.minestom.server.instance.ChunkGenerator;
import net.minestom.server.instance.ChunkPopulator;
import net.minestom.server.instance.InstanceContainer;
import net.minestom.server.instance.InstanceManager;
import net.minestom.server.instance.batch.ChunkBatch;
import net.minestom.server.world.DimensionType;
import net.minestom.server.world.biomes.Biome;
@ -55,8 +58,7 @@ public class SimpleCommand implements CommandProcessor {
instanceContainer.enableAutoChunkLoad(true);
instanceContainer.setChunkGenerator(chunkGeneratorDemo);
SharedInstance instance = instanceManager.createSharedInstance(instanceContainer);
sender.asPlayer().setInstance(instance);
sender.asPlayer().setInstance(instanceContainer);
System.out.println(MinecraftServer.getInstanceManager().getInstances().size());
System.gc();

View File

@ -1,7 +1,7 @@
package net.minestom.server.entity;
import com.extollit.gaming.ai.path.HydrazinePathFinder;
import com.extollit.gaming.ai.path.model.PathObject;
import com.extollit.gaming.ai.path.model.IPath;
import net.minestom.server.MinecraftServer;
import net.minestom.server.attribute.Attribute;
import net.minestom.server.entity.ai.GoalSelector;
@ -33,7 +33,7 @@ public abstract class EntityCreature extends LivingEntity {
private PFPathingEntity pathingEntity = new PFPathingEntity(this);
private HydrazinePathFinder pathFinder;
private PathObject path;
private IPath path;
private Position pathPosition;
protected List<GoalSelector> goalSelectors = new ArrayList<>();

View File

@ -1,6 +1,8 @@
package net.minestom.server.entity.pathfinding;
import com.extollit.gaming.ai.path.model.Gravitation;
import com.extollit.gaming.ai.path.model.IPathingEntity;
import com.extollit.gaming.ai.path.model.Passibility;
import com.extollit.linalg.immutable.Vec3d;
import net.minestom.server.attribute.Attribute;
import net.minestom.server.entity.EntityCreature;
@ -134,6 +136,16 @@ public class PFPathingEntity implements IPathingEntity {
return swimmer;
}
@Override
public boolean aquatic() {
return false;
}
@Override
public boolean avian() {
return false;
}
@Override
public boolean aquaphobic() {
return aquaphobic;
@ -152,7 +164,7 @@ public class PFPathingEntity implements IPathingEntity {
}
@Override
public void moveTo(Vec3d position) {
public void moveTo(Vec3d position, Passibility passibility, Gravitation gravitation) {
final float x = (float) position.x;
final float y = (float) position.y;
final float z = (float) position.z;