Package com.pahimar.ee3.api

Examples of com.pahimar.ee3.api.AlchemyArrayRegistryProxy


            int trueYCoord = ((TileEntityDummyArray) world.getTileEntity(x, y, z)).getTrueYCoord();
            int trueZCoord = ((TileEntityDummyArray) world.getTileEntity(x, y, z)).getTrueZCoord();

            if (world.getTileEntity(trueXCoord, trueYCoord, trueZCoord) instanceof TileEntityAlchemyArray)
            {
                TileEntityAlchemyArray tileEntityAlchemyArray = (TileEntityAlchemyArray) world.getTileEntity(trueXCoord, trueYCoord, trueZCoord);
                boolean invalidateAlchemyArray = false;

                if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.UP && !world.isSideSolid(x, y - 1, z, ForgeDirection.UP, true))
                {
                    invalidateAlchemyArray = true;
                }
                else if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.DOWN && !world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN, true))
                {
                    invalidateAlchemyArray = true;
                }
                else if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.NORTH && !world.isSideSolid(x, y, z + 1, ForgeDirection.NORTH, true))
                {
                    invalidateAlchemyArray = true;
                }
                else if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.SOUTH && !world.isSideSolid(x, y, z - 1, ForgeDirection.SOUTH, true))
                {
                    invalidateAlchemyArray = true;
                }
                else if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.EAST && !world.isSideSolid(x - 1, y, z, ForgeDirection.EAST, true))
                {
                    invalidateAlchemyArray = true;
                }
                else if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.WEST && !world.isSideSolid(x + 1, y, z, ForgeDirection.WEST, true))
                {
                    invalidateAlchemyArray = true;
                }

                if (invalidateAlchemyArray)
                {
                    world.getTileEntity(x, y, z).invalidate();
                    tileEntityAlchemyArray.invalidate();
                    world.setBlockToAir(x, y, z);
                    world.setBlockToAir(trueXCoord, trueYCoord, trueZCoord);
                }
            }
        }
View Full Code Here


     * @param metaData
     */
    @Override
    public TileEntity createNewTileEntity(World world, int metaData)
    {
        return new TileEntityAlchemyArray();
    }
View Full Code Here

    @Override
    public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
    {
        if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
        {
            TileEntityAlchemyArray tileEntityAlchemyArray = (TileEntityAlchemyArray) world.getTileEntity(x, y, z);
            boolean invalidateAlchemyArray = false;

            if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.UP && !world.isSideSolid(x, y - 1, z, ForgeDirection.UP, true))
            {
                invalidateAlchemyArray = true;
            }
            else if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.DOWN && !world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN, true))
            {
                invalidateAlchemyArray = true;
            }
            else if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.NORTH && !world.isSideSolid(x, y, z + 1, ForgeDirection.NORTH, true))
            {
                invalidateAlchemyArray = true;
            }
            else if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.SOUTH && !world.isSideSolid(x, y, z - 1, ForgeDirection.SOUTH, true))
            {
                invalidateAlchemyArray = true;
            }
            else if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.EAST && !world.isSideSolid(x - 1, y, z, ForgeDirection.EAST, true))
            {
                invalidateAlchemyArray = true;
            }
            else if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.WEST && !world.isSideSolid(x + 1, y, z, ForgeDirection.WEST, true))
            {
                invalidateAlchemyArray = true;
            }

            if (invalidateAlchemyArray)
            {
                tileEntityAlchemyArray.invalidate();
                world.setBlockToAir(x, y, z);
            }
        }
    }
View Full Code Here

    @Override
    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int sideHit, float hitX, float hitY, float hitZ)
    {
        if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
        {
            TileEntityAlchemyArray tileEntityAlchemyArray = (TileEntityAlchemyArray) world.getTileEntity(x, y, z);
            if (entityPlayer.getCurrentEquippedItem() != null && entityPlayer.getCurrentEquippedItem().getItem() instanceof ItemChalk && !entityPlayer.isSneaking())
            {
                NBTTagCompound customEntityData = EntityHelper.getCustomEntityData(entityPlayer);
                ChalkSettings chalkSettings = new ChalkSettings();
                chalkSettings.readFromNBT(customEntityData);

                ResourceLocation glyphTexture = GlyphTextureRegistry.getInstance().getRegisteredGlyphAt(chalkSettings.getIndex());

                if (tileEntityAlchemyArray.addGlyphToAlchemyArray(new Glyph(glyphTexture, GlyphTextureRegistry.getInstance().getRegisteredGlyphTextures().get(glyphTexture)), chalkSettings.getSize()))
                {
                    world.markBlockForUpdate(x, y, z);
                    world.getTileEntity(x, y, z).markDirty();
                    CommonSoundHelper.playChalkSoundAt(entityPlayer);
                    return true;
                }
            }
            else
            {
                tileEntityAlchemyArray.onBlockActivated(world, x, y, z, entityPlayer, sideHit, hitX, hitY, hitZ);
            }
        }

        return false;
    }
View Full Code Here

    @Override
    public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 startVec, Vec3 endVec)
    {
        if (world.getTileEntity(x, y, z) instanceof TileEntityAlchemyArray)
        {
            TileEntityAlchemyArray tileEntityAlchemyArray = (TileEntityAlchemyArray) world.getTileEntity(x, y, z);

            switch (tileEntityAlchemyArray.getOrientation())
            {
                case DOWN:
                {
                    this.setBlockBounds(0f, 1f, 0f, 1f, 1 - 0.0625f, 1f);
                    break;
View Full Code Here

    @Override
    public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick)
    {
        if (tileEntity instanceof TileEntityAlchemyArray)
        {
            TileEntityAlchemyArray tileEntityAlchemyArray = (TileEntityAlchemyArray) FMLClientHandler.instance().getClient().theWorld.getTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);

            int scale;
            double xShift = 0.5d, yShift = 0.5d, zShift = 0.5d;
            float xRotate = 0, yRotate = 0, zRotate = 0;
            int rotationAngle = 0;

            GL11.glDisable(GL11.GL_CULL_FACE);
            GL11.glDisable(GL11.GL_LIGHTING);
            GL11.glPushMatrix();

            GL11.glDepthMask(false);
            GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
            for (Glyph glyph : tileEntityAlchemyArray.getGlyphs())
            {
                scale = glyph.getSize();
                if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.UP)
                {
                    if (tileEntityAlchemyArray.getRotation() == ForgeDirection.NORTH)
                    {
                        rotationAngle = 0;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.EAST)
                    {
                        rotationAngle = -90;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.SOUTH)
                    {
                        rotationAngle = 180;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.WEST)
                    {
                        rotationAngle = 90;
                    }

                    yShift = 0.001d;
                    xRotate = -1;
                }
                else if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.DOWN)
                {
                    if (tileEntityAlchemyArray.getRotation() == ForgeDirection.NORTH)
                    {
                        rotationAngle = 0;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.EAST)
                    {
                        rotationAngle = -90;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.SOUTH)
                    {
                        rotationAngle = 180;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.WEST)
                    {
                        rotationAngle = 90;
                    }

                    yShift = 0.999d;
                    xRotate = 1;
                }
                else if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.NORTH)
                {
                    if (tileEntityAlchemyArray.getRotation() == ForgeDirection.UP)
                    {
                        rotationAngle = -90;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.EAST)
                    {
                        rotationAngle = -180;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.DOWN)
                    {
                        rotationAngle = 90;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.WEST)
                    {
                        rotationAngle = 0;
                    }

                    zRotate = 1;
                    zShift = 0.999d;
                }
                else if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.SOUTH)
                {
                    if (tileEntityAlchemyArray.getRotation() == ForgeDirection.UP)
                    {
                        rotationAngle = -90;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.EAST)
                    {
                        rotationAngle = 0;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.DOWN)
                    {
                        rotationAngle = 90;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.WEST)
                    {
                        rotationAngle = -180;
                    }

                    zRotate = -1;
                    zShift = 0.001d;
                }
                else if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.EAST)
                {
                    if (tileEntityAlchemyArray.getRotation() == ForgeDirection.UP)
                    {
                        rotationAngle = 180;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.DOWN)
                    {
                        rotationAngle = 0;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.NORTH)
                    {
                        rotationAngle = -90;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.SOUTH)
                    {
                        rotationAngle = 90;
                    }

                    yRotate = 1;
                    xShift = 0.001d;
                }
                else if (tileEntityAlchemyArray.getOrientation() == ForgeDirection.WEST)
                {
                    if (tileEntityAlchemyArray.getRotation() == ForgeDirection.UP)
                    {
                        rotationAngle = 180;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.DOWN)
                    {
                        rotationAngle = 0;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.NORTH)
                    {
                        rotationAngle = 90;
                    }
                    else if (tileEntityAlchemyArray.getRotation() == ForgeDirection.SOUTH)
                    {
                        rotationAngle = -90;
                    }

                    yRotate = -1;
                    xShift = 0.999d;
                }

                GL11.glPushMatrix();
                GL11.glTranslated(x + xShift, y + yShift, z + zShift);
                GL11.glScalef(1f * scale, 1f * scale, 1f * scale);
                GL11.glRotatef(rotationAngle, tileEntityAlchemyArray.getOrientation().offsetX, tileEntityAlchemyArray.getOrientation().offsetY, tileEntityAlchemyArray.getOrientation().offsetZ);
                GL11.glRotatef(90, xRotate, yRotate, zRotate);
                RenderUtils.renderQuad(glyph.getTexture());
                GL11.glPopMatrix();
            }
            GL11.glDepthMask(true);
View Full Code Here

    }

    @Override
    public TileEntity createNewTileEntity(World world, int metaData)
    {
        return new TileEntityAludel();
    }
View Full Code Here

    }

    @Override
    public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
    {
        TileEntityAludel tileEntityAludel = (TileEntityAludel) world.getTileEntity(x, y, z);
        tileEntityAludel.hasGlassBell = world.getTileEntity(x, y + 1, z) instanceof TileEntityGlassBell;

        super.onNeighborBlockChange(world, x, y, z, block);
    }
View Full Code Here

            tileEntityGlassBell.setOrientation(ForgeDirection.UP);

            if (world.getTileEntity(x, y, z) instanceof TileEntityAludel)
            {
                TileEntityAludel tileEntityAludel = (TileEntityAludel) world.getTileEntity(x, y, z);

                ItemStack itemStackGlassBell = tileEntityGlassBell.getStackInSlot(TileEntityGlassBell.DISPLAY_SLOT_INVENTORY_INDEX);

                tileEntityGlassBell.setInventorySlotContents(TileEntityGlassBell.DISPLAY_SLOT_INVENTORY_INDEX, null);

                tileEntityAludel.setInventorySlotContents(TileEntityAludel.INPUT_INVENTORY_INDEX, itemStackGlassBell);

                tileEntityAludel.hasGlassBell = true;
            }
        }
    }
View Full Code Here

    }

    @Override
    public TileEntity createNewTileEntity(World world, int metaData)
    {
        return new TileEntityAugmentationTable();
    }
View Full Code Here

TOP

Related Classes of com.pahimar.ee3.api.AlchemyArrayRegistryProxy

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.