|
1 | | -package modtweaker2.mods.tconstruct; |
2 | | - |
3 | | -import static modtweaker2.helpers.LogHelper.logPrinted; |
4 | | - |
5 | | -import java.util.ArrayList; |
6 | | -import java.util.Collections; |
7 | | -import java.util.Map; |
| 1 | +package modtweaker2.mods.tconstruct.commands; |
8 | 2 |
|
9 | 3 | import minetweaker.MineTweakerAPI; |
10 | 4 | import minetweaker.api.player.IPlayer; |
11 | 5 | import minetweaker.api.server.ICommandFunction; |
12 | 6 | import tconstruct.library.TConstructRegistry; |
13 | 7 | import tconstruct.library.tools.ToolMaterial; |
14 | 8 |
|
15 | | -public class MaterialLogger implements ICommandFunction { |
16 | | - private static ArrayList<String> materials = new ArrayList<String>(); |
17 | | - static { |
18 | | - materials = new ArrayList<String>(); |
19 | | - for (Map.Entry<String, ToolMaterial> entry : TConstructRegistry.toolMaterialStrings.entrySet()) { |
20 | | - materials.add(entry.getKey()); |
21 | | - } |
| 9 | +import java.util.Map; |
22 | 10 |
|
23 | | - Collections.sort(materials); |
24 | | - } |
| 11 | +import static modtweaker2.helpers.LogHelper.logPrinted; |
25 | 12 |
|
| 13 | +public class MaterialLogger implements ICommandFunction { |
26 | 14 | @Override |
27 | 15 | public void execute(String[] arguments, IPlayer player) { |
28 | | - System.out.println("Materials: " + materials.size()); |
29 | | - for (String s : materials) { |
30 | | - System.out.println("Material " + s); |
31 | | - MineTweakerAPI.logCommand("<" + s + "> -- "); |
| 16 | + MineTweakerAPI.logCommand(TConstructRegistry.toolMaterialStrings.entrySet().size() + " Materials:"); |
| 17 | + for (Map.Entry<String, ToolMaterial> entry : TConstructRegistry.toolMaterialStrings.entrySet()) { |
| 18 | + MineTweakerAPI.logCommand(entry.getKey()); |
32 | 19 | } |
33 | | - |
34 | 20 | logPrinted(player); |
35 | 21 | } |
36 | 22 | } |
0 commit comments