Work work work

This commit is contained in:
Pahimar 2014-09-19 15:55:28 -04:00
parent 48db29113b
commit 8f5ea0a2b5
14 changed files with 119 additions and 37 deletions

View file

@ -1,7 +1,7 @@
package com.pahimar.ee3.block;
import com.pahimar.ee3.EquivalentExchange3;
import com.pahimar.ee3.reference.GuiId;
import com.pahimar.ee3.reference.GUIs;
import com.pahimar.ee3.reference.Names;
import com.pahimar.ee3.reference.RenderIds;
import com.pahimar.ee3.tileentity.TileEntityAlchemicalChest;
@ -86,7 +86,7 @@ public class BlockAlchemicalChest extends BlockEE implements ITileEntityProvider
{
if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemicalChest)
{
player.openGui(EquivalentExchange3.instance, GuiId.ALCHEMICAL_CHEST.ordinal(), world, x, y, z);
player.openGui(EquivalentExchange3.instance, GUIs.ALCHEMICAL_CHEST.ordinal(), world, x, y, z);
}
return true;

View file

@ -2,7 +2,7 @@ package com.pahimar.ee3.block;
import com.pahimar.ee3.EquivalentExchange3;
import com.pahimar.ee3.init.ModBlocks;
import com.pahimar.ee3.reference.GuiId;
import com.pahimar.ee3.reference.GUIs;
import com.pahimar.ee3.reference.Names;
import com.pahimar.ee3.reference.Particles;
import com.pahimar.ee3.reference.RenderIds;
@ -110,7 +110,7 @@ public class BlockAludel extends BlockEE implements ITileEntityProvider
{
if (world.getTileEntity(x, y, z) instanceof TileEntityAludel && world.getTileEntity(x, y + 1, z) instanceof TileEntityGlassBell)
{
player.openGui(EquivalentExchange3.instance, GuiId.ALUDEL.ordinal(), world, x, y, z);
player.openGui(EquivalentExchange3.instance, GUIs.ALUDEL.ordinal(), world, x, y, z);
}
}

View file

@ -1,7 +1,7 @@
package com.pahimar.ee3.block;
import com.pahimar.ee3.EquivalentExchange3;
import com.pahimar.ee3.reference.GuiId;
import com.pahimar.ee3.reference.GUIs;
import com.pahimar.ee3.reference.Names;
import com.pahimar.ee3.reference.RenderIds;
import com.pahimar.ee3.tileentity.TileEntityAugmentationTable;
@ -57,7 +57,7 @@ public class BlockAugmentationTable extends BlockEE implements ITileEntityProvid
{
if (world.getTileEntity(x, y, z) instanceof TileEntityAugmentationTable)
{
player.openGui(EquivalentExchange3.instance, GuiId.AUGMENTATION_TABLE.ordinal(), world, x, y, z);
player.openGui(EquivalentExchange3.instance, GUIs.AUGMENTATION_TABLE.ordinal(), world, x, y, z);
}
}

View file

@ -1,7 +1,7 @@
package com.pahimar.ee3.block;
import com.pahimar.ee3.EquivalentExchange3;
import com.pahimar.ee3.reference.GuiId;
import com.pahimar.ee3.reference.GUIs;
import com.pahimar.ee3.reference.Names;
import com.pahimar.ee3.reference.Particles;
import com.pahimar.ee3.reference.RenderIds;
@ -76,7 +76,7 @@ public class BlockCalcinator extends BlockEE implements ITileEntityProvider
{
if (world.getTileEntity(x, y, z) instanceof TileEntityCalcinator)
{
player.openGui(EquivalentExchange3.instance, GuiId.CALCINATOR.ordinal(), world, x, y, z);
player.openGui(EquivalentExchange3.instance, GUIs.CALCINATOR.ordinal(), world, x, y, z);
}
}

View file

@ -1,7 +1,7 @@
package com.pahimar.ee3.block;
import com.pahimar.ee3.EquivalentExchange3;
import com.pahimar.ee3.reference.GuiId;
import com.pahimar.ee3.reference.GUIs;
import com.pahimar.ee3.reference.Names;
import com.pahimar.ee3.reference.RenderIds;
import com.pahimar.ee3.tileentity.TileEntityAludel;
@ -80,11 +80,11 @@ public class BlockGlassBell extends BlockEE implements ITileEntityProvider
{
if (world.getTileEntity(x, y - 1, z) instanceof TileEntityAludel)
{
player.openGui(EquivalentExchange3.instance, GuiId.ALUDEL.ordinal(), world, x, y - 1, z);
player.openGui(EquivalentExchange3.instance, GUIs.ALUDEL.ordinal(), world, x, y - 1, z);
}
else
{
player.openGui(EquivalentExchange3.instance, GuiId.GLASS_BELL.ordinal(), world, x, y, z);
player.openGui(EquivalentExchange3.instance, GUIs.GLASS_BELL.ordinal(), world, x, y, z);
}
}
}

View file

@ -1,7 +1,7 @@
package com.pahimar.ee3.block;
import com.pahimar.ee3.EquivalentExchange3;
import com.pahimar.ee3.reference.GuiId;
import com.pahimar.ee3.reference.GUIs;
import com.pahimar.ee3.reference.Names;
import com.pahimar.ee3.reference.RenderIds;
import com.pahimar.ee3.tileentity.TileEntityResearchStation;
@ -57,7 +57,7 @@ public class BlockResearchStation extends BlockEE implements ITileEntityProvider
{
if (world.getTileEntity(x, y, z) instanceof TileEntityResearchStation)
{
player.openGui(EquivalentExchange3.instance, GuiId.RESEARCH_STATION.ordinal(), world, x, y, z);
player.openGui(EquivalentExchange3.instance, GUIs.RESEARCH_STATION.ordinal(), world, x, y, z);
}
}

View file

@ -0,0 +1,24 @@
package com.pahimar.ee3.client.gui.inventory;
import com.pahimar.ee3.inventory.ContainerSymbolSelection;
import net.minecraft.client.gui.inventory.GuiContainer;
public class GuiSymbolSelection extends GuiContainer
{
public GuiSymbolSelection()
{
super(new ContainerSymbolSelection());
}
@Override
protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y)
{
}
@Override
public void drawDefaultBackground()
{
// NOOP
}
}

View file

@ -0,0 +1,16 @@
package com.pahimar.ee3.client.handler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.client.event.MouseEvent;
@SideOnly(Side.CLIENT)
public class MouseEventHandler
{
@SubscribeEvent
public void onMouseEvent(MouseEvent event)
{
}
}

View file

@ -2,7 +2,7 @@ package com.pahimar.ee3.handler;
import com.pahimar.ee3.client.gui.inventory.*;
import com.pahimar.ee3.inventory.*;
import com.pahimar.ee3.reference.GuiId;
import com.pahimar.ee3.reference.GUIs;
import com.pahimar.ee3.tileentity.*;
import cpw.mods.fml.common.network.IGuiHandler;
import net.minecraft.entity.player.EntityPlayer;
@ -13,45 +13,49 @@ public class GuiHandler implements IGuiHandler
@Override
public Object getServerGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z)
{
if (id == GuiId.ALCHEMICAL_CHEST.ordinal())
if (id == GUIs.ALCHEMICAL_CHEST.ordinal())
{
TileEntityAlchemicalChest tileEntityAlchemicalChest = (TileEntityAlchemicalChest) world.getTileEntity(x, y, z);
return new ContainerAlchemicalChest(entityPlayer.inventory, tileEntityAlchemicalChest);
}
else if (id == GuiId.GLASS_BELL.ordinal())
else if (id == GUIs.GLASS_BELL.ordinal())
{
TileEntityGlassBell tileEntityGlassBell = (TileEntityGlassBell) world.getTileEntity(x, y, z);
return new ContainerGlassBell(entityPlayer.inventory, tileEntityGlassBell);
}
else if (id == GuiId.ALCHEMICAL_BAG.ordinal())
else if (id == GUIs.ALCHEMICAL_BAG.ordinal())
{
return new ContainerAlchemicalBag(entityPlayer, new InventoryAlchemicalBag(entityPlayer.getHeldItem()));
}
else if (id == GuiId.ALCHEMICAL_TOME.ordinal())
else if (id == GUIs.ALCHEMICAL_TOME.ordinal())
{
// return new ContainerAlchemicalTome(new InventoryAlchemicalTome(entityPlayer.getHeldItem()));
return new ContainerAlchemicalTome(entityPlayer.inventory);
}
else if (id == GuiId.CALCINATOR.ordinal())
else if (id == GUIs.CALCINATOR.ordinal())
{
TileEntityCalcinator tileEntityCalcinator = (TileEntityCalcinator) world.getTileEntity(x, y, z);
return new ContainerCalcinator(entityPlayer.inventory, tileEntityCalcinator);
}
else if (id == GuiId.ALUDEL.ordinal())
else if (id == GUIs.ALUDEL.ordinal())
{
TileEntityAludel tileEntityAludel = (TileEntityAludel) world.getTileEntity(x, y, z);
return new ContainerAludel(entityPlayer.inventory, tileEntityAludel);
}
else if (id == GuiId.RESEARCH_STATION.ordinal())
else if (id == GUIs.RESEARCH_STATION.ordinal())
{
TileEntityResearchStation tileEntityResearchStation = (TileEntityResearchStation) world.getTileEntity(x, y, z);
return new ContainerResearchStation(entityPlayer.inventory, tileEntityResearchStation);
}
else if (id == GuiId.AUGMENTATION_TABLE.ordinal())
else if (id == GUIs.AUGMENTATION_TABLE.ordinal())
{
TileEntityAugmentationTable tileEntityAugmentationTable = (TileEntityAugmentationTable) world.getTileEntity(x, y, z);
return new ContainerAugmentationTable(entityPlayer.inventory, tileEntityAugmentationTable);
}
else if (id == GUIs.SYMBOL_SELECTION.ordinal())
{
return new ContainerSymbolSelection();
}
return null;
}
@ -59,45 +63,49 @@ public class GuiHandler implements IGuiHandler
@Override
public Object getClientGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z)
{
if (id == GuiId.ALCHEMICAL_CHEST.ordinal())
if (id == GUIs.ALCHEMICAL_CHEST.ordinal())
{
TileEntityAlchemicalChest tileEntityAlchemicalChest = (TileEntityAlchemicalChest) world.getTileEntity(x, y, z);
return new GuiAlchemicalChest(entityPlayer.inventory, tileEntityAlchemicalChest);
}
else if (id == GuiId.GLASS_BELL.ordinal())
else if (id == GUIs.GLASS_BELL.ordinal())
{
TileEntityGlassBell tileEntityGlassBell = (TileEntityGlassBell) world.getTileEntity(x, y, z);
return new GuiGlassBell(entityPlayer.inventory, tileEntityGlassBell);
}
else if (id == GuiId.ALCHEMICAL_BAG.ordinal())
else if (id == GUIs.ALCHEMICAL_BAG.ordinal())
{
return new GuiAlchemicalBag(entityPlayer, new InventoryAlchemicalBag(entityPlayer.getHeldItem()));
}
else if (id == GuiId.ALCHEMICAL_TOME.ordinal())
else if (id == GUIs.ALCHEMICAL_TOME.ordinal())
{
// return new GuiAlchemicalTome(new InventoryAlchemicalTome(entityPlayer.getHeldItem()));
return new GuiAlchemicalTome(entityPlayer);
}
else if (id == GuiId.CALCINATOR.ordinal())
else if (id == GUIs.CALCINATOR.ordinal())
{
TileEntityCalcinator tileEntityCalcinator = (TileEntityCalcinator) world.getTileEntity(x, y, z);
return new GuiCalcinator(entityPlayer.inventory, tileEntityCalcinator);
}
else if (id == GuiId.ALUDEL.ordinal())
else if (id == GUIs.ALUDEL.ordinal())
{
TileEntityAludel tileEntityAludel = (TileEntityAludel) world.getTileEntity(x, y, z);
return new GuiAludel(entityPlayer.inventory, tileEntityAludel);
}
else if (id == GuiId.RESEARCH_STATION.ordinal())
else if (id == GUIs.RESEARCH_STATION.ordinal())
{
TileEntityResearchStation tileEntityResearchStation = (TileEntityResearchStation) world.getTileEntity(x, y, z);
return new GuiResearchStation(entityPlayer.inventory, tileEntityResearchStation);
}
else if (id == GuiId.AUGMENTATION_TABLE.ordinal())
else if (id == GUIs.AUGMENTATION_TABLE.ordinal())
{
TileEntityAugmentationTable tileEntityAugmentationTable = (TileEntityAugmentationTable) world.getTileEntity(x, y, z);
return new GuiAugmentationTable(entityPlayer.inventory, tileEntityAugmentationTable);
}
else if (id == GUIs.SYMBOL_SELECTION.ordinal())
{
return new GuiSymbolSelection();
}
return null;
}

View file

@ -0,0 +1,5 @@
package com.pahimar.ee3.inventory;
public class ContainerSymbolSelection extends ContainerEE
{
}

View file

@ -2,7 +2,7 @@ package com.pahimar.ee3.item;
import com.pahimar.ee3.EquivalentExchange3;
import com.pahimar.ee3.reference.Colors;
import com.pahimar.ee3.reference.GuiId;
import com.pahimar.ee3.reference.GUIs;
import com.pahimar.ee3.reference.Names;
import com.pahimar.ee3.reference.Textures;
import com.pahimar.ee3.util.ColorHelper;
@ -103,7 +103,7 @@ public class ItemAlchemicalBag extends ItemEE implements IOwnable
// Set a UUID on the Alchemical Bag, if one doesn't exist already
NBTHelper.setUUID(itemStack);
NBTHelper.setBoolean(itemStack, Names.NBT.ALCHEMICAL_BAG_GUI_OPEN, true);
entityPlayer.openGui(EquivalentExchange3.instance, GuiId.ALCHEMICAL_BAG.ordinal(), entityPlayer.worldObj, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ);
entityPlayer.openGui(EquivalentExchange3.instance, GUIs.ALCHEMICAL_BAG.ordinal(), entityPlayer.worldObj, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ);
}
return itemStack;

View file

@ -1,7 +1,7 @@
package com.pahimar.ee3.item;
import com.pahimar.ee3.EquivalentExchange3;
import com.pahimar.ee3.reference.GuiId;
import com.pahimar.ee3.reference.GUIs;
import com.pahimar.ee3.reference.Names;
import com.pahimar.ee3.skill.PlayerKnowledge;
import com.pahimar.ee3.util.IOwnable;
@ -34,7 +34,7 @@ public class ItemAlchemicalTome extends ItemEE implements IOwnable
// Set the owner
ItemHelper.setOwner(itemStack, entityPlayer);
entityPlayer.openGui(EquivalentExchange3.instance, GuiId.ALCHEMICAL_TOME.ordinal(), entityPlayer.worldObj, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ);
entityPlayer.openGui(EquivalentExchange3.instance, GUIs.ALCHEMICAL_TOME.ordinal(), entityPlayer.worldObj, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ);
}
return itemStack;

View file

@ -1,8 +1,15 @@
package com.pahimar.ee3.item;
import com.pahimar.ee3.EquivalentExchange3;
import com.pahimar.ee3.reference.GUIs;
import com.pahimar.ee3.reference.Key;
import com.pahimar.ee3.reference.Names;
import com.pahimar.ee3.util.IKeyBound;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemChalk extends ItemEE
public class ItemChalk extends ItemEE implements IKeyBound
{
public ItemChalk()
{
@ -10,4 +17,25 @@ public class ItemChalk extends ItemEE
this.setMaxStackSize(64);
this.setUnlocalizedName(Names.Items.CHALK);
}
@Override
public boolean getShareTag()
{
return true;
}
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer)
{
return itemStack;
}
@Override
public void doKeyBindingAction(EntityPlayer entityPlayer, ItemStack itemStack, Key key)
{
if (key == Key.TOGGLE)
{
entityPlayer.openGui(EquivalentExchange3.instance, GUIs.SYMBOL_SELECTION.ordinal(), entityPlayer.worldObj, (int) entityPlayer.posX, (int) entityPlayer.posY, (int) entityPlayer.posZ);
}
}
}

View file

@ -1,6 +1,6 @@
package com.pahimar.ee3.reference;
public enum GuiId
public enum GUIs
{
PORTABLE_CRAFTING,
CALCINATOR,
@ -11,5 +11,6 @@ public enum GuiId
RESEARCH_STATION,
AUGMENTATION_TABLE,
ALCHEMICAL_TOME,
TRANSMUTATION_SQUARE
TRANSMUTATION_SQUARE,
SYMBOL_SELECTION
}