Fruitful work on .txt document parser
This commit is contained in:
parent
815dc167dd
commit
1c806c4328
13 changed files with 557 additions and 17 deletions
|
@ -0,0 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.book.entries;
|
||||
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
|
||||
public class EntryCraftingRecipeCustomText extends EntryCraftingRecipe implements IEntryCustomText
|
||||
{
|
||||
|
||||
public EntryCraftingRecipeCustomText(IRecipe recipes)
|
||||
{
|
||||
super(recipes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setText(String str){}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package WayofTime.alchemicalWizardry.book.entries;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry;
|
||||
|
||||
public class EntryImageCustomText extends EntryImage implements IEntryCustomText
|
||||
{
|
||||
public EntryImageCustomText(String resource, int iconWidth, int iconHeight)
|
||||
{
|
||||
super(resource, iconWidth, iconHeight);
|
||||
}
|
||||
|
||||
public EntryImageCustomText(String resource, int iconWidth, int iconHeight, String entryName)
|
||||
{
|
||||
super(resource, iconWidth, iconHeight, entryName);
|
||||
}
|
||||
|
||||
public String str = "";
|
||||
|
||||
@Override
|
||||
public String getText()
|
||||
{
|
||||
return str;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setText(String str)
|
||||
{
|
||||
this.str = str;
|
||||
}
|
||||
|
||||
public void drawText(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if(this.entryName == null)
|
||||
this.entryName = key;
|
||||
|
||||
String s = this.str;
|
||||
x = left + width / 2 - 58;
|
||||
y = (top + 15) + 65;
|
||||
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true);
|
||||
Minecraft.getMinecraft().fontRenderer.drawSplitString(s, x, y, 110, 0);
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false);
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package WayofTime.alchemicalWizardry.book.entries;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import WayofTime.alchemicalWizardry.book.classes.guide.GuiEntry;
|
||||
|
||||
public class EntryTextCustomText extends EntryText implements IEntryCustomText
|
||||
{
|
||||
public String str = "";
|
||||
|
||||
@Override
|
||||
public String getText()
|
||||
{
|
||||
return str;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setText(String str)
|
||||
{
|
||||
this.str = str;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(GuiEntry entry, int width, int height, int left, int top, EntityPlayer player, String key, int page, int mX, int mY){
|
||||
int x, y;
|
||||
|
||||
if(this.entryName == null)
|
||||
this.entryName = key;
|
||||
|
||||
String s = this.str;
|
||||
x = left + width / 2 - 58;
|
||||
y = (top + 15);
|
||||
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(true);
|
||||
Minecraft.getMinecraft().fontRenderer.drawSplitString(s, x, y, 110, 0);
|
||||
Minecraft.getMinecraft().fontRenderer.setUnicodeFlag(false);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.book.entries;
|
||||
|
||||
public interface IEntryCustomText extends IEntry
|
||||
{
|
||||
public String getText();
|
||||
public void setText(String str);
|
||||
}
|
|
@ -43,6 +43,7 @@ public class EntryRegistry
|
|||
public static HashMap<String, Entry> basics = new HashMap<String, Entry>();
|
||||
public static HashMap<String, Entry> rituals = new HashMap<String, Entry>();
|
||||
public static HashMap<String, Entry> bloodUtils = new HashMap<String, Entry>();
|
||||
public static HashMap<String, Entry> test = new HashMap();
|
||||
|
||||
public static Entry[] getEntriesInOrderForCategory(Category category)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue