mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-20 12:29:45 +00:00
Also changes like all packages inb4 "jared changes a package name in ModTweaker2 breaking compatability with everything" drama tweet.
This commit is contained in:
1 parent
4fd2551072
commit
ec562b62ea
187 files changed
+977
-991
No files matched your search
@@ -0,0 +1,56 @@
|
||||
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;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if (player != null) {
|
||||
player.sendChat(MineTweakerImplementationAPI.platform.getMessage("List generated; see minetweaker.log in your minecraft dir"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user