add defaults to switches
This commit is contained in:
parent
f25f264fd3
commit
3011b85aee
@ -19,9 +19,9 @@ package baritone.behavior;
|
||||
|
||||
import baritone.Baritone;
|
||||
import baritone.Settings;
|
||||
import baritone.api.behavior.Behavior;
|
||||
import baritone.api.event.events.PlayerUpdateEvent;
|
||||
import baritone.api.event.events.RotationMoveEvent;
|
||||
import baritone.api.behavior.Behavior;
|
||||
import baritone.utils.Helper;
|
||||
import baritone.utils.Rotation;
|
||||
|
||||
@ -89,6 +89,8 @@ public final class LookBehavior extends Behavior implements Helper {
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,10 +17,10 @@
|
||||
|
||||
package baritone.behavior;
|
||||
|
||||
import baritone.api.behavior.Behavior;
|
||||
import baritone.api.event.events.PacketEvent;
|
||||
import baritone.api.event.events.PlayerUpdateEvent;
|
||||
import baritone.api.event.events.type.EventState;
|
||||
import baritone.api.behavior.Behavior;
|
||||
import baritone.utils.Helper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.Packet;
|
||||
@ -94,8 +94,7 @@ public final class MemoryBehavior extends Behavior implements Helper {
|
||||
public void onReceivePacket(PacketEvent event) {
|
||||
Packet p = event.getPacket();
|
||||
|
||||
switch (event.getState()) {
|
||||
case PRE: {
|
||||
if (event.getState() == EventState.PRE) {
|
||||
if (p instanceof SPacketOpenWindow) {
|
||||
SPacketOpenWindow packet = event.cast();
|
||||
|
||||
@ -118,8 +117,6 @@ public final class MemoryBehavior extends Behavior implements Helper {
|
||||
if (p instanceof SPacketCloseWindow) {
|
||||
updateInventory();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,8 @@ import baritone.api.event.events.TickEvent;
|
||||
import baritone.pathing.calc.AStarPathFinder;
|
||||
import baritone.pathing.calc.AbstractNodeCostSearch;
|
||||
import baritone.pathing.calc.IPathFinder;
|
||||
import baritone.pathing.goals.*;
|
||||
import baritone.pathing.goals.Goal;
|
||||
import baritone.pathing.goals.GoalXZ;
|
||||
import baritone.pathing.movement.MovementHelper;
|
||||
import baritone.pathing.path.IPath;
|
||||
import baritone.pathing.path.PathExecutor;
|
||||
@ -163,6 +164,8 @@ public final class PathingBehavior extends Behavior implements Helper {
|
||||
case POST:
|
||||
mc.gameSettings.autoJump = lastAutoJump;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ import baritone.Baritone;
|
||||
import baritone.api.event.events.*;
|
||||
import baritone.api.event.events.type.EventState;
|
||||
import baritone.api.event.listener.IGameEventListener;
|
||||
import baritone.api.utils.interfaces.Toggleable;
|
||||
import baritone.cache.WorldProvider;
|
||||
import baritone.utils.BlockStateInterface;
|
||||
import baritone.utils.Helper;
|
||||
import baritone.utils.InputOverrideHandler;
|
||||
import baritone.api.utils.interfaces.Toggleable;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
@ -136,15 +136,11 @@ public final class GameEventHandler implements IGameEventListener, Helper {
|
||||
|
||||
BlockStateInterface.clearCachedChunk();
|
||||
|
||||
switch (event.getState()) {
|
||||
case PRE:
|
||||
break;
|
||||
case POST:
|
||||
if (event.getState() == EventState.POST) {
|
||||
cache.closeWorld();
|
||||
if (event.getWorld() != null) {
|
||||
cache.initWorld(event.getWorld());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
listeners.forEach(l -> {
|
||||
|
@ -130,9 +130,10 @@ public class MovementParkour extends Movement {
|
||||
return WALK_ONE_BLOCK_COST * 3;
|
||||
case 4:
|
||||
return SPRINT_ONE_BLOCK_COST * 4;
|
||||
}
|
||||
default:
|
||||
throw new IllegalStateException("LOL");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user