Remove some benchmarking and fix loading of settings.
This commit is contained in:
parent
af1eb58bb8
commit
2dad6262cf
@ -1305,8 +1305,10 @@ public final class Settings {
|
||||
|
||||
public void set(T value) {
|
||||
this.value = value;
|
||||
if (BaritoneAPI.getProvider() != null) {
|
||||
BaritoneAPI.getProvider().getAllBaritones().forEach(iBaritone -> iBaritone.getGameEventHandler().onSettingChanged(new SettingChangedEvent(this)));
|
||||
}
|
||||
}
|
||||
|
||||
public final String getName() {
|
||||
return name;
|
||||
|
@ -149,6 +149,7 @@ public class PrecomputedData { // TODO add isFullyPassable
|
||||
try { // A dodgy catch-all at the end, for most blocks with default behaviour this will work, however where blocks are special this will error out, and we can handle it when we have this information
|
||||
return Optional.of(block.isPassable(null, null));
|
||||
} catch (NullPointerException exception) {
|
||||
System.out.println("Error");
|
||||
return Optional.empty();
|
||||
}
|
||||
}, (bsi, x, y, z, blockState) -> {
|
||||
@ -181,10 +182,6 @@ public class PrecomputedData { // TODO add isFullyPassable
|
||||
return block.isPassable(bsi.access, bsi.isPassableBlockPos.setPos(x, y, z));
|
||||
});
|
||||
|
||||
long endTime = System.nanoTime();
|
||||
|
||||
System.out.println(endTime - startTime);
|
||||
Thread.dumpStack();
|
||||
}
|
||||
|
||||
public boolean canWalkOn(BlockStateInterface bsi, int x, int y, int z, IBlockState state) {
|
||||
@ -223,15 +220,7 @@ public class PrecomputedData { // TODO add isFullyPassable
|
||||
* Refresh the precomputed data, for use when settings have changed etc.
|
||||
*/
|
||||
public void refresh() {
|
||||
long startTime = System.nanoTime();
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
canWalkThrough.refresh();
|
||||
canWalkOn.refresh();
|
||||
}
|
||||
|
||||
long endTime = System.nanoTime();
|
||||
|
||||
System.out.println(endTime - startTime);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user