This commit is contained in:
jaredlll08 committed 2015-06-19 00:25:28 +02:00
1 parent 801990af69
commit 0843cd0a64
1 file changed
+15 -37
@@ -1,54 +1,32 @@
package modtweaker2.mods.thaumcraft.commands;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import minetweaker.MineTweakerAPI;
import minetweaker.MineTweakerImplementationAPI;
import minetweaker.api.player.IPlayer;
import minetweaker.api.server.ICommandFunction;
import modtweaker2.mods.thaumcraft.ThaumcraftHelper;
import net.minecraft.item.Item;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.ThaumcraftApi.EntityTags;
import thaumcraft.api.ThaumcraftApi.EntityTagsNBT;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.aspects.Aspect;
public class AspectLogger implements ICommandFunction{
@Override
public void execute(String[] arguments, IPlayer player) {
List<String> lines=new ArrayList();
for(Entry<List, AspectList> entry : ThaumcraftApi.objectTags.entrySet())
{
List<String> itemList=new ArrayList<String>();
for(int i=0;i<entry.getKey().size();i+=2)
{
Item item=(Item)entry.getKey().get(i);
itemList.add("<"+Item.itemRegistry.getNameForObject(item)+":"+entry.getKey().get(i+1)+">");
}
lines.add(itemList.toString()+": "+ThaumcraftHelper.aspectsToString(entry.getValue()));
}
for (EntityTags tags : ThaumcraftApi.scanEntities)
{
List<String> tagsList=new ArrayList<String>();
for(EntityTagsNBT tag : tags.nbts)
{
tagsList.add(tag.name+":"+tag.value);
}
String stringTags="";
if(tags.nbts.length!=0)
stringTags=":"+tagsList.toString();
lines.add("<"+tags.entityName+stringTags+">"+": "+ThaumcraftHelper.aspectsToString(tags.aspects));
}
System.out.println("Aspects: " + lines.size());
for (String line : lines) {
System.out.println("Aspect " + line);
MineTweakerAPI.logCommand(line);
}
ArrayList<Aspect> aspects = new ArrayList<Aspect>();
aspects.addAll(Aspect.getPrimalAspects());
aspects.addAll(Aspect.getCompoundAspects());
System.out.println("Aspects: " + aspects.size());
for (Aspect set : aspects) {
if (!set.isPrimal()) {
System.out.println("Aspect:[ AspectName: " + set.getName() + ", description" + set.getLocalizedDescription() + ", Components:[" + set.getComponents()[0].getName() + ", " + set.getComponents()[1].getName() + "]\n");
MineTweakerAPI.logCommand("Aspect:[ AspectName: " + set.getName() + ", description" + set.getLocalizedDescription() + ", Components:[" + set.getComponents()[0].getName() + ", " + set.getComponents()[1].getName() + "]\n");
} else {
System.out.println("Aspect:[ AspectName: " + set.getName() + ", description" + set.getLocalizedDescription() + ", ]\n");
MineTweakerAPI.logCommand("Aspect:[ AspectName: " + set.getName() + ", description" + set.getLocalizedDescription() + ", ]\n");
}
}
if (player != null) {
player.sendChat(MineTweakerImplementationAPI.platform.getMessage("List generated; see minetweaker.log in your minecraft dir"));
}