decrease scan rate

This commit is contained in:
Leijurv 2018-09-04 15:33:38 -07:00
parent 69d8bd56fa
commit 2bb01fdd20
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -17,7 +17,7 @@
package baritone.behavior.impl; package baritone.behavior.impl;
import baritone.api.event.events.TickEvent; import baritone.api.event.events.PathEvent;
import baritone.behavior.Behavior; import baritone.behavior.Behavior;
import baritone.chunk.CachedChunk; import baritone.chunk.CachedChunk;
import baritone.chunk.ChunkPacker; import baritone.chunk.ChunkPacker;
@ -50,10 +50,11 @@ public class MineBehavior extends Behavior {
List<String> mining; List<String> mining;
@Override @Override
public void onTick(TickEvent event) { public void onPathEvent(PathEvent event) {
if (event.getType() == TickEvent.Type.OUT) { updateGoal();
return;
} }
public void updateGoal() {
if (mining == null) { if (mining == null) {
return; return;
} }
@ -100,6 +101,7 @@ public class MineBehavior extends Behavior {
public void mine(String... mining) { public void mine(String... mining) {
this.mining = mining == null || mining.length == 0 ? null : new ArrayList<>(Arrays.asList(mining)); this.mining = mining == null || mining.length == 0 ? null : new ArrayList<>(Arrays.asList(mining));
updateGoal();
} }
public void cancel() { public void cancel() {