just a copy of petroleum right now

This commit is contained in:
jane 2020-12-19 18:30:50 -05:00
commit 183c81258a
88 changed files with 7405 additions and 0 deletions

View file

@ -0,0 +1,32 @@
package pm.j4.petroleum.util.data;
/**
* The type Button information.
*/
public class ButtonInformation {
/**
* The X.
*/
public double x;
/**
* The Y.
*/
public double y;
/**
* The Open.
*/
public boolean open;
/**
* Instantiates a new Button information.
*
* @param x the x
* @param y the y
* @param open the open
*/
public ButtonInformation(double x, double y, boolean open) {
this.x = x;
this.y = y;
this.open = open;
}
}

View file

@ -0,0 +1,47 @@
package pm.j4.petroleum.util.data;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import pm.j4.petroleum.PetroleumMod;
import pm.j4.petroleum.util.module.ModuleBase;
/**
* The type Category.
*/
public class Category {
/**
* Gets category map.
*
* @return the category map
*/
public static Map<String, List<ModuleBase>> getCategoryMap() {
List<ModuleBase> modules = PetroleumMod.getActiveMods();
Map<String, List<ModuleBase>> categoryMap = new HashMap<>();
modules.forEach(module -> {
if (!categoryMap.containsKey(module.getCategory())) {
List<ModuleBase> m = new ArrayList<>();
m.add(module);
categoryMap.put(module.getCategory(), m);
} else {
List<ModuleBase> m = categoryMap.get(module.getCategory());
List<ModuleBase> nm = new ArrayList<>();
nm.addAll(m);
nm.add(module);
categoryMap.replace(module.getCategory(), nm);
}
});
return categoryMap;
}
/**
* Gets by category.
*
* @param category the category
* @return the by category
*/
public static List<ModuleBase> getByCategory(String category) {
return getCategoryMap().containsKey(category) ? getCategoryMap().get(category) : new ArrayList<>();
}
}

View file

@ -0,0 +1,13 @@
package pm.j4.petroleum.util.data;
import java.util.Map;
/**
* The type Module config.
*/
public class ModuleConfig {
/**
* The Options.
*/
public Map<String, OptionSerializiable> options;
}

View file

@ -0,0 +1,28 @@
package pm.j4.petroleum.util.data;
import com.google.gson.JsonElement;
/**
* The type Option serializiable.
*/
public class OptionSerializiable {
/**
* Instantiates a new Option serializiable.
*
* @param key the key
* @param value the value
*/
public OptionSerializiable(String key, JsonElement value) {
this.value = value;
this.key = key;
}
/**
* The Value.
*/
public final JsonElement value;
/**
* The Key.
*/
public final String key;
}