Skip to content

Commit

Permalink
Fix some comment issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Feb 17, 2024
1 parent 1d3fd04 commit 9bb6120
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -529,10 +529,10 @@ private SubscriptionSingleResult processParkourSubscription(

yield SubscriptionSingleResult.IMPOSSIBLE;
}
case PARKOUR_UNSAFE_TO_STAND_ON -> {
// We only want to jump over dangerous blocks/gaps
// So either a non-full-block like water or lava or magma
// since it hurts to stand on.
case PARKOUR_UNSAFE_TO_STAND_ON -> {
if (BlockTypeHelper.isSafeBlockToStandOn(blockState)) {
yield SubscriptionSingleResult.IMPOSSIBLE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ public SimpleMovement(MovementDirection direction, MovementSide side, MovementMo

this.cost =
(diagonal ? Costs.DIAGONAL : Costs.STRAIGHT)
+ switch (modifier) { // Add additional "discouraged" costs to prevent the bot from
// doing too much parkour
// Add additional "discouraged" costs to prevent the bot from
// doing too much parkour
+ switch (modifier) {
case NORMAL -> 0;
case FALL_1 -> Costs.FALL_1;
case FALL_2 -> Costs.FALL_2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ private void handleFMLPluginMessage(
var buffer = Unpooled.wrappedBuffer(pluginMessage.getData());
var discriminator = buffer.readByte();
switch (discriminator) {
// ServerHello
case 0 -> {
case 0 -> { // ServerHello
var fmlProtocolVersion = buffer.readByte();
var helper = botConnection.session().getCodecHelper();
if (fmlProtocolVersion > 1) {
Expand All @@ -120,39 +119,29 @@ private void handleFMLPluginMessage(
sendFMLClientHello(botConnection, fmlProtocolVersion);
sendFMLModList(botConnection, List.of());
}
// ModList
case 2 -> {
// WAITINGSERVERDATA
sendFMLHandshakeAck(botConnection, (byte) 2);
}
// RegistryData
case 3 -> {
case 2 -> // ModList
// WAITINGSERVERDATA
sendFMLHandshakeAck(botConnection, (byte) 2);
case 3 -> { // RegistryData
var hasMore = buffer.readBoolean();
if (!hasMore) {
// WAITINGSERVERCOMPLETE
sendFMLHandshakeAck(botConnection, (byte) 3);
}
}
// HandshakeAck
case -1 -> {
case -1 -> { // HandshakeAck
var phase = buffer.readByte();
switch (phase) {
// WAITINGCACK
case 2 -> {
// PENDINGCOMPLETE
sendFMLHandshakeAck(botConnection, (byte) 4);
}
// COMPLETE
case 3 -> {
// COMPLETE
sendFMLHandshakeAck(botConnection, (byte) 5);
}
case 2 -> // WAITINGCACK
// PENDINGCOMPLETE
sendFMLHandshakeAck(botConnection, (byte) 4);
case 3 -> // COMPLETE
// COMPLETE
sendFMLHandshakeAck(botConnection, (byte) 5);
}
}
// HandshakeReset
case -2 -> {
log.debug("FML handshake reset");
}
case -2 -> // HandshakeReset
log.debug("FML handshake reset");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public void handleTagData(Map<String, Map<String, int[]>> tags) {
case "minecraft:block" -> handleBlocks(registry.getValue());
case "minecraft:item" -> handleItems(registry.getValue());
case "minecraft:entity_type" -> handleEntities(registry.getValue());
// Ignore everything else, we just need these three for now
}
// Ignore everything else, we just need these three for now
}
}

Expand Down

0 comments on commit 9bb6120

Please sign in to comment.