misc cleanup 2
This commit is contained in:
parent
fb7d729b11
commit
dbd1fb2aa2
@ -109,6 +109,8 @@ public interface IGameEventListener {
|
||||
* Runs before a outbound packet is sent
|
||||
*
|
||||
* @see NetworkManager#dispatchPacket(Packet, GenericFutureListener[])
|
||||
* @see Packet
|
||||
* @see GenericFutureListener
|
||||
*/
|
||||
void onSendPacket(PacketEvent event);
|
||||
|
||||
@ -116,6 +118,8 @@ public interface IGameEventListener {
|
||||
* Runs before an inbound packet is processed
|
||||
*
|
||||
* @see NetworkManager#dispatchPacket(Packet, GenericFutureListener[])
|
||||
* @see Packet
|
||||
* @see GenericFutureListener
|
||||
*/
|
||||
void onReceivePacket(PacketEvent event);
|
||||
|
||||
@ -140,6 +144,7 @@ public interface IGameEventListener {
|
||||
* Called when the local player dies, as indicated by the creation of the {@link GuiGameOver} screen.
|
||||
*
|
||||
* @see GuiGameOver(ITextComponent)
|
||||
* @see ITextComponent
|
||||
*/
|
||||
void onPlayerDeath();
|
||||
|
||||
|
@ -355,7 +355,7 @@ public final class PathingBehavior extends Behavior implements Helper {
|
||||
return;
|
||||
}
|
||||
|
||||
long start = System.nanoTime();
|
||||
//long start = System.nanoTime();
|
||||
|
||||
|
||||
PathExecutor current = this.current; // this should prevent most race conditions?
|
||||
@ -372,7 +372,7 @@ public final class PathingBehavior extends Behavior implements Helper {
|
||||
PathRenderer.drawPath(next.getPath(), 0, player(), partialTicks, Color.MAGENTA, Baritone.settings().fadePath.get(), 10, 20);
|
||||
}
|
||||
|
||||
long split = System.nanoTime();
|
||||
//long split = System.nanoTime();
|
||||
if (current != null) {
|
||||
PathRenderer.drawManySelectionBoxes(player(), current.toBreak(), partialTicks, Color.RED);
|
||||
PathRenderer.drawManySelectionBoxes(player(), current.toPlace(), partialTicks, Color.GREEN);
|
||||
@ -390,7 +390,7 @@ public final class PathingBehavior extends Behavior implements Helper {
|
||||
});
|
||||
});
|
||||
});
|
||||
long end = System.nanoTime();
|
||||
//long end = System.nanoTime();
|
||||
//System.out.println((end - split) + " " + (split - start));
|
||||
// if (end - start > 0) {
|
||||
// System.out.println("Frame took " + (split - start) + " " + (end - split));
|
||||
|
27
src/main/java/baritone/cache/ChunkPacker.java
vendored
27
src/main/java/baritone/cache/ChunkPacker.java
vendored
@ -42,24 +42,8 @@ public final class ChunkPacker implements Helper {
|
||||
|
||||
private ChunkPacker() {}
|
||||
|
||||
private static BitSet originalPacker(Chunk chunk) {
|
||||
BitSet bitSet = new BitSet(CachedChunk.SIZE);
|
||||
for (int y = 0; y < 256; y++) {
|
||||
for (int z = 0; z < 16; z++) {
|
||||
for (int x = 0; x < 16; x++) {
|
||||
int index = CachedChunk.getPositionIndex(x, y, z);
|
||||
IBlockState state = chunk.getBlockState(x, y, z);
|
||||
boolean[] bits = getPathingBlockType(state).getBits();
|
||||
bitSet.set(index, bits[0]);
|
||||
bitSet.set(index + 1, bits[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return bitSet;
|
||||
}
|
||||
|
||||
public static CachedChunk pack(Chunk chunk) {
|
||||
long start = System.nanoTime() / 1000000L;
|
||||
//long start = System.nanoTime() / 1000000L;
|
||||
|
||||
Map<String, List<BlockPos>> specialBlocks = new HashMap<>();
|
||||
BitSet bitSet = new BitSet(CachedChunk.SIZE);
|
||||
@ -100,18 +84,15 @@ public final class ChunkPacker implements Helper {
|
||||
}
|
||||
}
|
||||
}
|
||||
/*if (!bitSet.equals(originalPacker(chunk))) {
|
||||
throw new IllegalStateException();
|
||||
}*/
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//System.out.println("Packed special blocks: " + specialBlocks);
|
||||
long end = System.nanoTime() / 1000000L;
|
||||
//long end = System.nanoTime() / 1000000L;
|
||||
//System.out.println("Chunk packing took " + (end - start) + "ms for " + chunk.x + "," + chunk.z);
|
||||
String[] blockNames = new String[256];
|
||||
for (int z = 0; z < 16; z++) {
|
||||
https://www.ibm.com/developerworks/library/j-perry-writing-good-java-code/index.html
|
||||
https:
|
||||
//www.ibm.com/developerworks/library/j-perry-writing-good-java-code/index.html
|
||||
for (int x = 0; x < 16; x++) {
|
||||
for (int y = 255; y >= 0; y--) {
|
||||
int index = CachedChunk.getPositionIndex(x, y, z);
|
||||
|
Loading…
Reference in New Issue
Block a user