Search in sources :

Example 71 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project ArsMagica2 by Mithion.

the class BlockCraftingAltar method getAltarMimicBlock.

@SideOnly(Side.CLIENT)
public Block getAltarMimicBlock(IBlockAccess world, int x, int y, int z) {
    TileEntity te = world.getTileEntity(x, y, z);
    if (te == null || !(te instanceof TileEntityCraftingAltar) || !((TileEntityCraftingAltar) te).structureValid())
        return this;
    Block[] blocks = new Block[4];
    blocks[0] = world.getBlock(x - 1, y, z);
    blocks[1] = world.getBlock(x + 1, y, z);
    blocks[2] = world.getBlock(x, y, z + 1);
    blocks[3] = world.getBlock(x, y, z - 1);
    if (blocks[0] != Blocks.air && blocks[0] == blocks[1]) {
        return blocks[0];
    } else if (blocks[2] != Blocks.air && blocks[2] == blocks[3]) {
        return blocks[2];
    }
    return this;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityCraftingAltar(am2.blocks.tileentities.TileEntityCraftingAltar) Block(net.minecraft.block.Block) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 72 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project ArsMagica2 by Mithion.

the class BlockDesertNova method randomDisplayTick.

@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, int x, int y, int z, Random par5Random) {
    if (par5Random.nextInt(10) != 0)
        return;
    int increment = AMCore.config.getGFXLevel() * 15;
    if (increment <= 0)
        return;
    for (int i = 0; i < 360; i += increment) {
        int angle = i;
        double posX = x + 0.5 + Math.cos(angle) * 3;
        double posZ = z + 0.5 + Math.sin(angle) * 3;
        double posY = y + 0.6 + par5Random.nextFloat() * 0.2f;
        AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(world, "explosion_2", x + 0.5, posY, z + 0.5);
        if (effect != null) {
            effect.setIgnoreMaxAge(true);
            effect.AddParticleController(new ParticleExpandingCollapsingRingAtPoint(effect, posX, posY, posZ, 0.3, 3, 0.2, 1, false).setExpanding());
            // effect.AddParticleController(new ParticleOrbitPoint(effect, x+0.5, y, z+0.5, 1, false).SetTargetDistance(0.35f + par5Random.nextFloat() * 0.2f).SetOrbitSpeed(0.5f).setIgnoreYCoordinate(true));
            // effect.AddParticleController(new ParticleFloatUpward(effect, 0, 0.035f, 1, false));
            effect.AddParticleController(new ParticleFadeOut(effect, 2, false).setFadeSpeed(0.05f).setKillParticleOnFinish(true));
            effect.setParticleScale(0.05f);
        }
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleExpandingCollapsingRingAtPoint(am2.particles.ParticleExpandingCollapsingRingAtPoint) ParticleFadeOut(am2.particles.ParticleFadeOut) ParticleExpandingCollapsingRingAtPoint(am2.particles.ParticleExpandingCollapsingRingAtPoint) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 73 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project ArsMagica2 by Mithion.

the class BlockEverstone method addHitEffects.

@Override
@SideOnly(Side.CLIENT)
public boolean addHitEffects(World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer) {
    TileEntityEverstone everstone = getTE(worldObj, target.blockX, target.blockY, target.blockZ);
    AMParticle particle;
    Block block;
    int blockMeta = 0;
    if (everstone == null || everstone.getFacade() == null) {
        block = this;
    } else {
        block = everstone.getFacade();
        if (block == null)
            block = this;
        blockMeta = everstone.getFacadeMeta();
    }
    effectRenderer.addEffect(new EntityDiggingFX(worldObj, target.blockX + worldObj.rand.nextDouble(), target.blockY + worldObj.rand.nextDouble(), target.blockZ + worldObj.rand.nextDouble(), 0, 0, 0, block, blockMeta, 0));
    return true;
}
Also used : EntityDiggingFX(net.minecraft.client.particle.EntityDiggingFX) AMParticle(am2.particles.AMParticle) Block(net.minecraft.block.Block) ItemBlock(net.minecraft.item.ItemBlock) TileEntityEverstone(am2.blocks.tileentities.TileEntityEverstone) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 74 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project ArsMagica2 by Mithion.

the class ItemCrystalPhylactery method getSubItems.

@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
    par3List.add(new ItemStack(this));
    for (String s : spawnableEntities.keySet()) {
        ItemStack stack = new ItemStack(this, 1, META_FULL);
        stack.stackTagCompound = new NBTTagCompound();
        stack.stackTagCompound.setString("SpawnClassName", s);
        stack.stackTagCompound.setFloat("PercentFilled", 100);
        par3List.add(stack);
    }
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) ItemStack(net.minecraft.item.ItemStack) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 75 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project ArsMagica2 by Mithion.

the class VinteumTorch method spawnParticle.

@SideOnly(Side.CLIENT)
private void spawnParticle(World world, double x, double y, double z) {
    AMParticle effect = (AMParticle) AMCore.instance.proxy.particleManager.spawn(world, "light", x, y, z);
    if (effect != null) {
        effect.setMaxAge(3);
        effect.setIgnoreMaxAge(false);
        effect.setRGBColorF(0.69f, 0.89f, 1.0f);
        effect.AddParticleController(new ParticleFloatUpward(effect, 0, 0.01f, 1, false));
    }
}
Also used : AMParticle(am2.particles.AMParticle) ParticleFloatUpward(am2.particles.ParticleFloatUpward) 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