mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-26 23:03:21 +00:00
Add a new Ritual Info widget that shows the required activation crystal, ritual name, and activation cost when hovered. Suitable for use in any other NEI ritual handlers. Move the cost and radius to the top of the page so they don't get hidden with certain UI scales. Cost now shows the blood orb required (works with any IBloodOrb, but does not account for Runes of the Orb). The orb is darkened and the hover text includes "Insufficient LP" if the player does not have enough LP to summon that meteor. Radius shows the diameter (and its formula because it's actually 2r + 1) when hovered. Add a new Reagent Effects widget (also suitable for use in other handlers), and have it show effects for the currently selected meteor (meteors with no filler will not show things that impact filler, new filler chance will be calculated, new radius will be calculated). Center focus item and arrow on the texture because they were not centered before.
87 lines
2.9 KiB
Java
87 lines
2.9 KiB
Java
package WayofTime.alchemicalWizardry.client.nei;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
|
import codechicken.nei.ItemList;
|
|
import codechicken.nei.api.API;
|
|
import codechicken.nei.api.IConfigureNEI;
|
|
|
|
public class NEIConfig implements IConfigureNEI {
|
|
|
|
private static ArrayList<Item> bloodOrbs = null;
|
|
private static ArrayList<Item> byCapacity = null;
|
|
|
|
public static ArrayList<Item> getBloodOrbs() {
|
|
if (bloodOrbs == null) {
|
|
synchronized (NEIConfig.class) {
|
|
if (bloodOrbs == null) {
|
|
bloodOrbs = collectAllBloodOrbs();
|
|
}
|
|
}
|
|
}
|
|
return bloodOrbs;
|
|
}
|
|
|
|
private static ArrayList<Item> collectAllBloodOrbs() {
|
|
ArrayList<Item> bloodOrbsTemp = new ArrayList<>();
|
|
for (ItemStack item : ItemList.items) {
|
|
if (item != null && item.getItem() instanceof IBloodOrb) {
|
|
bloodOrbsTemp.add(item.getItem());
|
|
}
|
|
}
|
|
if (bloodOrbsTemp.isEmpty()) {
|
|
// If there is NEI no cache - go to item registry
|
|
for (Object anItemRegistry : Item.itemRegistry) {
|
|
Item item = (Item) anItemRegistry;
|
|
if (item instanceof IBloodOrb) {
|
|
bloodOrbsTemp.add(item);
|
|
}
|
|
}
|
|
}
|
|
return bloodOrbsTemp;
|
|
}
|
|
|
|
public static ArrayList<Item> getOrbsByCapacity() {
|
|
if (byCapacity == null) {
|
|
byCapacity = new ArrayList<>(getBloodOrbs());
|
|
byCapacity.sort((a, b) -> {
|
|
if (a instanceof IBloodOrb && b instanceof IBloodOrb) {
|
|
return Integer.compare(((IBloodOrb) a).getMaxEssence(), ((IBloodOrb) b).getMaxEssence());
|
|
}
|
|
return 0;
|
|
});
|
|
}
|
|
return byCapacity;
|
|
}
|
|
|
|
@Override
|
|
public void loadConfig() {
|
|
API.registerRecipeHandler(new NEIAlchemyRecipeHandler());
|
|
API.registerUsageHandler(new NEIAlchemyRecipeHandler());
|
|
API.registerRecipeHandler(new NEIAltarRecipeHandler());
|
|
API.registerUsageHandler(new NEIAltarRecipeHandler());
|
|
API.registerRecipeHandler(new NEIBloodOrbShapedHandler());
|
|
API.registerUsageHandler(new NEIBloodOrbShapedHandler());
|
|
API.registerRecipeHandler(new NEIBloodOrbShapelessHandler());
|
|
API.registerUsageHandler(new NEIBloodOrbShapelessHandler());
|
|
API.registerRecipeHandler(new NEIBindingRitualHandler());
|
|
API.registerUsageHandler(new NEIBindingRitualHandler());
|
|
API.registerRecipeHandler(new NEIMeteorRecipeHandler());
|
|
API.registerUsageHandler(new NEIMeteorRecipeHandler());
|
|
}
|
|
|
|
@Override
|
|
public String getName() {
|
|
return "Blood Magic NEI";
|
|
}
|
|
|
|
@Override
|
|
public String getVersion() {
|
|
return "1.3";
|
|
}
|
|
}
|