Formatting!

This commit is contained in:
WayofTime 2016-06-23 21:43:27 -04:00
parent d240daf958
commit 8c4eff0d81
30 changed files with 301 additions and 225 deletions

View file

@ -14,8 +14,6 @@ public class CategoryAlchemy
Map<ResourceLocation, EntryAbstract> entries = new LinkedHashMap<ResourceLocation, EntryAbstract>();
String keyBase = Constants.Mod.DOMAIN + "alchemy_";
return entries;
}
}

View file

@ -15,8 +15,6 @@ public class CategorySpell
Map<ResourceLocation, EntryAbstract> entries = new LinkedHashMap<ResourceLocation, EntryAbstract>();
String keyBase = Constants.Mod.DOMAIN + "spell_";
return entries;
}
}

View file

@ -16,19 +16,23 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.Collections;
import java.util.List;
public class EntryText extends EntryResourceLocation {
public class EntryText extends EntryResourceLocation
{
public EntryText(List<IPage> pageList, String unlocEntryName, boolean unicode) {
public EntryText(List<IPage> pageList, String unlocEntryName, boolean unicode)
{
super(pageList, unlocEntryName, new ResourceLocation("bloodmagicguide", "textures/gui/bullet_point.png"), unicode);
}
public EntryText(List<IPage> pageList, String unlocEntryName) {
public EntryText(List<IPage> pageList, String unlocEntryName)
{
this(pageList, unlocEntryName, false);
}
@Override
@SideOnly(Side.CLIENT)
public void drawExtras(Book book, CategoryAbstract category, int entryX, int entryY, int entryWidth, int entryHeight, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRendererObj) {
public void drawExtras(Book book, CategoryAbstract category, int entryX, int entryY, int entryWidth, int entryHeight, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRendererObj)
{
Minecraft.getMinecraft().getTextureManager().bindTexture(image);
GuiHelper.drawSizedIconWithoutColor(entryX + 4, entryY + 2, 8, 8, 1F);
@ -42,7 +46,8 @@ public class EntryText extends EntryResourceLocation {
if (strWidth > guiBase.xSize - 80 && strWidth > fontRendererObj.getStringWidth("..."))
cutString = true;
if (GuiHelper.isMouseBetween(mouseX, mouseY, entryX, entryY, entryWidth, entryHeight) && cutString) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, entryX, entryY, entryWidth, entryHeight) && cutString)
{
guiBase.drawHoveringText(Collections.singletonList(getLocalizedName()), entryX, entryY + 12);
fontRendererObj.setUnicodeFlag(unicode);

View file

@ -31,21 +31,24 @@ public class OrbRecipeRenderer implements IRecipeRenderer
}
@Override
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("gudieapi", "textures/gui/recipe_elements.png"));
guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 0, 105, 65);
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("text.recipe.shapedOrb"), guiLeft + guiBase.xSize / 2, guiTop + 12, 0);
if(recipe instanceof ShapelessBloodOrbRecipe)
if (recipe instanceof ShapelessBloodOrbRecipe)
{
ShapelessBloodOrbRecipe shapelessBloodOrbRecipe = (ShapelessBloodOrbRecipe) recipe;
List<Object> list = shapelessBloodOrbRecipe.getInput();
int width = 3;
int height = 3;
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
if(list.size() - 1 < y * width + x)
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
if (list.size() - 1 < y * width + x)
{
continue;
}
@ -54,21 +57,29 @@ public class OrbRecipeRenderer implements IRecipeRenderer
int stackY = (y + 1) * 18 + (guiTop + guiBase.ySize / 5);
Object component = list.get(y * width + x);
if (component != null) {
if (component instanceof ItemStack) {
if (component != null)
{
if (component instanceof ItemStack)
{
GuiHelper.drawItemStack((ItemStack) component, stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
guiBase.renderToolTip((ItemStack) component, stackX, stackY);
}
} else if (component instanceof Integer) {
} else if (component instanceof Integer)
{
GuiHelper.drawItemStack(OrbRegistry.getOrbsForTier((Integer) component).get(0), stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
guiBase.renderToolTip(OrbRegistry.getOrbsForTier((Integer) component).get(0), stackX, stackY);
}
} else {
if (((ArrayList<ItemStack>) component).isEmpty()) return;
} else
{
if (((ArrayList<ItemStack>) component).isEmpty())
return;
GuiHelper.drawItemStack(((ArrayList<ItemStack>) component).get(0), stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
guiBase.renderToolTip(((ArrayList<ItemStack>) component).get(0), stackX, stackY);
}
}
@ -78,34 +89,45 @@ public class OrbRecipeRenderer implements IRecipeRenderer
int outputX = (5 * 18) + (guiLeft + guiBase.xSize / 7);
int outputY = (2 * 18) + (guiTop + guiBase.xSize / 5);
GuiHelper.drawItemStack(shapelessBloodOrbRecipe.getRecipeOutput(), outputX, outputY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15))
{
guiBase.renderToolTip(shapelessBloodOrbRecipe.getRecipeOutput(), outputX, outputY);
}
}else if (recipe instanceof ShapedBloodOrbRecipe)
} else if (recipe instanceof ShapedBloodOrbRecipe)
{
ShapedBloodOrbRecipe shapedBloodOrbRecipe = (ShapedBloodOrbRecipe) recipe;
int width = ReflectionHelper.getPrivateValue(ShapedBloodOrbRecipe.class, shapedBloodOrbRecipe, 4);
int height = ReflectionHelper.getPrivateValue(ShapedBloodOrbRecipe.class, shapedBloodOrbRecipe, 5);
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
int stackX = (x + 1) * 18 + (guiLeft + guiBase.xSize / 7);
int stackY = (y + 1) * 18 + (guiTop + guiBase.ySize / 5);
Object component = shapedBloodOrbRecipe.getInput()[y * width + x];
if (component != null) {
if (component instanceof ItemStack) {
if (component != null)
{
if (component instanceof ItemStack)
{
GuiHelper.drawItemStack((ItemStack) component, stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
guiBase.renderToolTip((ItemStack) component, stackX, stackY);
}
} else if (component instanceof Integer) {
} else if (component instanceof Integer)
{
GuiHelper.drawItemStack(OrbRegistry.getOrbsForTier((Integer) component).get(0), stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
guiBase.renderToolTip(OrbRegistry.getOrbsForTier((Integer) component).get(0), stackX, stackY);
}
} else {
if (((ArrayList<ItemStack>) component).isEmpty()) return;
} else
{
if (((ArrayList<ItemStack>) component).isEmpty())
return;
GuiHelper.drawItemStack(((ArrayList<ItemStack>) component).get(0), stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
guiBase.renderToolTip(((ArrayList<ItemStack>) component).get(0), stackX, stackY);
}
}
@ -115,14 +137,16 @@ public class OrbRecipeRenderer implements IRecipeRenderer
int outputX = (5 * 18) + (guiLeft + guiBase.xSize / 7);
int outputY = (2 * 18) + (guiTop + guiBase.xSize / 5);
GuiHelper.drawItemStack(shapedBloodOrbRecipe.getRecipeOutput(), outputX, outputY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) {
if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15))
{
guiBase.renderToolTip(shapedBloodOrbRecipe.getRecipeOutput(), outputX, outputY);
}
}
}
@Override
public void drawExtras(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) {
public void drawExtras(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer)
{
}
}

View file

@ -120,7 +120,8 @@ public class DataProviderBloodAltar implements IWailaDataProvider
return false;
}
private static boolean holdingSeerSigil(EntityPlayer player) {
private static boolean holdingSeerSigil(EntityPlayer player)
{
if (player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ItemSigilSeer)
return true;
@ -130,7 +131,8 @@ public class DataProviderBloodAltar implements IWailaDataProvider
return false;
}
private static boolean holdingDivinationSigil(EntityPlayer player) {
private static boolean holdingDivinationSigil(EntityPlayer player)
{
if (player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ItemSigilDivination)
return true;