diff --git a/build.gradle b/build.gradle index a2cbe5390..d872618cd 100644 --- a/build.gradle +++ b/build.gradle @@ -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' diff --git a/src/main/java/fr/themode/demo/commands/SimpleCommand.java b/src/main/java/fr/themode/demo/commands/SimpleCommand.java index 23d8b2e7a..61fbcc501 100644 --- a/src/main/java/fr/themode/demo/commands/SimpleCommand.java +++ b/src/main/java/fr/themode/demo/commands/SimpleCommand.java @@ -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(); diff --git a/src/main/java/net/minestom/server/entity/EntityCreature.java b/src/main/java/net/minestom/server/entity/EntityCreature.java index 6e04c2faa..781c5541d 100644 --- a/src/main/java/net/minestom/server/entity/EntityCreature.java +++ b/src/main/java/net/minestom/server/entity/EntityCreature.java @@ -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 goalSelectors = new ArrayList<>(); diff --git a/src/main/java/net/minestom/server/entity/pathfinding/PFPathingEntity.java b/src/main/java/net/minestom/server/entity/pathfinding/PFPathingEntity.java index 7d31be767..2392a18a5 100644 --- a/src/main/java/net/minestom/server/entity/pathfinding/PFPathingEntity.java +++ b/src/main/java/net/minestom/server/entity/pathfinding/PFPathingEntity.java @@ -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;