mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-17 19:05:02 +00:00
Revamp the NEI meteor handler.
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.
This commit is contained in:
1 parent
09fbb5574b
commit
b02fa2f32d
9 files changed
+404
-20
No files matched your search
@@ -13,6 +13,7 @@ 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) {
|
||||
@@ -44,6 +45,19 @@ public class NEIConfig implements IConfigureNEI {
|
||||
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());
|
||||
|
||||
+125
-15
@@ -1,51 +1,70 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei;
|
||||
|
||||
import static WayofTime.alchemicalWizardry.client.ClientUtils.mc;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import WayofTime.alchemicalWizardry.client.nei.widgets.CostInfo;
|
||||
import WayofTime.alchemicalWizardry.client.nei.widgets.RadiusInfo;
|
||||
import WayofTime.alchemicalWizardry.client.nei.widgets.ReagentInfo;
|
||||
import WayofTime.alchemicalWizardry.client.nei.widgets.RitualInfo;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.Meteor;
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorComponent;
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorReagent;
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorReagentRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
|
||||
public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
private static final RitualInfo ritualInfo = new RitualInfo("AW019FallingTower", 0.75f);
|
||||
private static final ReagentInfo reagentInfo = new ReagentInfo(0.75f);
|
||||
|
||||
public class CachedMeteorRecipe extends CachedRecipe {
|
||||
|
||||
private final List<PositionedStack> input = new ArrayList<>();
|
||||
private final List<PositionedStack> outputs = new ArrayList<>();
|
||||
private final int cost;
|
||||
private final int radius;
|
||||
private final CostInfo costInfo;
|
||||
private final RadiusInfo radiusInfo;
|
||||
private Point focus;
|
||||
|
||||
public float fillerChance;
|
||||
|
||||
public CachedMeteorRecipe(Meteor meteor, ItemStack focusStack) {
|
||||
this.input.add(new PositionedStack(meteor.focusItem, 74, 4));
|
||||
this.input.add(new PositionedStack(meteor.focusItem, 75, 4));
|
||||
int row = 0;
|
||||
int col = 0;
|
||||
|
||||
float totalComponentWeight = MeteorComponent.getTotalListWeight(meteor.ores);
|
||||
float fillerChance = meteor.fillerChance;
|
||||
fillerChance = meteor.fillerChance;
|
||||
List<MeteorComponent> sortedComponents = new ArrayList<>(meteor.ores);
|
||||
sortedComponents.sort(Comparator.comparingInt(c -> -c.getWeight()));
|
||||
|
||||
@@ -115,8 +134,8 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
}
|
||||
|
||||
this.radius = meteor.radius;
|
||||
this.cost = meteor.cost;
|
||||
this.costInfo = new CostInfo(meteor.cost);
|
||||
this.radiusInfo = new RadiusInfo(meteor.radius);
|
||||
}
|
||||
|
||||
private String getReagentStrings(MeteorComponent component) {
|
||||
@@ -144,11 +163,11 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
|
||||
public int getCost() {
|
||||
return cost;
|
||||
return costInfo.getCost();
|
||||
}
|
||||
|
||||
public int getRadius() {
|
||||
return radius;
|
||||
return radiusInfo.getRadius();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,12 +257,10 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
@Override
|
||||
public void drawExtras(int recipe) {
|
||||
CachedMeteorRecipe meteorRecipe = (CachedMeteorRecipe) this.arecipes.get(recipe);
|
||||
int cost = meteorRecipe.getCost();
|
||||
int radius = meteorRecipe.getRadius();
|
||||
Minecraft.getMinecraft().fontRenderer
|
||||
.drawString(I18n.format("nei.recipe.meteor.cost", String.format("%,d", cost)), 2, 168, 0x000000);
|
||||
Minecraft.getMinecraft().fontRenderer
|
||||
.drawString(I18n.format("nei.recipe.meteor.radius", radius), 2, 179, 0x000000);
|
||||
meteorRecipe.costInfo.onDraw(30, 4);
|
||||
meteorRecipe.radiusInfo.onDraw(120, 4);
|
||||
ritualInfo.onDraw(0, 0);
|
||||
reagentInfo.onDraw(153, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -275,6 +292,91 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleTooltip(GuiRecipe<?> gui, List<String> list, int recipeIndex) {
|
||||
if (GuiContainerManager.shouldShowTooltip(gui) && list.isEmpty()) {
|
||||
CachedRecipe cRecipe = arecipes.get(recipeIndex);
|
||||
Point mousePos = GuiDraw.getMousePosition();
|
||||
|
||||
if (cRecipe instanceof CachedMeteorRecipe) {
|
||||
CachedMeteorRecipe cachedRecipe = (CachedMeteorRecipe) cRecipe;
|
||||
Rectangle rect = cachedRecipe.costInfo.getRect(gui);
|
||||
if (rect.contains(mousePos)) {
|
||||
list.add(StatCollector.translateToLocal("nei.recipe.meteor.cost"));
|
||||
if (SoulNetworkHandler.getCurrentEssence(mc.thePlayer.getDisplayName()) < cachedRecipe.getCost()) {
|
||||
list.add(EnumChatFormatting.RED + StatCollector.translateToLocal("nei.recipe.meteor.tooExpensive"));
|
||||
}
|
||||
}
|
||||
|
||||
rect = cachedRecipe.radiusInfo.getRect(gui);
|
||||
if (rect.contains(mousePos)) {
|
||||
list.add(
|
||||
StatCollector.translateToLocalFormatted(
|
||||
"nei.recipe.meteor.diameter",
|
||||
2 * cachedRecipe.radiusInfo.getRadius() + 1));
|
||||
}
|
||||
|
||||
rect = ritualInfo.getRect(gui);
|
||||
if (rect.contains(mousePos)) {
|
||||
ritualInfo.onHover(list);
|
||||
}
|
||||
|
||||
rect = reagentInfo.getRect(gui);
|
||||
if (rect.contains(mousePos)) {
|
||||
list.add(StatCollector.translateToLocal("nei.recipe.reagent.text"));
|
||||
addMeteorReagentInfo(list, cachedRecipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.handleTooltip(gui, list, recipeIndex);
|
||||
}
|
||||
|
||||
private void addMeteorReagentInfo(List<String> list, CachedMeteorRecipe cachedRecipe) {
|
||||
DecimalFormat fmt = new DecimalFormat("###.##");
|
||||
for (Map.Entry<Reagent, MeteorReagent> entry : MeteorReagentRegistry.reagents.entrySet()) {
|
||||
ArrayList<String> l = new ArrayList<>();
|
||||
Reagent r = entry.getKey();
|
||||
MeteorReagent mr = entry.getValue();
|
||||
|
||||
if (mr.radiusChange != 0) {
|
||||
l.add(
|
||||
StatCollector.translateToLocalFormatted(
|
||||
"nei.recipe.reagent.meteor.radius",
|
||||
mr.radiusChange,
|
||||
Meteor.getNewRadius(cachedRecipe.getRadius(), Collections.singletonList(r))));
|
||||
}
|
||||
|
||||
if (cachedRecipe.fillerChance > 0) {
|
||||
if (mr.fillerChanceChange != 0 || mr.rawFillerChanceChange != 0) {
|
||||
l.add(
|
||||
StatCollector.translateToLocalFormatted(
|
||||
"nei.recipe.reagent.meteor.filler.chance",
|
||||
fmt.format(Meteor.getNewFillerChance(
|
||||
cachedRecipe.fillerChance,
|
||||
Collections.singletonList(r)))));
|
||||
}
|
||||
|
||||
if (!mr.filler.isEmpty()) {
|
||||
l.add(
|
||||
StatCollector.translateToLocalFormatted("nei.recipe.reagent.meteor.filler.blocks", reagentFillerBlockNames(mr)));
|
||||
}
|
||||
}
|
||||
|
||||
if (mr.disableExplosions) {
|
||||
l.add(StatCollector.translateToLocal("nei.recipe.reagent.meteor.explosions"));
|
||||
} else if (mr.invertExplosionBlockDamage && AlchemicalWizardry.doMeteorsDestroyBlocks) {
|
||||
l.add(StatCollector.translateToLocal("nei.recipe.reagent.meteor.blockDamage.off"));
|
||||
} else if (mr.invertExplosionBlockDamage) {
|
||||
l.add(StatCollector.translateToLocal("nei.recipe.reagent.meteor.blockDamage.on"));
|
||||
}
|
||||
|
||||
if (!l.isEmpty()) {
|
||||
list.add(r.name + ":");
|
||||
list.addAll(l);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return I18n.format("nei.recipe.meteor.category");
|
||||
@@ -292,4 +394,12 @@ public class NEIMeteorRecipeHandler extends TemplateRecipeHandler {
|
||||
private int getEstimatedAmount(float chance, int radius) {
|
||||
return (int) Math.ceil(4f / 3 * Math.PI * Math.pow(radius + 0.5, 3) * chance);
|
||||
}
|
||||
|
||||
private String reagentFillerBlockNames(MeteorReagent mr) {
|
||||
ArrayList<String> blockNames = new ArrayList<>();
|
||||
for (MeteorComponent mc : mr.filler) {
|
||||
blockNames.add(mc.getBlock().getDisplayName());
|
||||
}
|
||||
return Joiner.on(", ").join(blockNames);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei.widgets;
|
||||
|
||||
import static WayofTime.alchemicalWizardry.client.ClientUtils.mc;
|
||||
import static WayofTime.alchemicalWizardry.client.nei.NEIConfig.getBloodOrbs;
|
||||
import static WayofTime.alchemicalWizardry.client.nei.NEIConfig.getOrbsByCapacity;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
|
||||
public class CostInfo {
|
||||
|
||||
private final int cost;
|
||||
private int prevX, prevY;
|
||||
private final int orbLP;
|
||||
private final ItemStack orbStack;
|
||||
private static final RenderItem renderItem = new RenderItem();
|
||||
static {
|
||||
renderItem.renderWithColor = false;
|
||||
}
|
||||
|
||||
public CostInfo(int cost) {
|
||||
this.cost = cost;
|
||||
|
||||
Item orb = null;
|
||||
getOrbsByCapacity();
|
||||
ArrayList<Item> orbList = getBloodOrbs();
|
||||
for (Item o : orbList) {
|
||||
if (((IBloodOrb) o).getMaxEssence() >= cost) {
|
||||
orb = o;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (orb == null) {
|
||||
orb = orbList.get(orbList.size() - 1);
|
||||
}
|
||||
|
||||
orbLP = ((IBloodOrb) orb).getMaxEssence();
|
||||
orbStack = new ItemStack(orb);
|
||||
}
|
||||
|
||||
public int getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
public void onDraw(int x, int y) {
|
||||
prevX = x;
|
||||
prevY = y;
|
||||
|
||||
int currentLP = SoulNetworkHandler.getCurrentEssence(mc.thePlayer.getDisplayName());
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
if (orbLP > currentLP) {
|
||||
GL11.glColor4f(0.4f, 0.4f, 0.4f, 1.0f);
|
||||
} else {
|
||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
renderItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), orbStack, x, y);
|
||||
|
||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
String costText = String.format("%,d", cost);
|
||||
FontRenderer fontRenderer = mc.fontRenderer;
|
||||
|
||||
int textWidth = fontRenderer.getStringWidth(costText);
|
||||
int textX = x + 9 - (textWidth / 2);
|
||||
int textY = y + 18;
|
||||
|
||||
fontRenderer.drawString(costText, textX, textY, 0x000000);
|
||||
}
|
||||
|
||||
public Rectangle getRect(GuiRecipe<?> gui) {
|
||||
return new Rectangle(gui.guiLeft + prevX + 4, gui.guiTop + prevY + 14, 18, 18);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei.widgets;
|
||||
|
||||
import static WayofTime.alchemicalWizardry.client.ClientUtils.mc;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
|
||||
public class RadiusInfo {
|
||||
|
||||
private final int radius;
|
||||
private int prevX, prevY;
|
||||
private static final RenderItem renderItem = new RenderItem();
|
||||
// It's a circle with a dot in the center. Couldn't ask for a better item!
|
||||
private static final ItemStack item = new ItemStack(ModItems.demonPlacer);
|
||||
|
||||
public RadiusInfo(int radius) {
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public int getRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
public void onDraw(int x, int y) {
|
||||
prevX = x;
|
||||
prevY = y;
|
||||
|
||||
renderItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), item, x, y);
|
||||
|
||||
String costText = StatCollector.translateToLocalFormatted("nei.recipe.meteor.radius", radius);
|
||||
FontRenderer fontRenderer = mc.fontRenderer;
|
||||
|
||||
int textWidth = fontRenderer.getStringWidth(costText);
|
||||
int textX = x + 9 - (textWidth / 2);
|
||||
int textY = y + 18;
|
||||
|
||||
fontRenderer.drawString(costText, textX, textY, 0x000000);
|
||||
}
|
||||
|
||||
public Rectangle getRect(GuiRecipe<?> gui) {
|
||||
return new Rectangle(gui.guiLeft + prevX + 5, gui.guiTop + prevY + 15, 16, 16);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei.widgets;
|
||||
|
||||
import static WayofTime.alchemicalWizardry.client.ClientUtils.mc;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
|
||||
public class ReagentInfo {
|
||||
|
||||
private final float scale;
|
||||
private int prevX, prevY;
|
||||
private static final RenderItem renderItem = new RenderItem();
|
||||
private static final ItemStack item = new ItemStack(ModBlocks.blockReagentConduit);
|
||||
|
||||
public ReagentInfo(float scale) {
|
||||
this.scale = scale;
|
||||
}
|
||||
|
||||
public void onDraw(int x, int y) {
|
||||
prevX = x;
|
||||
prevY = y;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(x, y, 0);
|
||||
GL11.glScalef(scale, scale, 1.0f);
|
||||
renderItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), item, 0, 0);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public Rectangle getRect(GuiRecipe<?> gui) {
|
||||
return new Rectangle(gui.guiLeft + prevX + 4, gui.guiTop + prevY + 14, (int) (18 * scale), (int) (18 * scale));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package WayofTime.alchemicalWizardry.client.nei.widgets;
|
||||
|
||||
import static WayofTime.alchemicalWizardry.client.ClientUtils.mc;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
|
||||
public class RitualInfo {
|
||||
|
||||
private final String id;
|
||||
private final int cost;
|
||||
private final float scale;
|
||||
private final ItemStack crystal;
|
||||
private int prevX, prevY;
|
||||
private static final RenderItem renderItem = new RenderItem();
|
||||
|
||||
public RitualInfo(String id, float scale) {
|
||||
this.id = id;
|
||||
this.scale = scale;
|
||||
this.cost = Rituals.getCostForActivation(id);
|
||||
Rituals r = Rituals.ritualMap.get(id);
|
||||
|
||||
// This is hardcoded unlike the orbs. I'm not aware of any addon that makes tier 3 rituals or crystals.
|
||||
if (r == null || r.crystalLevel == 1) {
|
||||
crystal = new ItemStack(ModItems.activationCrystal);
|
||||
} else {
|
||||
crystal = new ItemStack(ModItems.activationCrystal, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public int getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
public void onDraw(int x, int y) {
|
||||
prevX = x;
|
||||
prevY = y;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(x, y, 0);
|
||||
GL11.glScalef(scale, scale, 1.0f);
|
||||
renderItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), crystal, 0, 0);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public Rectangle getRect(GuiRecipe<?> gui) {
|
||||
return new Rectangle(gui.guiLeft + prevX + 4, gui.guiTop + prevY + 14, (int) (18 * scale), (int) (18 * scale));
|
||||
}
|
||||
|
||||
public void onHover(List<String> list) {
|
||||
list.add(
|
||||
StatCollector
|
||||
.translateToLocalFormatted("nei.recipe.ritual.name", Rituals.getLocalizedNameOfRitual(id)));
|
||||
list.add(StatCollector.translateToLocalFormatted("nei.recipe.ritual.cost", this.cost));
|
||||
}
|
||||
}
|
||||
@@ -87,13 +87,13 @@ public class Meteor {
|
||||
}
|
||||
}
|
||||
|
||||
private int getNewRadius(int radius, List<Reagent> reagents) {
|
||||
public static int getNewRadius(int radius, List<Reagent> reagents) {
|
||||
radius += MeteorReagentRegistry.getLargestRadiusIncrease(reagents);
|
||||
radius += MeteorReagentRegistry.getLargestRadiusDecrease(reagents);
|
||||
return Math.max(radius, 1);
|
||||
}
|
||||
|
||||
private float getNewFillerChance(float fillerChance, List<Reagent> reagents) {
|
||||
public static float getNewFillerChance(float fillerChance, List<Reagent> reagents) {
|
||||
// Don't add filler to meteors that have none
|
||||
if (fillerChance <= 0) {
|
||||
return 0;
|
||||
@@ -120,7 +120,7 @@ public class Meteor {
|
||||
* @return a new filler list. The original list is entirely replaced if any of the supplied reagents have a filler
|
||||
* config.
|
||||
*/
|
||||
private List<MeteorComponent> getNewFillerList(List<MeteorComponent> fillerList, List<Reagent> reagents) {
|
||||
public static List<MeteorComponent> getNewFillerList(List<MeteorComponent> fillerList, List<Reagent> reagents) {
|
||||
List<MeteorComponent> reagentFillers = getFillerList(reagents);
|
||||
reagentFillers = removeBlocksMissingRequiredReagents(reagentFillers, reagents);
|
||||
if (!reagentFillers.isEmpty() && reagentFillers.get(0) != defaultMeteorBlock) {
|
||||
@@ -129,7 +129,7 @@ public class Meteor {
|
||||
return removeBlocksMissingRequiredReagents(fillerList, reagents);
|
||||
}
|
||||
|
||||
private List<MeteorComponent> removeBlocksMissingRequiredReagents(List<MeteorComponent> blockList,
|
||||
public static List<MeteorComponent> removeBlocksMissingRequiredReagents(List<MeteorComponent> blockList,
|
||||
List<Reagent> reagents) {
|
||||
ArrayList<MeteorComponent> newList = new ArrayList<>();
|
||||
for (MeteorComponent component : blockList) {
|
||||
|
||||
Reference in new issue
Block a user