diff options
Diffstat (limited to 'src/Java/miscutil/core')
40 files changed, 2158 insertions, 0 deletions
diff --git a/src/Java/miscutil/core/CommonProxy.java b/src/Java/miscutil/core/CommonProxy.java new file mode 100644 index 0000000000..8b0f6c8b2a --- /dev/null +++ b/src/Java/miscutil/core/CommonProxy.java @@ -0,0 +1,70 @@ +package miscutil.core; + +import miscutil.core.block.ModBlocks; +import miscutil.core.gui.ModGUI; +import miscutil.core.item.ModItems; +import miscutil.core.lib.Strings; +import miscutil.core.tileentities.ModTileEntities; +import miscutil.core.util.Utils; +import miscutil.gregtech.init.InitGregtech; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class CommonProxy { + + public void preInit(FMLPreInitializationEvent e) { + ModItems.init(); + ModBlocks.init(); + + + //Register Gregtech related items + if (Loader.isModLoaded("gregtech") == true) { + Utils.LOG_INFO("Gregtech Found - Loading Resources."); + Strings.GREGTECH = true; + Utils.LOG_INFO("Begining registration & initialization of Gregtech related content."); + // Init Gregtech + InitGregtech.run(); + + } + else { + Utils.LOG_WARNING("Gregtech not Found - Skipping Resources."); + Strings.GREGTECH = false; + } + + } + + public void init(FMLInitializationEvent e) { + + + + } + + public void postInit(FMLPostInitializationEvent e) { + + } + + public void registerNetworkStuff(){ + ModGUI.init(); + //NetworkRegistry.INSTANCE.registerGuiHandler(MiscUtils.instance, new BloodSteelFurnaceGuiHandler()); + + } + + public void registerTileEntities(){ + ModTileEntities.init(); + //GameRegistry.registerTileEntity(TileEntityBloodSteelChest.class, "tileEntityBloodSteelChest"); + //GameRegistry.registerTileEntity(TileEntityBloodSteelFurnace.class, "tileEntityBloodSteelFurnace"); + //GameRegistry.registerTileEntity(TileEntityBloodSteelChest.class, Strings.MODID); + //GameRegistry.registerTileEntity(TileEntityArcaneInfuser.class, "TileEntityArcaneInfuser"); + } + + public void registerRenderThings() { + + } + + public int addArmor(String armor) { + return 0; + } + +} diff --git a/src/Java/miscutil/core/block/AdvancedBlock.java b/src/Java/miscutil/core/block/AdvancedBlock.java new file mode 100644 index 0000000000..2a81341838 --- /dev/null +++ b/src/Java/miscutil/core/block/AdvancedBlock.java @@ -0,0 +1,31 @@ +package miscutil.core.block; + +import miscutil.core.lib.Strings; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +public class AdvancedBlock extends Block { + + protected AdvancedBlock(String unlocalizedName, Material material, CreativeTabs x, float blockHardness, float blockResistance, float blockLightLevel, + String blockHarvestTool, int blockHarvestLevel, SoundType BlockSound) { + super(material); + this.setBlockName(unlocalizedName); + this.setBlockTextureName(Strings.MODID + ":" + unlocalizedName); + this.setCreativeTab(x); + this.setHardness(blockHardness); //block Hardness + this.setResistance(blockResistance); + this.setLightLevel(blockLightLevel); + this.setHarvestLevel(blockHarvestTool, blockHarvestLevel); + this.setStepSound(BlockSound); + } + + @Override + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) + { + return false; + } + +} diff --git a/src/Java/miscutil/core/block/BasicBlock.java b/src/Java/miscutil/core/block/BasicBlock.java new file mode 100644 index 0000000000..63c1044b03 --- /dev/null +++ b/src/Java/miscutil/core/block/BasicBlock.java @@ -0,0 +1,22 @@ +package miscutil.core.block; + +import miscutil.core.creativetabs.TMCreativeTabs; +import miscutil.core.lib.Strings; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; + +public class BasicBlock extends Block { + + protected BasicBlock(String unlocalizedName, Material material) { + super(material); + this.setBlockName(unlocalizedName); + this.setBlockTextureName(Strings.MODID + ":" + unlocalizedName); + this.setCreativeTab(TMCreativeTabs.tabBlock); + this.setHardness(2.0F); + this.setResistance(6.0F); + this.setLightLevel(0.0F); + this.setHarvestLevel("pickaxe", 2); + this.setStepSound(soundTypeMetal); + } + +} diff --git a/src/Java/miscutil/core/block/ModBlocks.java b/src/Java/miscutil/core/block/ModBlocks.java new file mode 100644 index 0000000000..7f1df843be --- /dev/null +++ b/src/Java/miscutil/core/block/ModBlocks.java @@ -0,0 +1,90 @@ +package miscutil.core.block; + +import miscutil.core.util.Utils; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import cpw.mods.fml.common.registry.GameRegistry; + +public final class ModBlocks { + + //Blood Steel + public static Block blockBloodSteel; + public static Block blockStaballoy; + public static Block blockToolBuilder; + //public static Block blockBloodSteelChest; + + //BloodSteelorial Furnace + //public static Block tutFurnace; + //public static Block tutFurnaceActive; + + //BloodSteelorial Chest + //public static Block tutChest; + + //Arcane Infuser + //public static Block arcaneInfuser; + //public static Block arcaneInfuserActive; + + //Block Storage + //public static Block emxBlockStorage; + + + public static void init() { + Utils.LOG_INFO("Initializing Blocks."); + //BloodSteelorial Furnace - Must Init blocks first as they're not static. + /** if (Strings.DEBUG){ + FMLLog.info("Loading Furnace.");} + tutFurnace= new BloodSteelFurnace(false).setBlockName("BloodSteelFurnace").setCreativeTab(TMCreativeTabs.tabBlock); + tutFurnaceActive= new BloodSteelFurnace(true).setBlockName("BloodSteelFurnaceActive"); + + //Arcane Infuser - Must Init blocks first as they're not static. + if (Strings.DEBUG){ + FMLLog.info("Loading Arcane Infuser.");} + arcaneInfuser = new ArcaneInfuser(false).setBlockName("ArcaneInfuser").setCreativeTab(TMCreativeTabs.tabBlock); + arcaneInfuserActive = new ArcaneInfuser(true).setBlockName("ArcaneInfuserActive"); + + //Blood Steel Chest + if (Strings.DEBUG){ + FMLLog.info("Loading Blood Steel Chest.");} + tutChest = new BloodSteelChest(0).setBlockName("BloodSteelChest").setCreativeTab(TMCreativeTabs.tabBlock); + + */ + //BlockStorage + //emxBlockStorage = new BlockStorage(); + + //Register Blocks next - TODO + registerBlocks(); + } + + public static void registerBlocks(){ + + Utils.LOG_INFO("Registering Blocks."); + + //Blood Steel Block + GameRegistry.registerBlock(blockBloodSteel = new BasicBlock("blockBloodSteel", Material.iron), "blockBloodSteel"); + + //Staballoy Block + GameRegistry.registerBlock(blockStaballoy = new BasicBlock("blockStaballoy", Material.iron), "blockStaballoy"); + + //Blood Steel Block //Name, Material, Hardness, Resistance, Light level, Tool, tool level, sound + //GameRegistry.registerBlock(blockToolBuilder = new AdvancedBlock("blockToolBuilder", Material.circuits, TMCreativeTabs.tabMachines, 1F, 5F, 0F, "pickaxe", 1, Block.soundTypeWood), "blockToolBuilder"); + + /** TODO re-enable blocks when working. + + + //Blood Steel Chest + GameRegistry.registerBlock(tutChest, tutChest.getUnlocalizedName()); + + //BloodSteelorial Furnace + GameRegistry.registerBlock(tutFurnace, tutFurnace.getUnlocalizedName()); + GameRegistry.registerBlock(tutFurnaceActive, tutFurnaceActive.getUnlocalizedName()); + + //Arcane Infuser + GameRegistry.registerBlock(arcaneInfuser, arcaneInfuser.getUnlocalizedName()); + GameRegistry.registerBlock(arcaneInfuserActive, arcaneInfuserActive.getUnlocalizedName()); + **/ + + //Block Storage + //GameRegistry.registerBlock(emxBlockStorage, emxBlockStorage.getUnlocalizedName()); + } + +}
\ No newline at end of file diff --git a/src/Java/miscutil/core/commands/CommandMath.java b/src/Java/miscutil/core/commands/CommandMath.java new file mode 100644 index 0000000000..933684d277 --- /dev/null +++ b/src/Java/miscutil/core/commands/CommandMath.java @@ -0,0 +1,195 @@ +package miscutil.core.commands; + +import java.util.ArrayList; +import java.util.List; + +import miscutil.core.util.Utils; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; + + +public class CommandMath implements ICommand +{ + private final List aliases; + + protected String fullEntityName; + protected Entity conjuredEntity; + + public CommandMath() + { + aliases = new ArrayList(); + + aliases.add("hometele"); + + aliases.add("warphome"); + + } + + @Override + public int compareTo(Object o) + { + return 0; + + } + + @Override + public String getCommandName() + { + return "bed"; + + } + + @Override + public String getCommandUsage(ICommandSender var1) + { + return "/bed [Teleports you to your bed for XP]"; + + } + + @Override + public List getCommandAliases() + { + return this.aliases; + + } + + public void processCommand(ICommandSender S, String[] argString) + { + World W = S.getEntityWorld(); + CommandUtils C = new CommandUtils(); + EntityPlayer P = C.getPlayer(S); + //System.out.println(P.getCommandSenderName()); + //System.out.println(P.getDisplayName()); + if (W.isRemote) + + { + + System.out.println("Not processing on Client side"); + + } + + else + + { + + System.out.println("Processing on Server side - Home Teleport engaged by: "+P.getDisplayName()); + + int XP_TOTAL = P.experienceTotal; + Utils.LOG_WARNING("Total Xp:" + XP_TOTAL); + ChunkCoordinates X = P.getPlayerCoordinates(); + Utils.LOG_WARNING("Player Location: "+X); + ChunkCoordinates Y = null; + Utils.LOG_WARNING("Bed Location: "+Y); + if (!P.getBedLocation(0).equals(null)){ + Y = P.getBedLocation(0); + Utils.LOG_WARNING("Bed Location: "+Y); + } + else { + Y = W.getSpawnPoint(); + Utils.LOG_WARNING("Spawn Location: "+Y); + } + if (Y == null) { + Y = W.getSpawnPoint(); + Utils.LOG_WARNING("Spawn Location: "+Y); + } + + int x1 = X.posX; + Utils.LOG_WARNING("X1: "+x1); + int x2 = Y.posX; + Utils.LOG_WARNING("X2: "+x2); + int y1 = X.posY; + Utils.LOG_WARNING("Y1: "+y1); + int y2 = Y.posY; + Utils.LOG_WARNING("Y2: "+y2); + int z1 = X.posZ; + Utils.LOG_WARNING("Z1: "+z1); + int z2 = Y.posZ; + Utils.LOG_WARNING("Z2: "+z2); + + + double d = Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)+(z2-z1)*(z2-z1)); + String xpCost = String.valueOf((int)(d*0.15)); + + Utils.LOG_WARNING("d:" + d); + Utils.LOG_WARNING("-----------------------------------------"); + Utils.LOG_WARNING("Actual math formulae"); + Utils.LOG_WARNING(String.valueOf(d)); + Utils.LOG_WARNING("-----------------------------------------"); + Utils.LOG_WARNING("Xp Cost based on answer B."); + Utils.LOG_WARNING(String.valueOf(d*0.15) + " | " + String.valueOf(xpCost)); + Utils.LOG_WARNING("-----------------------------------------"); + Utils.LOG_WARNING("Xp Total"); + Utils.LOG_WARNING(String.valueOf(XP_TOTAL)); + Utils.LOG_WARNING("-----------------------------------------"); + + + + if ((XP_TOTAL-Float.valueOf(xpCost)) > 0){ + EntityXPOrb E = new EntityXPOrb(W, P.posX, P.posY + 1.62D - (double) P.yOffset, P.posZ, 1); + //E.moveTowards((double) Y.posX + 0.5D, (int) Y.posY + 3, (double) Y.posZ + 0.5D); + E.setVelocity((double) Y.posX + 0.5D, (int) Y.posY + 0.1, (double) Y.posZ + 0.5D); + W.spawnEntityInWorld(E); + W.playAuxSFXAtEntity((EntityPlayer) null, 1002, (int) P.posX, (int) P.posY, (int) P.posZ, 0); + P.setPositionAndUpdate(x2, y2+1, z2); + + //gregtech.api.util.GT_Utility.sendChatToPlayer(P, "Movement | X:"+x2+" | Y:"+y2+" | Z:"+z2); + gregtech.api.util.GT_Utility.sendChatToPlayer(P, "Distance Traveled | "+String.valueOf((int)(d)) + " Blocks & " + xpCost + "xp"); + gregtech.api.util.GT_Utility.sendChatToPlayer(P, "You suddenly feel at home."); + P.experienceTotal = (int) (XP_TOTAL-Float.valueOf(xpCost)); + if (!xpCost.equals("0") && Float.valueOf(xpCost) > 0){ + gregtech.api.util.GT_Utility.sendChatToPlayer(P, "...At the loss of "+xpCost+" xp."); + } + else if (xpCost.equals("0")){ + gregtech.api.util.GT_Utility.sendChatToPlayer(P, "...At the loss of very little xp."); + } + else { + gregtech.api.util.GT_Utility.sendChatToPlayer(P, "Something went wrong with the math, have this one on the house. :)"); + } + } + + else { + gregtech.api.util.GT_Utility.sendChatToPlayer(P, "You don't feel you're able to do this yet."); + } + + } + } + + @Override + public boolean canCommandSenderUseCommand(ICommandSender var1) + { + return true; + + } + + @Override + public List addTabCompletionOptions(ICommandSender var1, String[] var2) + { + // TODO Auto-generated method stub + + return null; + + } + + @Override + public boolean isUsernameIndex(String[] var1, int var2) + { + // TODO Auto-generated method stub + + return false; + + } + + public boolean playerUsesCommand(World W, EntityPlayer P, int cost) + { + + + return true; + } + +} + diff --git a/src/Java/miscutil/core/commands/CommandUtils.java b/src/Java/miscutil/core/commands/CommandUtils.java new file mode 100644 index 0000000000..f33263fa40 --- /dev/null +++ b/src/Java/miscutil/core/commands/CommandUtils.java @@ -0,0 +1,20 @@ +package miscutil.core.commands; + +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; + +public class CommandUtils { + + public EntityPlayer getPlayer(ICommandSender icommandsender){ + EntityPlayer player; + + if(icommandsender instanceof EntityPlayer){ + player = (EntityPlayer)icommandsender; + return player; + } + else { + return null; + } + } + +} diff --git a/src/Java/miscutil/core/creativetabs/MiscUtilCreativeTabBlock.java b/src/Java/miscutil/core/creativetabs/MiscUtilCreativeTabBlock.java new file mode 100644 index 0000000000..2db845e04c --- /dev/null +++ b/src/Java/miscutil/core/creativetabs/MiscUtilCreativeTabBlock.java @@ -0,0 +1,18 @@ +package miscutil.core.creativetabs; + +import miscutil.core.block.ModBlocks; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; + +public class MiscUtilCreativeTabBlock extends CreativeTabs { + + public MiscUtilCreativeTabBlock(String lable) { + super(lable); + } + + @Override + public Item getTabIconItem() { + return Item.getItemFromBlock(ModBlocks.blockBloodSteel); + } + +} diff --git a/src/Java/miscutil/core/creativetabs/MiscUtilCreativeTabMachines.java b/src/Java/miscutil/core/creativetabs/MiscUtilCreativeTabMachines.java new file mode 100644 index 0000000000..620648d6c0 --- /dev/null +++ b/src/Java/miscutil/core/creativetabs/MiscUtilCreativeTabMachines.java @@ -0,0 +1,18 @@ +package miscutil.core.creativetabs; + +import miscutil.core.block.ModBlocks; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; + +public class MiscUtilCreativeTabMachines extends CreativeTabs { + + public MiscUtilCreativeTabMachines(String lable) { + super(lable); + } + + @Override + public Item getTabIconItem() { + return Item.getItemFromBlock(ModBlocks.blockToolBuilder); + } + +} diff --git a/src/Java/miscutil/core/creativetabs/MiscUtilCreativeTabMisc.java b/src/Java/miscutil/core/creativetabs/MiscUtilCreativeTabMisc.java new file mode 100644 index 0000000000..2893146f93 --- /dev/null +++ b/src/Java/miscutil/core/creativetabs/MiscUtilCreativeTabMisc.java @@ -0,0 +1,18 @@ +package miscutil.core.creativetabs; + +import miscutil.core.item.ModItems; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; + +public class MiscUtilCreativeTabMisc extends CreativeTabs { + + public MiscUtilCreativeTabMisc(String lable) { + super(lable); + } + + @Override + public Item getTabIconItem() { + return ModItems.itemIngotBloodSteel; + } + +} diff --git a/src/Java/miscutil/core/creativetabs/MiscUtilCreativeTabTools.java b/src/Java/miscutil/core/creativetabs/MiscUtilCreativeTabTools.java new file mode 100644 index 0000000000..aa7cf227aa --- /dev/null +++ b/src/Java/miscutil/core/creativetabs/MiscUtilCreativeTabTools.java @@ -0,0 +1,18 @@ +package miscutil.core.creativetabs; + +import miscutil.core.item.ModItems; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; + +public class MiscUtilCreativeTabTools extends CreativeTabs { + + public MiscUtilCreativeTabTools(String lable) { + super(lable); + } + + @Override + public Item getTabIconItem() { + return ModItems.itemStaballoyPickaxe; + } + +} diff --git a/src/Java/miscutil/core/creativetabs/TMCreativeTabs.java b/src/Java/miscutil/core/creativetabs/TMCreativeTabs.java new file mode 100644 index 0000000000..05d170d6e1 --- /dev/null +++ b/src/Java/miscutil/core/creativetabs/TMCreativeTabs.java @@ -0,0 +1,20 @@ +package miscutil.core.creativetabs; + +import net.minecraft.creativetab.CreativeTabs; + +public class TMCreativeTabs { + + public static CreativeTabs tabBlock; + public static CreativeTabs tabMisc; + public static CreativeTabs tabCombat; + public static CreativeTabs tabTools; + public static CreativeTabs tabMachines; + + public static void initialiseTabs(){ + tabBlock = new MiscUtilCreativeTabBlock("MiscUtilBlockTab"); + tabMisc = new MiscUtilCreativeTabMisc("MiscUtilMiscTab"); + //tabMachines = new MiscUtilCreativeTabMachines("MiscUtilMachineTab"); + //tabCombat = new MiscUtilCreativeTabCombat("MiscUtilCombatTab"); + tabTools = new MiscUtilCreativeTabTools("MiscUtilToolsTab"); + } +} diff --git a/src/Java/miscutil/core/gui/GUI_Bat_Buf.java b/src/Java/miscutil/core/gui/GUI_Bat_Buf.java new file mode 100644 index 0000000000..efe42c7257 --- /dev/null +++ b/src/Java/miscutil/core/gui/GUI_Bat_Buf.java @@ -0,0 +1,247 @@ +package miscutil.core.gui; + +import miscutil.core.lib.Strings; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + + + +public class GUI_Bat_Buf extends GuiScreen +{ + private final int bookImageHeight = 192; + private final int bookImageWidth = 192; + private int currPage = 0; + private static final int bookTotalPages = 4; + private static ResourceLocation[] bookPageTextures = + + new ResourceLocation[bookTotalPages]; + private static String[] stringPageText = new String[bookTotalPages]; + private GuiButton buttonDone; + private NextPageButton buttonNextPage; + private NextPageButton buttonPreviousPage; + + public GUI_Bat_Buf() + { + + bookPageTextures[0] = new ResourceLocation( + + Strings.MODID+":textures/gui/book_cover.png"); + + bookPageTextures[1] = new ResourceLocation( + + Strings.MODID+":textures/gui/book.png"); + + bookPageTextures[2] = new ResourceLocation( + + Strings.MODID+":textures/gui/book.png"); + + stringPageText[0] = ""; + + stringPageText[1] = "The Mysterious Stranger admired your family cow and asked if it was for sale.\n\nWhen you nodded, he offered to trade some Magic Beans, that (if planted in tilled dirt) would lead to more wealth than you could imagine."; + + stringPageText[2]="So you handed him your cow, and grabbed the Magic Beans.\n\nPleased with yourself, you hurried away, looking for tilled dirt in which to plant the Magic Beans.\n\nYou couldn't wait to see how proud your mother would be for"; + stringPageText[3]="being so shrewd! Untold wealth in return for an old, milkless cow; what a good deal you made!\n\nSo off you went, looking for a place to plant the Magic Beans with room to grow..."; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @Override + public void initGui() + { + // DEBUG + System.out.println("GuiMysteriousStranger initGUI()"); + buttonList.clear(); + Keyboard.enableRepeatEvents(true); + + buttonDone = new GuiButton(0, width / 2 + 2, 4 + bookImageHeight, + + 98, 20, I18n.format("gui.done", new Object[0])); + + buttonList.add(buttonDone); + int offsetFromScreenLeft = (width - bookImageWidth) / 2; + buttonList.add(buttonNextPage = new NextPageButton(1, + + offsetFromScreenLeft + 120, 156, true)); + buttonList.add(buttonPreviousPage = new NextPageButton(2, + + offsetFromScreenLeft + 38, 156, false)); + } + + /** + * Called from the main game loop to update the screen. + */ + @Override + public void updateScreen() + { + buttonDone.visible = (currPage == bookTotalPages - 1); + buttonNextPage.visible = (currPage < bookTotalPages - 1); + buttonPreviousPage.visible = currPage > 0; + } + + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int parWidth, int parHeight, float p_73863_3_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + if (currPage == 0) + { + mc.getTextureManager().bindTexture(bookPageTextures[0]); + } + else + { + mc.getTextureManager().bindTexture(bookPageTextures[1]); + } + int offsetFromScreenLeft = (width - bookImageWidth ) / 2; + drawTexturedModalRect(offsetFromScreenLeft, 2, 0, 0, bookImageWidth, + + bookImageHeight); + int widthOfString; + String stringPageIndicator = I18n.format("book.pageIndicator", + + new Object[] {Integer.valueOf(currPage + 1), bookTotalPages}); + + widthOfString = fontRendererObj.getStringWidth(stringPageIndicator); + fontRendererObj.drawString(stringPageIndicator, + + offsetFromScreenLeft - widthOfString + bookImageWidth - 44, + + 18, 0); + + fontRendererObj.drawSplitString(stringPageText[currPage], + + offsetFromScreenLeft + 36, 34, 116, 0); + + super.drawScreen(parWidth, parHeight, p_73863_3_); + + } + + /** + * Called when a mouse button is pressed and the mouse is moved around. + + * Parameters are : mouseX, mouseY, lastButtonClicked & + + * timeSinceMouseClick. + */ + @Override + protected void mouseClickMove(int parMouseX, int parMouseY, + + int parLastButtonClicked, long parTimeSinceMouseClick) + + { + + } + + @Override + protected void actionPerformed(GuiButton parButton) + { + if (parButton == buttonDone) + { + // You can send a packet to server here if you need server to do + + // something + mc.displayGuiScreen((GuiScreen)null); + } + else if (parButton == buttonNextPage) + { + if (currPage < bookTotalPages - 1) + { + ++currPage; + } + } + else if (parButton == buttonPreviousPage) |
