mirror of
https://github.com/GTNewHorizons/MouseTweaks.git
synced 2026-11-14 01:14:27 +00:00
Merge pull request #2 from GTNewHorizons/fix/debug-spam
Suppress debug log for outside of dev env
This commit is contained in:
3 files changed
+27
-16
No files matched your search
@@ -11,3 +11,5 @@ jobs:
|
||||
build-and-test:
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master
|
||||
secrets: inherit
|
||||
with:
|
||||
client-only: true
|
||||
@@ -1,5 +1,6 @@
|
||||
package yalter.mousetweaks;
|
||||
|
||||
import net.minecraft.launchwrapper.Launch;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -11,6 +12,8 @@ public class Constants {
|
||||
|
||||
public static final Logger LOGGER = LogManager.getLogger(MOD_NAME);
|
||||
|
||||
public static final boolean DEV_ENV = (boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
|
||||
|
||||
// Inventory-related stuff
|
||||
public static final int INVENTORY_SIZE = 36; // Size of the player inventory
|
||||
|
||||
|
||||
@@ -108,17 +108,19 @@ public class Main extends DeobfuscationLayer {
|
||||
container = getContainerWithID(currentScreen);
|
||||
disableForThisContainer = isDisabledForThisContainer(currentScreen);
|
||||
|
||||
Constants.LOGGER.debug(new StringBuilder()
|
||||
.append("You have just opened a ")
|
||||
.append(getGuiContainerNameFromID(currentScreen))
|
||||
.append(" container (")
|
||||
.append(currentScreen.getClass().getSimpleName())
|
||||
.append((container == null) ? "" : "; ")
|
||||
.append((container == null) ? "" : container.getClass().getSimpleName())
|
||||
.append("), which has ")
|
||||
.append(getSlotCountWithID(currentScreen))
|
||||
.append(" slots!")
|
||||
.toString());
|
||||
if (Constants.DEV_ENV) {
|
||||
Constants.LOGGER.debug(new StringBuilder()
|
||||
.append("You have just opened a ")
|
||||
.append(getGuiContainerNameFromID(currentScreen))
|
||||
.append(" container (")
|
||||
.append(currentScreen.getClass().getSimpleName())
|
||||
.append((container == null) ? "" : "; ")
|
||||
.append((container == null) ? "" : container.getClass().getSimpleName())
|
||||
.append("), which has ")
|
||||
.append(getSlotCountWithID(currentScreen))
|
||||
.append(" slots!")
|
||||
.toString());
|
||||
}
|
||||
|
||||
disableWheelForThisContainer = isWheelDisabledForThisContainer(currentScreen);
|
||||
}
|
||||
@@ -185,10 +187,12 @@ public class Main extends DeobfuscationLayer {
|
||||
return;
|
||||
}
|
||||
|
||||
Constants.LOGGER.debug(new StringBuilder()
|
||||
.append("You have selected a new slot, it's slot number is ")
|
||||
.append(getSlotNumber(selectedSlot))
|
||||
.toString());
|
||||
if (Constants.DEV_ENV) {
|
||||
Constants.LOGGER.debug(new StringBuilder()
|
||||
.append("You have selected a new slot, it's slot number is ")
|
||||
.append(getSlotNumber(selectedSlot))
|
||||
.toString());
|
||||
}
|
||||
|
||||
boolean shiftIsDown = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
|
||||
|
||||
@@ -248,7 +252,9 @@ public class Main extends DeobfuscationLayer {
|
||||
|
||||
if ((wheel != 0) && (selectedSlot != null)) {
|
||||
int numItemsToMove = Math.abs(wheel);
|
||||
Constants.LOGGER.debug("numItemsToMove: " + numItemsToMove);
|
||||
if (Constants.DEV_ENV) {
|
||||
Constants.LOGGER.debug("numItemsToMove: " + numItemsToMove);
|
||||
}
|
||||
|
||||
if (slotCount > Constants.INVENTORY_SIZE) {
|
||||
ItemStack originalStack = getSlotStack(selectedSlot);
|
||||
|
||||
Reference in new issue
Block a user