2015-08-29 23:01:13 +02:00
|
|
|
|
/*
|
|
|
|
|
* This file ("PageText.java") is part of the Actually Additions Mod for Minecraft.
|
|
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
|
* under the Actually Additions License to be found at
|
|
|
|
|
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
|
|
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
|
*
|
|
|
|
|
* <EFBFBD> 2015 Ellpeck
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package ellpeck.actuallyadditions.booklet.page;
|
|
|
|
|
|
|
|
|
|
import ellpeck.actuallyadditions.booklet.GuiBooklet;
|
2015-08-31 05:44:09 +02:00
|
|
|
|
import ellpeck.actuallyadditions.booklet.InitBooklet;
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
2015-08-29 23:01:13 +02:00
|
|
|
|
|
2015-09-10 21:25:34 +02:00
|
|
|
|
public class PageTextOnly extends BookletPage{
|
2015-08-29 23:01:13 +02:00
|
|
|
|
|
2015-08-31 05:44:09 +02:00
|
|
|
|
private ItemStack stack;
|
|
|
|
|
|
2015-09-10 21:25:34 +02:00
|
|
|
|
public PageTextOnly(int id){
|
2015-08-29 23:01:13 +02:00
|
|
|
|
super(id);
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-10 21:25:34 +02:00
|
|
|
|
public PageTextOnly setStack(ItemStack stack){
|
2015-08-31 05:44:09 +02:00
|
|
|
|
if(!InitBooklet.pagesWithItemStackData.contains(this)){
|
|
|
|
|
InitBooklet.pagesWithItemStackData.add(this);
|
|
|
|
|
}
|
|
|
|
|
this.stack = stack;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ItemStack getItemStackForPage(){
|
|
|
|
|
return this.stack;
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-29 23:01:13 +02:00
|
|
|
|
@Override
|
2015-08-31 05:44:09 +02:00
|
|
|
|
public void renderPre(GuiBooklet gui, int mouseX, int mouseY, boolean mouseClick){
|
2015-08-30 04:02:28 +02:00
|
|
|
|
String text = gui.currentPage.getText();
|
2015-09-14 11:02:16 +02:00
|
|
|
|
if(text != null && !text.isEmpty()){
|
2015-09-16 11:58:11 +02:00
|
|
|
|
gui.unicodeRenderer.drawSplitString(text, gui.guiLeft+14, gui.guiTop+9, 115, 0);
|
2015-08-30 04:02:28 +02:00
|
|
|
|
}
|
2015-08-29 23:01:13 +02:00
|
|
|
|
}
|
|
|
|
|
}
|