Skip to content

Commit

Permalink
Remove debug lines
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ-Ferguson committed Jan 14, 2021
1 parent e87ae8f commit 196c9f5
Show file tree
Hide file tree
Showing 20 changed files with 0 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public void onPlayerJoin(PlayerJoinEvent event) {
return;
}

System.out.println("Sending recipes!");
sendServerRecipes(session);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,6 @@ private void startGame() {
*/
public void addInventoryTask(Runnable task) {
synchronized (inventoryLock) {
System.out.println("new task " + task.toString());
inventoryFuture = inventoryFuture.thenRun(task).exceptionally(throwable -> {
GeyserConnector.getInstance().getLogger().error("Error processing inventory task", throwable.getCause());
return null;
Expand All @@ -905,7 +904,6 @@ public void addInventoryTask(Runnable task) {
*/
public void addInventoryTask(Runnable task, long delayMillis) {
synchronized (inventoryLock) {
System.out.println("new delayed task " + task.toString());
Executor delayedExecutor = command -> GeyserConnector.getInstance().getGeneralThreadPool().schedule(command, delayMillis, TimeUnit.MILLISECONDS);
inventoryFuture = inventoryFuture.thenRunAsync(task, delayedExecutor).exceptionally(throwable -> {
GeyserConnector.getInstance().getLogger().error("Error processing inventory task", throwable.getCause());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public void translate(ContainerClosePacket packet, GeyserSession session) {

Inventory openInventory = session.getOpenInventory();
if (openInventory != null && windowId == openInventory.getId()) {
System.out.println(packet);
ClientCloseWindowPacket closeWindowPacket = new ClientCloseWindowPacket(windowId);
session.sendDownstreamPacket(closeWindowPacket);
InventoryUtils.closeInventory(session, windowId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public void translate(FilterTextPacket packet, GeyserSession session) {
if (session.getOpenInventory() instanceof AnvilContainer) {
// Java Edition sends a packet every time an item is renamed even slightly in GUI. Fortunately, this works out for us now
ClientRenameItemPacket renameItemPacket = new ClientRenameItemPacket(packet.getText());
System.out.println(renameItemPacket);
session.sendDownstreamPacket(renameItemPacket);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public void translate(InventoryTransactionPacket packet, GeyserSession session)

switch (packet.getTransactionType()) {
case NORMAL:
System.out.println(packet);
if (packet.getActions().size() == 2) {
InventoryActionData worldAction = packet.getActions().get(0);
InventoryActionData containerAction = packet.getActions().get(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public class BedrockItemStackRequestTranslator extends PacketTranslator<ItemStac

@Override
public void translate(ItemStackRequestPacket packet, GeyserSession session) {
session.getConnector().getLogger().info(packet.toString());
Inventory inventory = session.getOpenInventory();
if (inventory == null)
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ public void translate(LecternUpdatePacket packet, GeyserSession session) {
// So, we enter the GUI and then drop it! :)
session.setDroppingLecternBook(true);

Vector3f diff = session.getPlayerEntity().getPosition().sub(packet.getBlockPosition().toFloat());
System.out.println(diff);
// Emulate an interact packet
ClientPlayerPlaceBlockPacket blockPacket = new ClientPlayerPlaceBlockPacket(
new Position(packet.getBlockPosition().getX(), packet.getBlockPosition().getY(), packet.getBlockPosition().getZ()),
Expand Down Expand Up @@ -79,13 +77,11 @@ public void translate(LecternUpdatePacket packet, GeyserSession session) {
if (newJavaPage > currentJavaPage) {
for (int i = currentJavaPage; i < newJavaPage; i++) {
ClientClickWindowButtonPacket clickButtonPacket = new ClientClickWindowButtonPacket(session.getOpenInventory().getId(), 2);
System.out.println(clickButtonPacket);
session.sendDownstreamPacket(clickButtonPacket);
}
} else {
for (int i = currentJavaPage; i > newJavaPage; i--) {
ClientClickWindowButtonPacket clickButtonPacket = new ClientClickWindowButtonPacket(session.getOpenInventory().getId(), 1);
System.out.println(clickButtonPacket);
session.sendDownstreamPacket(clickButtonPacket);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,9 @@ public void translateRequests(GeyserSession session, Inventory inventory, List<I
}
}
session.sendUpstreamPacket(responsePacket);
System.out.println(responsePacket);
}

public ItemStackResponsePacket.Response translateRequest(GeyserSession session, Inventory inventory, ItemStackRequestPacket.Request request) {
System.out.println(request);
ClickPlan plan = new ClickPlan(session, this, inventory);
IntSet affectedSlots = new IntOpenHashSet();
for (StackRequestActionData action : request.getActions()) {
Expand Down Expand Up @@ -273,7 +271,6 @@ public ItemStackResponsePacket.Response translateRequest(GeyserSession session,
itemToUpdate.isEmpty() ? new ItemStack(0) : itemToUpdate.getItemStack()
);
session.sendDownstreamPacket(creativeActionPacket);
System.out.println(creativeActionPacket);

if (!sourceIsCursor) { // Cursor is always added for us as an affected slot
affectedSlots.add(sourceSlot);
Expand Down Expand Up @@ -365,7 +362,6 @@ public ItemStackResponsePacket.Response translateRequest(GeyserSession session,
sourceSlot,
oldDestinationItem.isEmpty() ? new ItemStack(0) : oldDestinationItem.getItemStack() // isEmpty check... just in case
);
System.out.println(creativeActionPacket);
session.sendDownstreamPacket(creativeActionPacket);
inventory.setItem(sourceSlot, oldDestinationItem, session);
}
Expand All @@ -376,7 +372,6 @@ public ItemStackResponsePacket.Response translateRequest(GeyserSession session,
destSlot,
oldSourceItem.isEmpty() ? new ItemStack(0) : oldSourceItem.getItemStack()
);
System.out.println(creativeActionPacket);
session.sendDownstreamPacket(creativeActionPacket);
inventory.setItem(destSlot, oldSourceItem, session);
}
Expand Down Expand Up @@ -433,7 +428,6 @@ public ItemStackResponsePacket.Response translateRequest(GeyserSession session,
Click.OUTSIDE_SLOT,
droppingItem.getItemStack()
);
System.out.println(packet.toString());
session.sendDownstreamPacket(packet);
} else {
int sourceAmount = plan.getCursor().getAmount();
Expand All @@ -458,11 +452,6 @@ public ItemStackResponsePacket.Response translateRequest(GeyserSession session,
}
break;
}
case CRAFT_CREATIVE: {
CraftCreativeStackRequestActionData creativeAction = (CraftCreativeStackRequestActionData) action;
System.out.println(creativeAction.getCreativeItemNetworkId());
break;
}
case DESTROY: {
// Only called when a creative client wants to destroy an item... I think - Camotoy
DestroyStackRequestActionData destroyAction = (DestroyStackRequestActionData) action;
Expand All @@ -489,7 +478,6 @@ public ItemStackResponsePacket.Response translateRequest(GeyserSession session,
);
}
session.sendDownstreamPacket(destroyItemPacket);
System.out.println(destroyItemPacket);
affectedSlots.add(javaSlot);
} else {
// Just sync up the item on our end, since the server doesn't care what's in our cursor
Expand Down Expand Up @@ -538,8 +526,6 @@ public ItemStackResponsePacket.Response translateRequest(GeyserSession session,
}

public ItemStackResponsePacket.Response translateCraftingRequest(GeyserSession session, Inventory inventory, ItemStackRequestPacket.Request request) {
System.out.println(request);

int recipeId = 0;
int resultSize = 0;
int timesCrafted = 0;
Expand Down Expand Up @@ -809,8 +795,6 @@ public ItemStackResponsePacket.Response translateAutoCraftingRequest(GeyserSessi
boolean done = true;
for (Int2ObjectMap.Entry<Int2IntMap> entry : ingredientMap.int2ObjectEntrySet()) {
Int2IntMap sources = entry.getValue();
System.out.println("Grid slot: " + entry.getIntKey());
System.out.println(sources);
if (sources.isEmpty())
continue;

Expand All @@ -829,16 +813,10 @@ public ItemStackResponsePacket.Response translateAutoCraftingRequest(GeyserSessi
transferSlot(plan, sourceSlot, gridSlot, transferAmount);
}

for (int x = 0; x < 3; x++) {
int offset = x * 3;
System.out.println(plan.getItem(1 + offset).getAmount() + " " + plan.getItem(2 + offset).getAmount() + " " + plan.getItem(3 + offset).getAmount());
}

if (!done) {
//TODO: sometimes the server does not agree on this slot?
plan.add(Click.LEFT_SHIFT, 0, true);
} else {
System.out.println("Times looped: " + loops);
break;
}
}
Expand Down Expand Up @@ -908,7 +886,6 @@ public ItemStackResponsePacket.Response translateCreativeRequest(GeyserSession s
javaCreativeItem
);
session.sendDownstreamPacket(creativeActionPacket);
System.out.println(creativeActionPacket);
Set<Integer> affectedSlots = Collections.singleton(javaSlot);
return acceptRequest(request, makeContainerEntries(session, inventory, affectedSlots));
}
Expand Down Expand Up @@ -1017,8 +994,6 @@ private static int findTempSlot(Inventory inventory, GeyserItemStack item, boole
if (!viable) {
continue;
}

System.out.println("TEMP SLOT CHOSEN: " + i + " => " + inventory.getItem(i));
return i;
}
//could not find a viable temp slot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ public void execute(boolean refresh) {
if (clickedItemStack == InventoryUtils.REFRESH_ITEM || action.force) {
session.sendDownstreamPacket(new ClientConfirmTransactionPacket(inventory.getId(), actionId, true));
}
System.out.println(clickPacket);
}

session.getPlayerInventory().setCursor(simulatedCursor, session);
Expand Down Expand Up @@ -268,7 +267,6 @@ private void reduceCraftingGrid(boolean makeAll) {
if (!item.isEmpty())
item.sub(crafted);
}
System.out.println("REDUCED GRID BY " + crafted);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public void updateProperty(GeyserSession session, Inventory inventory, int key,
BlockEntityDataPacket packet = new BlockEntityDataPacket();
packet.setBlockPosition(position);
packet.setData(builder.build());
System.out.println(packet.toString());
session.sendUpstreamPacket(packet);
}

Expand All @@ -98,7 +97,6 @@ public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSession se
// Input a beacon payment
BeaconPaymentStackRequestActionData beaconPayment = (BeaconPaymentStackRequestActionData) request.getActions()[0];
ClientSetBeaconEffectPacket packet = new ClientSetBeaconEffectPacket(beaconPayment.getPrimaryEffect(), beaconPayment.getSecondaryEffect());
System.out.println(packet.toString());
session.sendDownstreamPacket(packet);
return acceptRequest(request, makeContainerEntries(session, inventory, Collections.emptySet()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public void updateProperty(GeyserSession session, Inventory inventory, int key,

@Override
public int bedrockSlotToJava(StackRequestSlotInfoData slotInfoData) {
System.out.println("Brewing stand: " + slotInfoData);
if (slotInfoData.getContainer() == ContainerSlotType.BREWING_INPUT) {
// Ingredient
// TODO: This hasn't worked and then suddenly, it did.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public void updateProperty(GeyserSession session, Inventory inventory, int key,
enchantingInventory.getEnchantOptions()[slotToUpdate] = enchantingInventory.getGeyserEnchantOptions()[slotToUpdate].build(session);
PlayerEnchantOptionsPacket packet = new PlayerEnchantOptionsPacket();
packet.getOptions().addAll(Arrays.asList(enchantingInventory.getEnchantOptions()));
System.out.println(packet);
session.sendUpstreamPacket(packet);
}
}
Expand Down Expand Up @@ -130,7 +129,6 @@ public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSession se
return rejectRequest(request);
}
ClientClickWindowButtonPacket packet = new ClientClickWindowButtonPacket(inventory.getId(), javaSlot);
System.out.println(packet);
session.sendDownstreamPacket(packet);
return acceptRequest(request, makeContainerEntries(session, inventory, Collections.emptySet()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSession se
// And the Java loom window has a fixed row/width of four
// So... Number / 4 = row (so we don't have to bother there), and number % 4 is our column, which leads us back to our index. :)
ClientClickWindowButtonPacket packet = new ClientClickWindowButtonPacket(inventory.getId(), index);
System.out.println(packet);
session.sendDownstreamPacket(packet);

GeyserItemStack inputCopy = inventory.getItem(0).copy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,12 @@ public ItemStackResponsePacket.Response translateSpecialRequest(GeyserSession se
if (results == null) {
return rejectRequest(request);
}
System.out.println(id + " " + results);
ItemStack javaOutput = ItemTranslator.translateToJava(craftData.getResultItems()[0]);
System.out.println(javaOutput);
int button = results.indexOf(javaOutput.getId());
// If we've already pressed the button with this item, no need to press it again!
if (container.getStonecutterButton() != button) {
// Getting the index of the item in the Java stonecutter list
ClientClickWindowButtonPacket packet = new ClientClickWindowButtonPacket(inventory.getId(), button);
System.out.println(packet.toString());
session.sendDownstreamPacket(packet);
container.setStonecutterButton(button);
if (inventory.getItem(1).getJavaId() != javaOutput.getId()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ public void updateInventory(GeyserSession session, Inventory inventory) {
InventoryContentPacket horseContentsPacket = new InventoryContentPacket();
horseContentsPacket.setContainerId(inventory.getId());
horseContentsPacket.setContents(Arrays.asList(horseItems));
System.out.println(horseContentsPacket);
session.sendUpstreamPacket(horseContentsPacket);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public boolean updateSlot(InventoryTranslator translator, GeyserSession session,
slotPacket.setSlot(translator.javaSlotToBedrock(javaSlot));
slotPacket.setItem(inventory.getItem(javaSlot).getItemData(session));
session.sendUpstreamPacket(slotPacket);
System.out.println(slotPacket);
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public void translate(ServerConfirmTransactionPacket packet, GeyserSession sessi
if (!packet.isAccepted()) {
ClientConfirmTransactionPacket confirmPacket = new ClientConfirmTransactionPacket(packet.getWindowId(), packet.getActionId(), true);
session.sendDownstreamPacket(confirmPacket);
System.out.println(packet);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public class JavaOpenHorseWindowTranslator extends PacketTranslator<ServerOpenHo

@Override
public void translate(ServerOpenHorseWindowPacket packet, GeyserSession session) {
System.out.println(packet.toString());
Entity entity = session.getEntityCache().getEntityByJavaId(packet.getEntityId());
if (entity == null) {
return;
Expand Down Expand Up @@ -130,7 +129,6 @@ public void translate(ServerOpenHorseWindowPacket packet, GeyserSession session)
builder.putList("slots", NbtType.COMPOUND, slots);

updateEquipPacket.setTag(builder.build());
System.out.println(updateEquipPacket);
session.sendUpstreamPacket(updateEquipPacket);

session.setInventoryTranslator(inventoryTranslator);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public class JavaSetSlotTranslator extends PacketTranslator<ServerSetSlotPacket>

@Override
public void translate(ServerSetSlotPacket packet, GeyserSession session) {
System.out.println(packet.toString());
session.addInventoryTask(() -> {
if (packet.getWindowId() == 255) { //cursor
GeyserItemStack newItem = GeyserItemStack.from(packet.getItem());
Expand Down Expand Up @@ -125,11 +124,6 @@ private static void updateCraftingGrid(GeyserSession session, ServerSetSlotPacke
height += -firstRow + 1;
width += -firstCol + 1;

System.out.println("Start Row: " + firstRow);
System.out.println("Start Column: " + firstCol);
System.out.println("Rows: " + height);
System.out.println("Columns: " + width);

//TODO
recipes:
for (Recipe recipe : session.getCraftingRecipes().values()) {
Expand Down Expand Up @@ -157,8 +151,6 @@ private static void updateCraftingGrid(GeyserSession session, ServerSetSlotPacke
continue;
}
}
System.out.println("FOUND SHAPED RECIPE :)");
System.out.println(recipe);
// Recipe is had, don't sent packet
return;
} else if (recipe.getType() == RecipeType.CRAFTING_SHAPELESS) {
Expand Down Expand Up @@ -191,7 +183,6 @@ private static void updateCraftingGrid(GeyserSession session, ServerSetSlotPacke
return;
}
}
System.out.println("Sending packet!");

UUID uuid = UUID.randomUUID();
int newRecipeId = session.getLastRecipeNetId().incrementAndGet();
Expand Down Expand Up @@ -234,7 +225,6 @@ private static void updateCraftingGrid(GeyserSession session, ServerSetSlotPacke
newRecipeId
));
craftPacket.setCleanRecipes(false);
System.out.println(craftPacket);
session.sendUpstreamPacket(craftPacket);

index = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class JavaWindowPropertyTranslator extends PacketTranslator<ServerWindowP

@Override
public void translate(ServerWindowPropertyPacket packet, GeyserSession session) {
System.out.println(packet.toString());
session.addInventoryTask(() -> {
Inventory inventory = InventoryUtils.getInventory(session, packet.getWindowId());
if (inventory == null)
Expand Down

0 comments on commit 196c9f5

Please sign in to comment.