Package com.pahimar.ee3.exchange

Examples of com.pahimar.ee3.exchange.WrappedStack


    private void placeAlchemyArray(ItemStack itemStack, EntityPlayer entityPlayer, World world, int x, int y, int z, int side)
    {
        if (!world.isRemote)
        {
            NBTTagCompound playerCustomData = EntityHelper.getCustomEntityData(entityPlayer);
            ChalkSettings chalkSettings = new ChalkSettings();
            chalkSettings.readFromNBT(playerCustomData);
            int coordOffset = getOffsetForSize(chalkSettings.getSize());
            ForgeDirection orientation = ForgeDirection.getOrientation(side);
            boolean canPlaceAlchemyArray = ModBlocks.alchemyArray.canPlaceBlockOnSide(world, x, y, z, side);

            placeBlockAt(entityPlayer, itemStack, world, x, y, z, ModBlocks.alchemyArray, side);
View Full Code Here


    public void doKeyBindingAction(EntityPlayer entityPlayer, ItemStack itemStack, Key key)
    {
        if (key != Key.UNKNOWN)
        {
            NBTTagCompound playerCustomData = EntityHelper.getCustomEntityData(entityPlayer);
            ChalkSettings chalkSettings = new ChalkSettings();
            chalkSettings.readFromNBT(playerCustomData);

            if (key == Key.CHARGE)
            {
                if (!entityPlayer.isSneaking())
                {
                    chalkSettings.incrementSize();
                }
                else
                {
                    chalkSettings.decrementSize();
                }
            }
            else if (key == Key.TOGGLE)
            {
                if (!entityPlayer.isSneaking())
                {
                    chalkSettings.incrementIndex();
                }
                else
                {
                    chalkSettings.decrementIndex();
                }
            }
            else if (key == Key.RELEASE)
            {
                if (!entityPlayer.isSneaking())
                {
                    chalkSettings.rotateClockwise();
                }
                else
                {
                    chalkSettings.rotateCounterClockwise();
                }
            }

            chalkSettings.writeToNBT(playerCustomData);
            EntityHelper.saveCustomEntityData(entityPlayer, playerCustomData);
            PacketHandler.INSTANCE.sendTo(new MessageChalkSettings(chalkSettings), (EntityPlayerMP) entityPlayer);
        }
    }
View Full Code Here

        drawGlyphInWorld(event);
    }

    private static void drawGlyphInWorld(DrawBlockHighlightEvent event)
    {
        ChalkSettings chalkSettings = EquivalentExchange3.proxy.getClientProxy().chalkSettings;
        ResourceLocation texture = GlyphTextureRegistry.getInstance().getRegisteredGlyphAt(chalkSettings.getIndex());
        int rotation = chalkSettings.getRotation();

        double x = event.target.blockX + 0.5F;
        double y = event.target.blockY + 0.5F;
        double z = event.target.blockZ + 0.5F;
        double iPX = event.player.prevPosX + (event.player.posX - event.player.prevPosX) * event.partialTicks;
        double iPY = event.player.prevPosY + (event.player.posY - event.player.prevPosY) * event.partialTicks;
        double iPZ = event.player.prevPosZ + (event.player.posZ - event.player.prevPosZ) * event.partialTicks;

        float xScale, yScale, zScale;
        float xShift, yShift, zShift;
        float xRotate, yRotate, zRotate;
        int zCorrection = 1;
        int rotationAngle = 0;
        int playerFacing = MathHelper.floor_double(event.player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
        int facingCorrectionAngle = 0;

        xScale = yScale = zScale = 1;
        xShift = yShift = zShift = 0;
        xRotate = yRotate = zRotate = 0;

        int chargeLevel = chalkSettings.getSize();
        ForgeDirection sideHit = ForgeDirection.getOrientation(event.target.sideHit);
        TileEntity tileEntity = event.player.worldObj.getTileEntity(event.target.blockX, event.target.blockY, event.target.blockZ);
        boolean shouldRender = true;

        if (tileEntity instanceof TileEntityEE)
View Full Code Here

    @SubscribeEvent
    public void syncChalkSettingsOnLogin(cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent event)
    {
        NBTTagCompound playerCustomData = EntityHelper.getCustomEntityData(event.player);
        ChalkSettings chalkSettings = new ChalkSettings();
        chalkSettings.readFromNBT(playerCustomData);

        PacketHandler.INSTANCE.sendTo(new MessageChalkSettings(chalkSettings), (EntityPlayerMP) event.player);
    }
View Full Code Here

    private void learnItemStack()
    {
        if (this.canLearnItemStack())
        {
            PlayerKnowledge playerKnowledge = PlayerKnowledge.readPlayerKnowledgeFromNBT(this.inventory[TOME_SLOT_INVENTORY_INDEX].getTagCompound());
            playerKnowledge.learnItemStack(this.inventory[ITEM_SLOT_INVENTORY_INDEX]);
            playerKnowledge.writeToNBT(this.inventory[TOME_SLOT_INVENTORY_INDEX].getTagCompound());

            this.inventory[ITEM_SLOT_INVENTORY_INDEX].stackSize--;

            if (this.inventory[ITEM_SLOT_INVENTORY_INDEX].stackSize <= 0)
            {
View Full Code Here

    {
        if (itemStack.getItem() instanceof ItemAlchemicalTome)
        {
            if (itemStack.hasTagCompound() && NBTHelper.hasTag(itemStack, Names.NBT.KNOWLEDGE))
            {
                PlayerKnowledge playerKnowledge = new PlayerKnowledge();
                playerKnowledge.readFromNBT(itemStack.getTagCompound());
                return playerKnowledge;
            }
            else
            {
                PlayerKnowledge playerKnowledge = new PlayerKnowledge();
                writePlayerKnowledge(itemStack, playerKnowledge);
                return playerKnowledge;
            }
        }
View Full Code Here

    @Override
    public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick)
    {
        if (tileEntity instanceof TileEntityAlchemicalChest)
        {
            TileEntityAlchemicalChest tileEntityAlchemicalChest = (TileEntityAlchemicalChest) tileEntity;
            ForgeDirection direction = null;

            if (tileEntityAlchemicalChest.getWorldObj() != null)
            {
                direction = tileEntityAlchemicalChest.getOrientation();
            }

            if (tileEntityAlchemicalChest.getState() == 0)
            {
                this.bindTexture(Textures.Model.ALCHEMICAL_CHEST_SMALL);
            }
            else if (tileEntityAlchemicalChest.getState() == 1)
            {
                this.bindTexture(Textures.Model.ALCHEMICAL_CHEST_MEDIUM);
            }
            else if (tileEntityAlchemicalChest.getState() == 2)
            {
                this.bindTexture(Textures.Model.ALCHEMICAL_CHEST_LARGE);
            }

            GL11.glPushMatrix();
View Full Code Here

        {
            return new TileEntityAlchemicalChestMedium();
        }
        else if (metaData == 2)
        {
            return new TileEntityAlchemicalChestLarge();
        }

        return null;
    }
View Full Code Here

        {
            return new TileEntityAlchemicalChestSmall();
        }
        else if (metaData == 1)
        {
            return new TileEntityAlchemicalChestMedium();
        }
        else if (metaData == 2)
        {
            return new TileEntityAlchemicalChestLarge();
        }
View Full Code Here

    @Override
    public TileEntity createNewTileEntity(World world, int metaData)
    {
        if (metaData == 0)
        {
            return new TileEntityAlchemicalChestSmall();
        }
        else if (metaData == 1)
        {
            return new TileEntityAlchemicalChestMedium();
        }
View Full Code Here

TOP

Related Classes of com.pahimar.ee3.exchange.WrappedStack

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.