Initial comment to start using Blood Utils' book

This commit is contained in:
WayofTime 2014-11-03 18:05:28 -05:00
parent d1fa088923
commit 51346b5638
90 changed files with 2272 additions and 21 deletions

View file

@ -1,13 +1,19 @@
package WayofTime.alchemicalWizardry.common.tileEntity.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerTeleposer;
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerWritingTable;
import bloodutils.api.classes.guide.GuiCategories;
import bloodutils.api.classes.guide.GuiEntry;
import bloodutils.api.classes.guide.GuiIndex;
import bloodutils.api.compact.Category;
import bloodutils.api.registries.EntryRegistry;
import cpw.mods.fml.common.network.IGuiHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class GuiHandler implements IGuiHandler
{
@ -44,6 +50,8 @@ public class GuiHandler implements IGuiHandler
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
{
TileEntity tileEntity;
ItemStack held = player.getHeldItem();
switch (id)
{
@ -66,6 +74,31 @@ public class GuiHandler implements IGuiHandler
}
break;
case 2:
if(held.hasTagCompound() && held.getTagCompound().getString("CATEGORY") != null){
if(held.hasTagCompound() && held.getTagCompound().getString("KEY") != null && held.getTagCompound().getString("KEY") != "0"){
String cate = held.getTagCompound().getString("CATEGORY");
String key = held.getTagCompound().getString("KEY");
int page = held.getTagCompound().getInteger("PAGE");
if(EntryRegistry.categoryMap.containsKey(cate)){
Category category = EntryRegistry.categoryMap.get(cate);
return new GuiEntry(key, player, category, page);
}else{
return new GuiCategories(player);
}
}else if(held.hasTagCompound() && held.getTagCompound().getString("CATEGORY") != null){
String cate = held.getTagCompound().getString("CATEGORY");
int page = held.getTagCompound().getInteger("PAGE");
if(EntryRegistry.categoryMap.containsKey(cate)){
Category category = EntryRegistry.categoryMap.get(cate);
return new GuiIndex(category, player, page);
}
}
}
return new GuiCategories(player);
}
return null;