mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-21 04:42:20 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
0cc3fa06c2
commit
655636b7e9
231 files changed
+10024
-8585
No files matched your search
@@ -1,5 +1,11 @@
|
||||
package modtweaker2.mods.thaumcraft;
|
||||
|
||||
import static modtweaker2.ModTweaker2.logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import modtweaker2.helpers.LogHelper;
|
||||
import modtweaker2.helpers.ReflectionHelper;
|
||||
import modtweaker2.mods.thaumcraft.aspect.AspectStack;
|
||||
@@ -12,13 +18,8 @@ import thaumcraft.api.research.ResearchCategories;
|
||||
import thaumcraft.api.research.ResearchCategoryList;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import static modtweaker2.ModTweaker2.logger;
|
||||
|
||||
public class ThaumcraftHelper {
|
||||
|
||||
public static HashMap<Object, Integer> warpList;
|
||||
|
||||
static {
|
||||
@@ -34,13 +35,10 @@ public class ThaumcraftHelper {
|
||||
}
|
||||
|
||||
public static AspectList parseAspects(AspectList list, String str) {
|
||||
AspectList output=new AspectList();
|
||||
if (list != null)
|
||||
for(Aspect aspect : list.getAspectsSortedAmount())
|
||||
{
|
||||
if(aspect!=null)
|
||||
output.add(aspect, list.getAmount(aspect));
|
||||
}
|
||||
AspectList output = new AspectList();
|
||||
if (list != null) for (Aspect aspect : list.getAspectsSortedAmount()) {
|
||||
if (aspect != null) output.add(aspect, list.getAmount(aspect));
|
||||
}
|
||||
if (str == null || str.equals("")) return list;
|
||||
String[] aspects = str.split(",");
|
||||
for (String aspect : aspects) {
|
||||
@@ -53,19 +51,16 @@ public class ThaumcraftHelper {
|
||||
}
|
||||
|
||||
public static AspectList removeAspects(AspectList list, String str) {
|
||||
AspectList output=new AspectList();
|
||||
if (list != null)
|
||||
for(Aspect aspect : list.getAspectsSortedAmount())
|
||||
{
|
||||
if(aspect!=null)
|
||||
output.add(aspect, list.getAmount(aspect));
|
||||
}
|
||||
AspectList output = new AspectList();
|
||||
if (list != null) for (Aspect aspect : list.getAspectsSortedAmount()) {
|
||||
if (aspect != null) output.add(aspect, list.getAmount(aspect));
|
||||
}
|
||||
String[] aspects = str.split(",");
|
||||
for (String aspect : aspects) {
|
||||
if (aspect.startsWith(" ")) aspect = aspect.replaceFirst(" ", "");
|
||||
String[] aspct = aspect.split("\\s+");
|
||||
if (aspct.length == 2) {
|
||||
output.remove(Aspect.aspects.get(aspct[0]), Integer.parseInt(aspct[1]));
|
||||
output.remove(Aspect.aspects.get(aspct[0]), Integer.parseInt(aspct[1]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,36 +76,29 @@ public class ThaumcraftHelper {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static AspectList getEntityAspects(String name) {
|
||||
for(EntityTags tag : ThaumcraftApi.scanEntities)
|
||||
{
|
||||
if(tag.entityName==name && tag.nbts.length==0)
|
||||
return tag.aspects;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static AspectList getEntityAspects(String name) {
|
||||
for (EntityTags tag : ThaumcraftApi.scanEntities) {
|
||||
if (tag.entityName == name && tag.nbts.length == 0) return tag.aspects;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void removeEntityAspects(String name) {
|
||||
List<EntityTags> tags = new ArrayList(ThaumcraftApi.scanEntities);
|
||||
for (EntityTags tag : tags) {
|
||||
if (tag.entityName == name && tag.nbts.length == 0) ThaumcraftApi.scanEntities.remove(tag);
|
||||
}
|
||||
}
|
||||
|
||||
public static String aspectsToString(AspectList aspects) {
|
||||
System.out.println(aspects);
|
||||
String output = "";
|
||||
for (Aspect aspect : aspects.getAspectsSortedAmount()) {
|
||||
if (aspect != null) output += aspect.getName() + " " + aspects.getAmount(aspect) + ",";
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
public static void removeEntityAspects(String name) {
|
||||
List<EntityTags> tags = new ArrayList(ThaumcraftApi.scanEntities);
|
||||
for(EntityTags tag : tags)
|
||||
{
|
||||
if(tag.entityName==name && tag.nbts.length==0)
|
||||
ThaumcraftApi.scanEntities.remove(tag);
|
||||
}
|
||||
}
|
||||
|
||||
public static String aspectsToString(AspectList aspects)
|
||||
{
|
||||
System.out.println(aspects);
|
||||
String output="";
|
||||
for(Aspect aspect : aspects.getAspectsSortedAmount())
|
||||
{
|
||||
if(aspect!=null)
|
||||
output+=aspect.getName()+" "+aspects.getAmount(aspect)+",";
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
public static AspectStack[] toStacks(IAspectStack[] iStack) {
|
||||
if (iStack == null) {
|
||||
return null;
|
||||
@@ -123,7 +111,7 @@ public class ThaumcraftHelper {
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static AspectStack toStack(IAspectStack iStack) {
|
||||
if (iStack == null) {
|
||||
return null;
|
||||
@@ -136,15 +124,15 @@ public class ThaumcraftHelper {
|
||||
return (AspectStack) internal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static ResearchItem getResearchSafe(String tab, String key) {
|
||||
final ResearchCategoryList cat = ResearchCategories.researchCategories.get(tab);
|
||||
if(cat == null) {
|
||||
if (cat == null) {
|
||||
logger.error("SCRIPT ERROR: Error, research tab {} doesn't exist", tab);
|
||||
return null;
|
||||
}
|
||||
final ResearchItem research = cat.research.get(key);
|
||||
if(research == null) {
|
||||
if (research == null) {
|
||||
logger.error("SCRIPT ERROR: Research {} doesn't exist.", key);
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user