Fix pathfinding + cleanup

This commit is contained in:
themode 2021-02-25 15:48:48 +01:00
parent a0d5ac12bc
commit e8e8022ec6
4 changed files with 11 additions and 22 deletions

View File

@ -845,7 +845,9 @@ public class Entity implements Viewable, EventHandler, DataContainer, Permission
* @param instance the new instance of the entity
* @throws NullPointerException if {@code instance} is null
* @throws IllegalStateException if {@code instance} has not been registered in {@link InstanceManager}
* @deprecated Use {@link Entity#setInstance(Instance, Position)} instead.
*/
@Deprecated
public void setInstance(@NotNull Instance instance) {
setInstance(instance, this.position);
}

View File

@ -69,15 +69,10 @@ public class EntityCreature extends LivingEntity implements NavigableEntity, Ent
}
@Override
public void setInstance(@NotNull Instance instance) {
public void setInstance(@NotNull Instance instance, @NotNull Position spawnPosition) {
this.navigator.setPathFinder(new HydrazinePathFinder(navigator.getPathingEntity(), instance.getInstanceSpace()));
super.setInstance(instance);
}
@Override
public void spawn() {
super.setInstance(instance, spawnPosition);
}
@Override

View File

@ -26,7 +26,6 @@ import net.minestom.server.utils.block.BlockIterator;
import net.minestom.server.utils.time.CooldownUtils;
import net.minestom.server.utils.time.TimeUnit;
import net.minestom.server.utils.time.UpdateOption;
import net.minestom.server.utils.validate.Check;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -250,11 +249,6 @@ public class LivingEntity extends Entity implements EquipmentHandler {
}
}
@Override
public void spawn() {
}
/**
* Gets the amount of arrows in the entity.
*

View File

@ -102,9 +102,7 @@ public class Metadata {
}
public static Value<NBT> NBT(@NotNull NBT nbt) {
return new Value<>(TYPE_NBT, nbt, writer -> {
writer.writeNBT("", nbt);
});
return new Value<>(TYPE_NBT, nbt, writer -> writer.writeNBT("", nbt));
}
public static Value<int[]> VillagerData(int villagerType,