Skip to content

Commit

Permalink
Add debug helper to login in dev env
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Jan 2, 2024
1 parent 311c0dc commit 67bca7b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Impersonate
* Copyright (C) 2020-2024 Ladysnake
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; If not, see <https://www.gnu.org/licenses>.
*/
package io.github.ladysnake.impersonatest;

import io.github.ladysnake.impersonate.Impersonate;
import net.fabricmc.api.ClientModInitializer;
import net.minecraft.client.MinecraftClient;

public final class ImpersonatestClient implements ClientModInitializer {
private static final boolean debugCredentials = Boolean.getBoolean("impersonate.debug.printCredentials");

@Override
public void onInitializeClient() {
if (debugCredentials) {
// Here to help login within a dev environment - be very careful when running this code at home
Impersonate.LOGGER.info("ACCESS_TOKEN " + MinecraftClient.getInstance().getSession().getAccessToken());
Impersonate.LOGGER.info("UUID " + MinecraftClient.getInstance().getSession().getUuidOrNull());
}
}
}
3 changes: 3 additions & 0 deletions src/testmod/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"main": [
"io.github.ladysnake.impersonatest.Impersonatest"
],
"client": [
"io.github.ladysnake.impersonatest.ImpersonatestClient"
],
"fabric-gametest": [
"io.github.ladysnake.impersonatest.ImpersonateTestSuite"
]
Expand Down

0 comments on commit 67bca7b

Please sign in to comment.