add: Command to log TConstruct Modifiers, fix: #238
This commit is contained in:
parent
4e92eddfd3
commit
8313b5c470
3 changed files with 32 additions and 23 deletions
|
@ -19,7 +19,8 @@ import modtweaker2.mods.factorization.commands.FactorizationLogger;
|
||||||
import modtweaker2.mods.mekanism.commands.GasLogger;
|
import modtweaker2.mods.mekanism.commands.GasLogger;
|
||||||
import modtweaker2.mods.mekanism.commands.MekanismLogger;
|
import modtweaker2.mods.mekanism.commands.MekanismLogger;
|
||||||
import modtweaker2.mods.railcraft.commands.RailcraftLogger;
|
import modtweaker2.mods.railcraft.commands.RailcraftLogger;
|
||||||
import modtweaker2.mods.tconstruct.MaterialLogger;
|
import modtweaker2.mods.tconstruct.commands.MaterialLogger;
|
||||||
|
import modtweaker2.mods.tconstruct.commands.ModifierLogger;
|
||||||
import modtweaker2.mods.tconstruct.commands.TConstructLogger;
|
import modtweaker2.mods.tconstruct.commands.TConstructLogger;
|
||||||
import modtweaker2.mods.thaumcraft.commands.AspectLogger;
|
import modtweaker2.mods.thaumcraft.commands.AspectLogger;
|
||||||
import modtweaker2.mods.thaumcraft.research.commands.ResearchLogger;
|
import modtweaker2.mods.thaumcraft.research.commands.ResearchLogger;
|
||||||
|
@ -81,6 +82,7 @@ public class Commands {
|
||||||
|
|
||||||
if (TweakerPlugin.isLoaded("TConstruct")) {
|
if (TweakerPlugin.isLoaded("TConstruct")) {
|
||||||
MineTweakerAPI.server.addMineTweakerCommand("materials", new String[] { "/minetweaker materials", " Outputs a list of all Tinker's Construct material names in the game to the minetweaker log" }, new MaterialLogger());
|
MineTweakerAPI.server.addMineTweakerCommand("materials", new String[] { "/minetweaker materials", " Outputs a list of all Tinker's Construct material names in the game to the minetweaker log" }, new MaterialLogger());
|
||||||
|
MineTweakerAPI.server.addMineTweakerCommand("modifiers", new String[] { "/minetweaker modifiers", " Outputs a list of all Tinker's Construct modifier names in the game to the minetweaker log" }, new ModifierLogger());
|
||||||
MineTweakerAPI.server.addMineTweakerCommand("tconstruct", new String[]{ "/minetweaker tconstruct [HANDLER]", " Outputs a list of all Tinkers Construct recipes."}, new TConstructLogger());
|
MineTweakerAPI.server.addMineTweakerCommand("tconstruct", new String[]{ "/minetweaker tconstruct [HANDLER]", " Outputs a list of all Tinkers Construct recipes."}, new TConstructLogger());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
package modtweaker2.mods.tconstruct;
|
package modtweaker2.mods.tconstruct.commands;
|
||||||
|
|
||||||
import static modtweaker2.helpers.LogHelper.logPrinted;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import minetweaker.MineTweakerAPI;
|
import minetweaker.MineTweakerAPI;
|
||||||
import minetweaker.api.player.IPlayer;
|
import minetweaker.api.player.IPlayer;
|
||||||
|
@ -12,25 +6,17 @@ import minetweaker.api.server.ICommandFunction;
|
||||||
import tconstruct.library.TConstructRegistry;
|
import tconstruct.library.TConstructRegistry;
|
||||||
import tconstruct.library.tools.ToolMaterial;
|
import tconstruct.library.tools.ToolMaterial;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static modtweaker2.helpers.LogHelper.logPrinted;
|
||||||
|
|
||||||
public class MaterialLogger implements ICommandFunction {
|
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());
|
|
||||||
}
|
|
||||||
|
|
||||||
Collections.sort(materials);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(String[] arguments, IPlayer player) {
|
public void execute(String[] arguments, IPlayer player) {
|
||||||
System.out.println("Materials: " + materials.size());
|
MineTweakerAPI.logCommand(TConstructRegistry.toolMaterialStrings.entrySet().size() + " Materials:");
|
||||||
for (String s : materials) {
|
for (Map.Entry<String, ToolMaterial> entry : TConstructRegistry.toolMaterialStrings.entrySet()) {
|
||||||
System.out.println("Material " + s);
|
MineTweakerAPI.logCommand(entry.getKey());
|
||||||
MineTweakerAPI.logCommand("<" + s + "> -- ");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logPrinted(player);
|
logPrinted(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue