Search in sources :

Example 46 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project Armourers-Workshop by RiskyKen.

the class TileEntitySkinnable method getRenderBoundingBox.

@SideOnly(Side.CLIENT)
@Override
public AxisAlignedBB getRenderBoundingBox() {
    if (renderBounds == null) {
        if (hasSkin()) {
            Skin skin = getSkin(getSkinPointer());
            if (skin != null) {
                if (SkinProperties.PROP_BLOCK_MULTIBLOCK.getValue(skin.getProperties())) {
                    renderBounds = AxisAlignedBB.getBoundingBox(xCoord - 1, yCoord, zCoord - 1, xCoord + 2, yCoord + 3, zCoord + 2);
                    ForgeDirection dir = getRotation().getOpposite();
                    renderBounds.offset(dir.offsetX, 0, dir.offsetZ);
                } else {
                    renderBounds = AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1);
                }
            } else {
                return AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1);
            }
        } else {
            return AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1);
        }
    }
    return renderBounds;
}
Also used : ForgeDirection(net.minecraftforge.common.util.ForgeDirection) Skin(riskyken.armourersWorkshop.common.skin.data.Skin) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 47 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project Armourers-Workshop by RiskyKen.

the class TileEntityHologramProjector method getRenderBoundingBox.

@SideOnly(Side.CLIENT)
@Override
public AxisAlignedBB getRenderBoundingBox() {
    AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(-2, -2, -2, 3, 3, 3);
    ForgeDirection dir = ForgeDirection.getOrientation(getBlockMetadata());
    bb.offset(xCoord, yCoord, zCoord);
    float scale = 0.0625F;
    switch(dir) {
        case UP:
            bb.offset(offsetX * scale, offsetY * scale, offsetZ * scale);
            break;
        case DOWN:
            bb.offset(-offsetX * scale, -offsetY * scale, offsetZ * scale);
            break;
        case EAST:
            bb.offset(offsetY * scale, -offsetX * scale, offsetZ * scale);
            break;
        case WEST:
            bb.offset(-offsetY * scale, offsetX * scale, offsetZ * scale);
            break;
        case NORTH:
            bb.offset(-offsetX * scale, -offsetZ * scale, -offsetY * scale);
            break;
        case SOUTH:
            bb.offset(-offsetX * scale, offsetZ * scale, offsetY * scale);
            break;
        default:
            break;
    }
    return bb;
}
Also used : AxisAlignedBB(net.minecraft.util.AxisAlignedBB) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 48 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project Armourers-Workshop by RiskyKen.

the class TileEntityMannequin method setupFakePlayer.

@SideOnly(Side.CLIENT)
private void setupFakePlayer() {
    if (fakePlayer != null) {
        return;
    }
    fakePlayer = new MannequinFakePlayer(worldObj, new GameProfile(null, "[Mannequin]"));
    fakePlayer.posX = xCoord;
    fakePlayer.posY = yCoord;
    fakePlayer.posZ = zCoord;
    fakePlayer.prevPosX = xCoord;
    fakePlayer.prevPosY = yCoord;
    fakePlayer.prevPosZ = zCoord;
}
Also used : MannequinFakePlayer(riskyken.armourersWorkshop.client.render.MannequinFakePlayer) GameProfile(com.mojang.authlib.GameProfile) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 49 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project Armourers-Workshop by RiskyKen.

the class TileEntityArmourer method getRenderBoundingBox.

@SideOnly(Side.CLIENT)
@Override
public AxisAlignedBB getRenderBoundingBox() {
    AxisAlignedBB bb = super.getRenderBoundingBox();
    bb = AxisAlignedBB.getBoundingBox(xCoord - 15, yCoord - 10, zCoord - 46, xCoord + 30, yCoord + 40 + 23, zCoord + 35);
    return bb;
}
Also used : AxisAlignedBB(net.minecraft.util.AxisAlignedBB) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 50 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project Armourers-Workshop by RiskyKen.

the class BlockMannequin method randomDisplayTick.

@SideOnly(Side.CLIENT)
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random random) {
    if (isTopOfMannequin(world, x, y, z)) {
        if (isValentins) {
            if (random.nextFloat() * 100 > 75) {
                world.spawnParticle("heart", x + 0.2D + random.nextFloat() * 0.6F, y + 1D, z + 0.2D + random.nextFloat() * 0.6F, 0, 0, 0);
            }
        }
        TileEntityMannequin te = getMannequinTileEntity(world, x, y, z);
        if (te != null && te.isRenderExtras()) {
            Contributor contributor = Contributors.INSTANCE.getContributor(te.getGameProfile());
            if (contributor != null & te.isVisible()) {
                for (int i = 0; i < 4; i++) {
                    EntityFX entityfx = new EntitySpellParticleFX(world, x - 1 + random.nextFloat() * 3F, y - 1D, z - 1 + random.nextFloat() * 3F, 0, 0, 0);
                    ((EntitySpellParticleFX) entityfx).setBaseSpellTextureIndex(144);
                    entityfx.setRBGColorF((float) (contributor.r & 0xFF) / 255F, (float) (contributor.g & 0xFF) / 255F, (float) (contributor.b & 0xFF) / 255F);
                    Minecraft.getMinecraft().effectRenderer.addEffect(entityfx);
                }
            }
        }
    }
}
Also used : EntitySpellParticleFX(net.minecraft.client.particle.EntitySpellParticleFX) Contributor(riskyken.armourersWorkshop.common.Contributors.Contributor) EntityFX(net.minecraft.client.particle.EntityFX) TileEntityMannequin(riskyken.armourersWorkshop.common.tileentities.TileEntityMannequin) 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