Fix formatting + tooltips
This commit is contained in:
parent
8d5e9c125b
commit
f21e97063a
|
@ -3,21 +3,25 @@ package WayofTime.bloodmagic.compat.guideapi;
|
||||||
import WayofTime.bloodmagic.compat.ICompatibility;
|
import WayofTime.bloodmagic.compat.ICompatibility;
|
||||||
import WayofTime.bloodmagic.compat.guideapi.guide.GuideBloodMagic;
|
import WayofTime.bloodmagic.compat.guideapi.guide.GuideBloodMagic;
|
||||||
|
|
||||||
public class CompatibilityGuideAPI implements ICompatibility {
|
public class CompatibilityGuideAPI implements ICompatibility
|
||||||
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadCompatibility(InitializationPhase phase) {
|
public void loadCompatibility(InitializationPhase phase)
|
||||||
|
{
|
||||||
if (phase == InitializationPhase.PRE_INIT)
|
if (phase == InitializationPhase.PRE_INIT)
|
||||||
GuideBloodMagic.initGuide();
|
GuideBloodMagic.initGuide();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getModId() {
|
public String getModId()
|
||||||
|
{
|
||||||
return "guideapi";
|
return "guideapi";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean enableCompat() {
|
public boolean enableCompat()
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,14 +32,16 @@ import java.awt.Color;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class GuideBloodMagic {
|
public class GuideBloodMagic
|
||||||
|
{
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private static Book bloodMagicGuide;
|
private static Book bloodMagicGuide;
|
||||||
|
|
||||||
public static List<CategoryAbstract> categories = new ArrayList<CategoryAbstract>();
|
public static List<CategoryAbstract> categories = new ArrayList<CategoryAbstract>();
|
||||||
|
|
||||||
public static void initGuide() {
|
public static void initGuide()
|
||||||
|
{
|
||||||
bloodMagicGuide = new Book();
|
bloodMagicGuide = new Book();
|
||||||
bloodMagicGuide.setAuthor("guide.BloodMagic.book.author");
|
bloodMagicGuide.setAuthor("guide.BloodMagic.book.author");
|
||||||
bloodMagicGuide.setUnlocBookTitle("guide.BloodMagic.book.title");
|
bloodMagicGuide.setUnlocBookTitle("guide.BloodMagic.book.title");
|
||||||
|
@ -56,7 +58,8 @@ public class GuideBloodMagic {
|
||||||
ModelLoader.setCustomModelResourceLocation(GuideAPIItems.guideBook, GuideRegistry.getIndexOf(bloodMagicGuide), new ModelResourceLocation(new ResourceLocation("guideapi", "ItemGuideBook"), "type=book"));
|
ModelLoader.setCustomModelResourceLocation(GuideAPIItems.guideBook, GuideRegistry.getIndexOf(bloodMagicGuide), new ModelResourceLocation(new ResourceLocation("guideapi", "ItemGuideBook"), "type=book"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addArchitect() {
|
private static void addArchitect()
|
||||||
|
{
|
||||||
List<EntryAbstract> entries = new ArrayList<EntryAbstract>();
|
List<EntryAbstract> entries = new ArrayList<EntryAbstract>();
|
||||||
|
|
||||||
List<IPage> introPages = new ArrayList<IPage>();
|
List<IPage> introPages = new ArrayList<IPage>();
|
||||||
|
|
|
@ -25,7 +25,8 @@ public class PageAltarRecipe extends PageBase {
|
||||||
public EnumAltarTier tier;
|
public EnumAltarTier tier;
|
||||||
public int bloodRequired;
|
public int bloodRequired;
|
||||||
|
|
||||||
public PageAltarRecipe(AltarRecipeRegistry.AltarRecipe recipe) {
|
public PageAltarRecipe(AltarRecipeRegistry.AltarRecipe recipe)
|
||||||
|
{
|
||||||
this.input = recipe.getInput();
|
this.input = recipe.getInput();
|
||||||
this.output = recipe.getOutput();
|
this.output = recipe.getOutput();
|
||||||
this.tier = recipe.getMinTier();
|
this.tier = recipe.getMinTier();
|
||||||
|
@ -34,8 +35,8 @@ public class PageAltarRecipe extends PageBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) {
|
public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer)
|
||||||
|
{
|
||||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("bloodmagicguide" + ":textures/gui/altar.png"));
|
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("bloodmagicguide" + ":textures/gui/altar.png"));
|
||||||
guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 87, 146, 104);
|
guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 87, 146, 104);
|
||||||
|
|
||||||
|
@ -44,25 +45,26 @@ public class PageAltarRecipe extends PageBase {
|
||||||
int inputX = (1 + 1) * 20 + (guiLeft + guiBase.xSize / 7) + 1;
|
int inputX = (1 + 1) * 20 + (guiLeft + guiBase.xSize / 7) + 1;
|
||||||
int inputY = (20) + (guiTop + guiBase.ySize / 5) - 1; //1 * 20
|
int inputY = (20) + (guiTop + guiBase.ySize / 5) - 1; //1 * 20
|
||||||
GuiHelper.drawItemStack(input, inputX, inputY);
|
GuiHelper.drawItemStack(input, inputX, inputY);
|
||||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, inputX, inputY, 15, 15)) {
|
|
||||||
guiBase.renderToolTip(input, mouseX, mouseY);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (output == null) {
|
if (output == null)
|
||||||
output = new ItemStack(Blocks.barrier);
|
output = new ItemStack(Blocks.barrier);
|
||||||
}
|
|
||||||
int outputX = (5 * 20) + (guiLeft + guiBase.xSize / 7) + 1;
|
int outputX = (5 * 20) + (guiLeft + guiBase.xSize / 7) + 1;
|
||||||
int outputY = (20) + (guiTop + guiBase.xSize / 5) - 1; // 1 * 20
|
int outputY = (20) + (guiTop + guiBase.xSize / 5) - 1; // 1 * 20
|
||||||
GuiHelper.drawItemStack(output, outputX, outputY);
|
GuiHelper.drawItemStack(output, outputX, outputY);
|
||||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) {
|
|
||||||
guiBase.renderToolTip(output, outputX, outputY);
|
if (GuiHelper.isMouseBetween(mouseX, mouseY, inputX, inputY, 15, 15))
|
||||||
|
guiBase.renderToolTip(input, mouseX, mouseY);
|
||||||
|
|
||||||
|
if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15))
|
||||||
|
guiBase.renderToolTip(output, mouseX, mouseY);
|
||||||
|
|
||||||
|
if (output.getItem() == Item.getItemFromBlock(Blocks.barrier))
|
||||||
|
{
|
||||||
|
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("text.furnace.error"), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0xED073D);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (output.getItem() == Item.getItemFromBlock(Blocks.barrier)) {
|
|
||||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("text.furnace.error"), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0xED073D);
|
|
||||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("guide.BloodMagic.page.tier", tier.toInt()), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0);
|
|
||||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("guide.BloodMagic.page.lp", bloodRequired), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 30, 0);
|
|
||||||
}
|
|
||||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("guide.BloodMagic.page.tier", tier.toInt()), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0);
|
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("guide.BloodMagic.page.tier", tier.toInt()), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0);
|
||||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("guide.BloodMagic.page.lp", bloodRequired), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0);
|
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("guide.BloodMagic.page.lp", bloodRequired), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue