Search in sources :

Example 21 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project LogisticsPipes by RS485.

the class HSTubeCurve method addCollisionBoxesToList.

@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "unchecked", "rawtypes" })
public void addCollisionBoxesToList(List arraylist, AxisAlignedBB axisalignedbb) {
    double x = getX();
    double y = getY();
    double z = getZ();
    double angle = 0;
    double addOne = 0;
    double addTwo = 0;
    if (orientation.getRenderOrientation() == TurnDirection.NORTH_EAST) {
        angle = 3 * Math.PI / 2;
        addOne = LPConstants.PIPE_MAX_POS;
        addTwo = LPConstants.PIPE_MIN_POS;
        z -= 2;
        x += 1;
    } else if (orientation.getRenderOrientation() == TurnDirection.EAST_SOUTH) {
        angle = 2 * Math.PI / 2;
        addOne = LPConstants.PIPE_MIN_POS;
        addTwo = LPConstants.PIPE_MAX_POS;
        x += 3;
        z += 1;
    } else if (orientation.getRenderOrientation() == TurnDirection.SOUTH_WEST) {
        angle = Math.PI / 2;
        addOne = LPConstants.PIPE_MAX_POS;
        addTwo = LPConstants.PIPE_MIN_POS;
        z += 3;
    } else if (orientation.getRenderOrientation() == TurnDirection.WEST_NORTH) {
        angle = 0;
        addOne = LPConstants.PIPE_MIN_POS;
        addTwo = LPConstants.PIPE_MAX_POS;
        x -= 2;
    }
    for (int i = 0; i < 49; i++) {
        double xOne = x;
        double yMin = y + LPConstants.PIPE_MIN_POS;
        double zOne = z;
        double xTwo = x;
        double yMax = y + LPConstants.PIPE_MAX_POS;
        double zTwo = z;
        xOne += (2 + addOne) * Math.sin(angle + (2 * Math.PI / 200 * (i)));
        zOne += (2 + addOne) * Math.cos(angle + (2 * Math.PI / 200 * (i + 2)));
        xTwo += (2 + addTwo) * Math.sin(angle + (2 * Math.PI / 200 * (i + 1)));
        zTwo += (2 + addTwo) * Math.cos(angle + (2 * Math.PI / 200 * (i)));
        AxisAlignedBB box = AxisAlignedBB.getBoundingBox(Math.min(xOne, xTwo), yMin, Math.min(zOne, zTwo), Math.max(xOne, xTwo), yMax, Math.max(zOne, zTwo));
        if (box != null && (axisalignedbb == null || axisalignedbb.intersectsWith(box))) {
            arraylist.add(box);
        }
    }
}
Also used : AxisAlignedBB(net.minecraft.util.AxisAlignedBB) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 22 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project LogisticsPipes by RS485.

the class ForestryProxy method getIconIndexForAlleleId.

/**
	 * Used to get an icon index for a given allele.
	 * 
	 * @param uid
	 *            The uid String of the allele to get icon index for.
	 * @param phase
	 *            special phase of the bee.
	 */
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconIndexForAlleleId(String uid, int phase) {
    IAllele bSpecies = forestry.api.genetics.AlleleManager.alleleRegistry.getAllele(uid);
    if (!(bSpecies instanceof IAlleleBeeSpecies)) {
        bSpecies = root.getDefaultTemplate()[forestry.api.apiculture.EnumBeeChromosome.SPECIES.ordinal()];
    }
    IAlleleBeeSpecies species = (IAlleleBeeSpecies) bSpecies;
    return species.getIcon(EnumBeeType.DRONE, phase);
}
Also used : IAllele(forestry.api.genetics.IAllele) IAlleleBeeSpecies(forestry.api.apiculture.IAlleleBeeSpecies) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 23 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project LogisticsPipes by RS485.

the class ThermalDynamicsProxy method renderPipeConnections.

@Override
@SideOnly(Side.CLIENT)
public void renderPipeConnections(LogisticsTileGenericPipe pipeTile, RenderBlocks renderer) {
    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
        if (pipeTile.renderState.pipeConnectionMatrix.isTDConnected(dir)) {
            IconTransformation texture = connectionTextureBasic;
            if (pipeTile.renderState.textureMatrix.isRouted()) {
                if (pipeTile.renderState.textureMatrix.isRoutedInDir(dir)) {
                    texture = connectionTextureActive;
                } else {
                    texture = connectionTextureInactive;
                }
            }
            double move = 0.25;
            Translation localTranslation = new Translation(pipeTile.xCoord + 0.5D + dir.offsetX * move, pipeTile.yCoord + 0.5D + dir.offsetY * move, pipeTile.zCoord + 0.5D + dir.offsetZ * move);
            RenderDuct.modelConnection[2][dir.ordinal()].render(new CCRenderState.IVertexOperation[] { localTranslation, texture });
        }
    }
}
Also used : Translation(cofh.repack.codechicken.lib.vec.Translation) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) CCRenderState(cofh.repack.codechicken.lib.render.CCRenderState) IconTransformation(cofh.repack.codechicken.lib.render.uv.IconTransformation) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 24 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project Engine by VoltzEngine-Project.

the class VEProviderSmokeStream method displayEffect.

@Override
@SideOnly(Side.CLIENT)
public void displayEffect(World world, double x, double y, double z, double mx, double my, double mz, boolean movementIsEndpoint, NBTTagCompound otherData) {
    Color color = Color.gray;
    int lifeTicks = 2;
    if (otherData != null) {
        //load life timer for particle
        if (otherData.hasKey("lifeTime")) {
            lifeTicks = otherData.getInteger("lifeTime");
        }
        //Load color
        if (otherData.hasKey("red")) {
            color = new Color(otherData.getInteger("red"), otherData.getInteger("green"), otherData.getInteger("blue"));
        } else if (otherData.hasKey("color")) {
            color = new Color(otherData.getInteger("color"));
        }
    }
    FxBeam laser = new FxBeam(SharedAssets.NOISE_TEXTURE, world, new Pos(x, y, z), new Pos(mx, my, mz), color, lifeTicks);
    FMLClientHandler.instance().getClient().effectRenderer.addEffect(laser);
}
Also used : Pos(com.builtbroken.mc.imp.transform.vector.Pos) FxBeam(com.builtbroken.mc.lib.render.fx.FxBeam) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 25 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project ICBM-Classic by BuiltBrokenModding.

the class TileCamouflage method renderStatic.

@Override
@SideOnly(Side.CLIENT)
public boolean renderStatic(RenderBlocks renderer, Pos pos, int pass) {
    Block block = getMimicBlock() != null ? getMimicBlock() : getBlockType();
    //Render mimic block
    BlockWrapper wrapper = new BlockWrapper(block);
    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
        Block block2 = world().getBlock(xi() + dir.offsetX, yi() + dir.offsetY, zi() + dir.offsetZ);
        wrapper.setRenderSide(dir, block2 != getBlockType() && !canRenderSide(dir));
    }
    boolean rendered = renderer.renderStandardBlock(wrapper, xi(), yi(), zi());
    //Render see though sides
    if (renderSides != 0) {
        //Render outside
        wrapper = new BlockWrapper(useGlassRender ? Blocks.glass : Blocks.vine);
        for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
            wrapper.setRenderSide(dir, canRenderSide(dir));
        }
        if (renderer.renderStandardBlock(wrapper, xi(), yi(), zi())) {
            rendered = true;
        }
        //Render inside
        renderer.renderFromInside = true;
        renderer.setRenderBounds(.01, .01, .01, .99, .99, .99);
        wrapper = new BlockWrapper(useGlassRender ? Blocks.glass : Blocks.vine);
        for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
            Block block2 = world().getBlock(xi() + dir.offsetX, yi() + dir.offsetY, zi() + dir.offsetZ);
            wrapper.setRenderSide(dir, block2 != getBlockType());
        }
        if (renderer.renderStandardBlock(wrapper, xi(), yi(), zi())) {
            rendered = true;
        }
        renderer.renderFromInside = false;
    //TODO add border frame
    }
    return rendered;
}
Also used : ForgeDirection(net.minecraftforge.common.util.ForgeDirection) Block(net.minecraft.block.Block) ItemBlock(net.minecraft.item.ItemBlock) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

SideOnly (cpw.mods.fml.relauncher.SideOnly)204 ItemStack (net.minecraft.item.ItemStack)52 IIcon (net.minecraft.util.IIcon)17 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)17 Vec3dCube (uk.co.qmunity.lib.vec.Vec3dCube)13 Block (net.minecraft.block.Block)12 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)10 TileEntity (net.minecraft.tileentity.TileEntity)10 AxisAlignedBB (net.minecraft.util.AxisAlignedBB)9 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)8 ArrayList (java.util.ArrayList)8 Rotation (uk.co.qmunity.lib.transform.Rotation)8 AMParticle (am2.particles.AMParticle)6 IconFlipped (net.minecraft.client.renderer.IconFlipped)6 ItemBlock (net.minecraft.item.ItemBlock)6 Minecraft (net.minecraft.client.Minecraft)5 Tessellator (net.minecraft.client.renderer.Tessellator)5 EntityPlayer (net.minecraft.entity.player.EntityPlayer)5 GuiScreen (net.minecraft.client.gui.GuiScreen)4 RenderHelper (uk.co.qmunity.lib.client.render.RenderHelper)4