+14
-2
src/main/java/com/github/puregero/minecraftstresstest/Bot.java
+14
-2
src/main/java/com/github/puregero/minecraftstresstest/Bot.java
···
32
private float yaw = 0;
33
34
private boolean goUp = false;
35
36
public Bot(String username, String address, int port) {
37
this.username = username;
···
132
if (goUp) {
133
y += 0.1;
134
goUp = Math.random() < 0.98;
135
} else {
136
if (Math.max(Math.abs(x), Math.abs(z)) > RADIUS) {
137
double tx = Math.random() * RADIUS * 2 - RADIUS;
···
189
}
190
191
// Try going up to go over the block, or turn around and go a different way
192
-
goUp = Math.random() < 0.5;
193
-
if (!goUp) yaw = (float) (Math.random() * 360);
194
195
FriendlyByteBuf teleportConfirmPacket = new FriendlyByteBuf(ctx.alloc().buffer());
196
teleportConfirmPacket.writeVarInt(0x00);
···
32
private float yaw = 0;
33
34
private boolean goUp = false;
35
+
private boolean goDown = false;
36
37
public Bot(String username, String address, int port) {
38
this.username = username;
···
133
if (goUp) {
134
y += 0.1;
135
goUp = Math.random() < 0.98;
136
+
} else if (goDown) {
137
+
y -= 0.1;
138
+
goDown = Math.random() < 0.98;
139
} else {
140
if (Math.max(Math.abs(x), Math.abs(z)) > RADIUS) {
141
double tx = Math.random() * RADIUS * 2 - RADIUS;
···
193
}
194
195
// Try going up to go over the block, or turn around and go a different way
196
+
if (goDown) {
197
+
goDown = false;
198
+
} else if (!goUp) {
199
+
goUp = true;
200
+
} else {
201
+
// We hit our head on something
202
+
goUp = false;
203
+
goDown = Math.random() < 0.5;
204
+
if (!goDown) yaw = (float) (Math.random() * 360);
205
+
}
206
207
FriendlyByteBuf teleportConfirmPacket = new FriendlyByteBuf(ctx.alloc().buffer());
208
teleportConfirmPacket.writeVarInt(0x00);