Skip to content

Commit

Permalink
Clean out debug logging statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Camotoy committed Oct 30, 2024
1 parent 8ba70f0 commit c34b4b3
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import org.cloudburstmc.protocol.bedrock.packet.MovePlayerPacket;
import org.cloudburstmc.protocol.bedrock.packet.NetworkSettingsPacket;
import org.cloudburstmc.protocol.bedrock.packet.PlayStatusPacket;
import org.cloudburstmc.protocol.bedrock.packet.PlayerAuthInputPacket;
import org.cloudburstmc.protocol.bedrock.packet.RequestNetworkSettingsPacket;
import org.cloudburstmc.protocol.bedrock.packet.ResourcePackChunkDataPacket;
import org.cloudburstmc.protocol.bedrock.packet.ResourcePackChunkRequestPacket;
Expand All @@ -65,7 +64,6 @@
import org.geysermc.geyser.registry.Registries;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.session.PendingMicrosoftAuthentication;
import org.geysermc.geyser.text.ChatColor;
import org.geysermc.geyser.text.GeyserLocale;
import org.geysermc.geyser.util.LoginEncryptionUtils;
import org.geysermc.geyser.util.MathUtils;
Expand Down Expand Up @@ -96,11 +94,6 @@ public UpstreamPacketHandler(GeyserImpl geyser, GeyserSession session) {
}

private PacketSignal translateAndDefault(BedrockPacket packet) {
if (packet instanceof PlayerAuthInputPacket) {
//System.out.println(packet);
} else {
System.out.println(ChatColor.toANSI(ChatColor.GREEN) + packet + ChatColor.ANSI_RESET);
}
Registries.BEDROCK_PACKET_TRANSLATORS.translate(packet.getClass(), packet, session);
return PacketSignal.HANDLED; // PacketSignal.UNHANDLED will log a WARN publicly
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,9 @@

@Translator(packet = PlayerAuthInputPacket.class)
public final class BedrockPlayerAuthInputTranslator extends PacketTranslator<PlayerAuthInputPacket> {
private Set<PlayerAuthInputData> data = Set.of();

@Override
public void translate(GeyserSession session, PlayerAuthInputPacket packet) {
if (!data.equals(packet.getInputData())) {
System.out.println(packet.getInputData());
this.data = packet.getInputData();
}
SessionPlayerEntity entity = session.getPlayerEntity();

boolean wasJumping = session.getInputCache().wasJumping();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public class JavaRecipeBookAddTranslator extends PacketTranslator<ClientboundRec

@Override
public void translate(GeyserSession session, ClientboundRecipeBookAddPacket packet) {
System.out.println(packet);
int netId = session.getLastRecipeNetId().get();
Int2ObjectMap<List<String>> javaToBedrockRecipeIds = session.getJavaToBedrockRecipeIds();
Int2ObjectMap<GeyserRecipe> geyserRecipes = session.getCraftingRecipes();
Expand Down Expand Up @@ -179,12 +178,10 @@ public void translate(GeyserSession session, ClientboundRecipeBookAddPacket pack
}
javaToBedrockRecipeIds.put(contents.id(), bedrockRecipeIds);
session.getSmithingRecipes().add(new GeyserSmithingRecipe(smithingRecipe));
System.out.println(new GeyserSmithingRecipe(smithingRecipe));
}
}
}

//System.out.println(craftingDataPacket);
session.sendUpstreamPacket(craftingDataPacket);
session.sendUpstreamPacket(recipesPacket);
session.getLastRecipeNetId().set(netId);
Expand Down Expand Up @@ -301,7 +298,6 @@ private Pair<List<List<ItemDescriptorWithCount>>, ItemData> combinations(GeyserS
}

if (complexInputs) {
System.out.println(inputs);
long size = 1;
// See how big a cartesian product will get without creating one (Guava throws an error; not really ideal)
for (List<ItemDescriptorWithCount> list : inputs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundUpdateRecipesPacket.SelectableRecipe;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import java.util.stream.Collectors;

/**
* Used to send all valid recipes from Java to Bedrock.
Expand Down Expand Up @@ -103,7 +101,6 @@ public class JavaUpdateRecipesTranslator extends PacketTranslator<ClientboundUpd
public void translate(GeyserSession session, ClientboundUpdateRecipesPacket packet) {
int netId = session.getLastRecipeNetId().get();
CraftingDataPacket craftingDataPacket = new CraftingDataPacket();
System.out.println(packet);

boolean oldSmithingTable;
int[] smithingBase = packet.getItemSets().get(SMITHING_BASE);
Expand All @@ -115,8 +112,6 @@ public void translate(GeyserSession session, ClientboundUpdateRecipesPacket pack
addSmithingTransformRecipes(session, craftingDataPacket.getCraftingData());
netId = session.getLastRecipeNetId().get(); // Was updated in the above method.
} else {
System.out.println(Arrays.stream(smithingTemplate).mapToObj(i -> Registries.JAVA_ITEMS.get(i).javaIdentifier()).collect(Collectors.joining(" ")));
System.out.println(Arrays.stream(smithingAddition).mapToObj(i -> Registries.JAVA_ITEMS.get(i).javaIdentifier()).collect(Collectors.joining(" ")));
oldSmithingTable = false;
// BDS sends armor trim templates and materials before the CraftingDataPacket
TrimDataPacket trimDataPacket = new TrimDataPacket();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public class JavaPlayerPositionTranslator extends PacketTranslator<ClientboundPl

@Override
public void translate(GeyserSession session, ClientboundPlayerPositionPacket packet) {
System.out.println(packet);
if (!session.isLoggedIn())
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ public static GeyserRecipe getValidRecipe(final GeyserSession session, final @Nu
}
}

if (!ingredients.equals(mirroredIngredients) ||
if (ingredients.equals(mirroredIngredients) ||
!testShapedRecipe(session, mirroredIngredients, inventoryGetter, gridDimensions, firstRow, height, firstCol, width)) {
continue;
}
Expand Down Expand Up @@ -551,7 +551,6 @@ public static GeyserRecipe getValidRecipe(final GeyserSession session, final @Nu
}
}
}
System.out.println("Found existing match for item: " + recipe);
return recipe;
}
return null;
Expand Down

0 comments on commit c34b4b3

Please sign in to comment.