Add debug logging toggle for sync flow

This commit is contained in:
Kam committed 2025-10-19 22:06:11 -04:00
1 parent 111f16647d
commit b25f2b786e
24 files changed
+710 -124

No files matched your search

@@ -41,6 +41,8 @@ public class GuiAnvilRecipes extends GuiNPCInterface {
setBackground("recipesAnvil.png");
this.closeOnEsc = true;
// TODO: Loads the entire anvil recipe registry from RecipeController; any player can open this reference GUI without
// special permissions.
recipes.addAll(RecipeController.Instance.anvilRecipes.values());
}
@@ -81,9 +83,12 @@ public class GuiAnvilRecipes extends GuiNPCInterface {
private List<RecipeAnvil> getSearchList() {
if (search.isEmpty()) {
// TODO: Returns every anvil recipe from RecipeController for browsing; no CustomNpcsPermissions gate applies.
return new ArrayList<RecipeAnvil>(RecipeController.Instance.anvilRecipes.values());
}
List<RecipeAnvil> list = new ArrayList<RecipeAnvil>();
// TODO: Filters across the RecipeController anvil collection; the bench/anvil GUIs are normal gameplay with no
// permission checks.
for (RecipeAnvil recipe : RecipeController.Instance.anvilRecipes.values()) {
ItemStack repairItem = recipe.itemToRepair;
if (repairItem == null)
@@ -39,6 +39,8 @@ public class GuiNpcAnvil extends GuiContainerNPCInterface {
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
// Enable the button if there are any anvil recipes.
// TODO: Checks the shared RecipeController anvil list (entire dataset) before enabling; this player crafting GUI is
// public, so no CustomNpcsPermissions gate applies here.
button.enabled = RecipeController.Instance != null && !RecipeController.Instance.getAnvilList().isEmpty();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(resource);
@@ -36,6 +36,8 @@ public class GuiNpcCarpentryBench extends GuiContainerNPCInterface {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
// TODO: Reads the global RecipeController carpentry list before enabling; this bench is a public crafting block with no
// additional permission checks.
button.enabled = RecipeController.Instance != null && !RecipeController.Instance.carpentryRecipes.isEmpty();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.bindTexture(resource);
@@ -39,6 +39,8 @@ public class GuiRecipes extends GuiNPCInterface {
this.xSize = 256;
setBackground("recipes.png");
this.closeOnEsc = true;
// TODO: Preloads every carpentry recipe from RecipeController (full dataset); this book is open to any player, so no
// explicit permission is checked when accessing it.
recipes.addAll(RecipeController.Instance.carpentryRecipes.values());
}
@@ -74,9 +76,13 @@ public class GuiRecipes extends GuiNPCInterface {
private List<IRecipe> getSearchList() {
if (search.isEmpty()) {
// TODO: Returns the entire carpentry recipe collection from RecipeController; again this is unrestricted player
// content with no CustomNpcsPermissions gating.
return new ArrayList<IRecipe>(RecipeController.Instance.carpentryRecipes.values());
}
List<IRecipe> list = new ArrayList<IRecipe>();
// TODO: Iterates over the RecipeController carpentry map to filter recipes; this viewing GUI is available to all
// players without special permissions.
for (IRecipe recipe : RecipeController.Instance.carpentryRecipes.values()) {
if (recipe.getRecipeOutput() == null)
continue;
@@ -94,6 +94,8 @@ public class GuiCNPCInventory extends GuiNPCInterface {
PlayerData data = PlayerData.get(mc.thePlayer);
if (data != null && data.effectData != null) {
for (PlayerEffect pe : data.effectData.getEffects().values()) {
// TODO: Pulls specific CustomEffect entries from the global controller; this HUD is part of the base
// player inventory so it must work without extra permissions (no CustomNpcsPermissions required).
CustomEffect effect = CustomEffectController.getInstance().get(pe.id, pe.index);
if (effect != null) {
effectBar.entries.add(new GuiEffectBar.EffectEntry(effect, pe));
@@ -255,6 +255,8 @@ public class GuiModernQuestDialog extends GuiNPCInterface implements IGuiClose {
}
int fac1ID = quest.factionOptions.factionId;
if (fac1ID != -1) {
// TODO: Looks up faction display data from the global FactionController; this dialog is part of the standard
// player quest flow so no special permissions are needed beyond quest access.
String fac1Name = FactionController.getInstance().getFaction(fac1ID).getName();
String fac1Color = (quest.factionOptions.decreaseFactionPoints) ? "§c-" : "§a+";
int fac1Point = quest.factionOptions.factionPoints;
@@ -263,6 +265,8 @@ public class GuiModernQuestDialog extends GuiNPCInterface implements IGuiClose {
}
int fac2ID = quest.factionOptions.faction2Id;
if (fac2ID != -1) {
// TODO: Retrieves the second faction's metadata from FactionController as above; normal quest participants reach
// this without CustomNpcsPermissions requirements.
String fac2Name = FactionController.getInstance().getFaction(fac2ID).getName();
String fac2Color = (quest.factionOptions.decreaseFaction2Points) ? "§c-" : "§a+";
int fac2Point = quest.factionOptions.faction2Points;