-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: Command to log TConstruct Modifiers, fix: #238
- Loading branch information
Showing
3 changed files
with
31 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 7 additions & 21 deletions
28
...aker2/mods/tconstruct/MaterialLogger.java → ...s/tconstruct/commands/MaterialLogger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,22 @@ | ||
package modtweaker2.mods.tconstruct; | ||
|
||
import static modtweaker2.helpers.LogHelper.logPrinted; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.Map; | ||
package modtweaker2.mods.tconstruct.commands; | ||
|
||
import minetweaker.MineTweakerAPI; | ||
import minetweaker.api.player.IPlayer; | ||
import minetweaker.api.server.ICommandFunction; | ||
import tconstruct.library.TConstructRegistry; | ||
import tconstruct.library.tools.ToolMaterial; | ||
|
||
public class MaterialLogger implements ICommandFunction { | ||
private static ArrayList<String> materials = new ArrayList<String>(); | ||
static { | ||
materials = new ArrayList<String>(); | ||
for (Map.Entry<String, ToolMaterial> entry : TConstructRegistry.toolMaterialStrings.entrySet()) { | ||
materials.add(entry.getKey()); | ||
} | ||
import java.util.Map; | ||
|
||
Collections.sort(materials); | ||
} | ||
import static modtweaker2.helpers.LogHelper.logPrinted; | ||
|
||
public class MaterialLogger implements ICommandFunction { | ||
@Override | ||
public void execute(String[] arguments, IPlayer player) { | ||
System.out.println("Materials: " + materials.size()); | ||
for (String s : materials) { | ||
System.out.println("Material " + s); | ||
MineTweakerAPI.logCommand("<" + s + "> -- "); | ||
MineTweakerAPI.logCommand(TConstructRegistry.toolMaterialStrings.entrySet().size() + " Materials:"); | ||
for (Map.Entry<String, ToolMaterial> entry : TConstructRegistry.toolMaterialStrings.entrySet()) { | ||
MineTweakerAPI.logCommand(entry.getKey()); | ||
} | ||
|
||
logPrinted(player); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/modtweaker2/mods/tconstruct/commands/ModifierLogger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package modtweaker2.mods.tconstruct.commands; | ||
|
||
import minetweaker.MineTweakerAPI; | ||
import minetweaker.api.player.IPlayer; | ||
import minetweaker.api.server.ICommandFunction; | ||
import modtweaker2.mods.tconstruct.TConstructHelper; | ||
import tconstruct.library.modifier.ItemModifier; | ||
|
||
import static modtweaker2.helpers.LogHelper.logPrinted; | ||
|
||
public class ModifierLogger implements ICommandFunction{ | ||
@Override | ||
public void execute(String[] arguments, IPlayer player) { | ||
MineTweakerAPI.logCommand(TConstructHelper.modifiers.size() + " Tinker's Construct modifiers:"); | ||
for (ItemModifier modifier : TConstructHelper.modifiers) { | ||
if (!modifier.key.equals("")) | ||
MineTweakerAPI.logCommand(modifier.key); | ||
} | ||
logPrinted(player); | ||
} | ||
} |