19w38b WIP

This commit is contained in:
gnembon committed 2019-09-18 16:25:08 -03:00
1 parent be82935455
commit 59f2c8f958
31 files changed
+93 -74

No files matched your search

@@ -22,18 +22,18 @@ public abstract class EntityNavigation_pathfindingMixin
@Shadow @Final protected MobEntity entity;
@Shadow /*@Nullable*/ protected abstract Path findPathTo(Set<BlockPos> set_1, int int_1, boolean boolean_1, int int_2);
@Shadow /*@Nullable*/ protected abstract Path findPathToAny(Set<BlockPos> set_1, int int_1, boolean boolean_1, int int_2);
@Redirect(method = "findPathTo(Lnet/minecraft/util/math/BlockPos;I)Lnet/minecraft/entity/ai/pathing/Path;", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/entity/ai/pathing/EntityNavigation;findPathTo(Ljava/util/Set;IZI)Lnet/minecraft/entity/ai/pathing/Path;"
target = "Lnet/minecraft/entity/ai/pathing/EntityNavigation;findPathToAny(Ljava/util/Set;IZI)Lnet/minecraft/entity/ai/pathing/Path;"
))
private Path pathToBlock(EntityNavigation entityNavigation, Set<BlockPos> set_1, int int_1, boolean boolean_1, int int_2)
{
if (!LoggerRegistry.__pathfinding)
return findPathTo(set_1, int_1, boolean_1, int_2);
return findPathToAny(set_1, int_1, boolean_1, int_2);
long start = System.nanoTime();
Path path = findPathTo(set_1, int_1, boolean_1, int_2);
Path path = findPathToAny(set_1, int_1, boolean_1, int_2);
long finish = System.nanoTime();
float duration = (1.0F*((finish - start)/1000))/1000;
set_1.forEach(b -> PathfindingVisualizer.slowPath(entity, new Vec3d(b), duration, path != null));
@@ -42,14 +42,14 @@ public abstract class EntityNavigation_pathfindingMixin
@Redirect(method = "findPathTo(Lnet/minecraft/entity/Entity;I)Lnet/minecraft/entity/ai/pathing/Path;", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/entity/ai/pathing/EntityNavigation;findPathTo(Ljava/util/Set;IZI)Lnet/minecraft/entity/ai/pathing/Path;"
target = "Lnet/minecraft/entity/ai/pathing/EntityNavigation;findPathToAny(Ljava/util/Set;IZI)Lnet/minecraft/entity/ai/pathing/Path;"
))
private Path pathToEntity(EntityNavigation entityNavigation, Set<BlockPos> set_1, int int_1, boolean boolean_1, int int_2)
{
if (!LoggerRegistry.__pathfinding)
return findPathTo(set_1, int_1, boolean_1, int_2);
return findPathToAny(set_1, int_1, boolean_1, int_2);
long start = System.nanoTime();
Path path = findPathTo(set_1, int_1, boolean_1, int_2);
Path path = findPathToAny(set_1, int_1, boolean_1, int_2);
long finish = System.nanoTime();
float duration = (1.0F*((finish - start)/1000))/1000;
set_1.forEach(b -> PathfindingVisualizer.slowPath(entity, new Vec3d(b), duration, path != null));