Search in sources :

Example 56 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project PneumaticCraft by MineMaarten.

the class MainHelmetHandler method getAnimatedStat.

@Override
@SideOnly(Side.CLIENT)
public IGuiAnimatedStat getAnimatedStat() {
    if (powerStat == null) {
        Minecraft minecraft = Minecraft.getMinecraft();
        ScaledResolution sr = new ScaledResolution(minecraft, minecraft.displayWidth, minecraft.displayHeight);
        powerStat = new GuiAnimatedStat(null, "Helmet Pressure: ", "", powerStatX != -1 ? powerStatX : sr.getScaledWidth() - 2, powerStatY, 0x3000AA00, null, powerStatLeftSided);
        powerStat.setMinDimensionsAndReset(0, 0);
        powerStat.openWindow();
    }
    return powerStat;
}
Also used : ScaledResolution(net.minecraft.client.gui.ScaledResolution) GuiAnimatedStat(pneumaticCraft.client.gui.widget.GuiAnimatedStat) IGuiAnimatedStat(pneumaticCraft.api.client.IGuiAnimatedStat) Minecraft(net.minecraft.client.Minecraft) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 57 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project PneumaticCraft by MineMaarten.

the class BlockPneumaticCraft method addInformation.

@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List curInfo, boolean extraInfo) {
    if (PneumaticCraft.proxy.isSneakingInGui()) {
        TileEntity te = createNewTileEntity(player.worldObj, 0);
        if (te instanceof TileEntityPneumaticBase) {
            float pressure = ((TileEntityPneumaticBase) te).DANGER_PRESSURE;
            curInfo.add(EnumChatFormatting.YELLOW + I18n.format("gui.tooltip.maxPressure", pressure));
        }
    }
    String info = "gui.tab.info." + stack.getUnlocalizedName();
    String translatedInfo = I18n.format(info);
    if (!translatedInfo.equals(info)) {
        if (PneumaticCraft.proxy.isSneakingInGui()) {
            translatedInfo = EnumChatFormatting.AQUA + translatedInfo.substring(2);
            if (!Loader.isModLoaded(ModIds.IGWMOD))
                translatedInfo += " \\n \\n" + I18n.format("gui.tab.info.assistIGW");
            curInfo.addAll(PneumaticCraftUtils.convertStringIntoList(translatedInfo, 60));
        } else {
            curInfo.add(EnumChatFormatting.AQUA + I18n.format("gui.tooltip.sneakForInfo"));
        }
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityPneumaticBase(pneumaticCraft.common.tileentity.TileEntityPneumaticBase) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 58 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project PneumaticCraft by MineMaarten.

the class BlockPressureTube method randomDisplayTick.

@Override
@SideOnly(Side.CLIENT)
public /**
 * A randomly called display update to be able to add particles or other items for display
 */
void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
    TileEntity te = par1World.getTileEntity(par2, par3, par4);
    if (te instanceof TileEntityPressureTube) {
        TileEntityPressureTube tePt = (TileEntityPressureTube) te;
        int l = 0;
        for (TubeModule module : tePt.modules) if (module != null)
            l = Math.max(l, module.getRedstoneLevel());
        if (l > 0) {
            // for(int i = 0; i < 4; i++){
            double d0 = par2 + 0.5D + (par5Random.nextFloat() - 0.5D) * 0.5D;
            double d1 = par3 + 0.5D + (par5Random.nextFloat() - 0.5D) * 0.5D;
            double d2 = par4 + 0.5D + (par5Random.nextFloat() - 0.5D) * 0.5D;
            float f = l / 15.0F;
            float f1 = f * 0.6F + 0.4F;
            float f2 = f * f * 0.7F - 0.5F;
            float f3 = f * f * 0.6F - 0.7F;
            if (f2 < 0.0F) {
                f2 = 0.0F;
            }
            if (f3 < 0.0F) {
                f3 = 0.0F;
            }
            // PacketDispatcher.sendPacketToAllPlayers(PacketHandlerPneumaticCraft.spawnParticle("reddust",
            // d0, d1, d2, (double)f1, (double)f2, (double)f3));
            par1World.spawnParticle("reddust", d0, d1, d2, f1, f2, f3);
        // }
        }
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TubeModule(pneumaticCraft.common.block.tubes.TubeModule) ItemTubeModule(pneumaticCraft.common.item.ItemTubeModule) TileEntityPressureTube(pneumaticCraft.common.tileentity.TileEntityPressureTube) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 59 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project PneumaticCraft by MineMaarten.

the class RenderProgressingLine method render.

@SideOnly(Side.CLIENT)
public void render() {
    Tessellator tess = Tessellator.instance;
    tess.startDrawing(GL11.GL_LINES);
    tess.addVertex(startX, startY, startZ);
    tess.addVertex(startX + (endX - startX) * progress, startY + (endY - startY) * progress, startZ + (endZ - startZ) * progress);
    tess.draw();
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 60 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project PneumaticCraft by MineMaarten.

the class ItemPneumaticArmor method getSubItems.

@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item par1, CreativeTabs tab, List subItems) {
    subItems.add(new ItemStack(this));
    ItemStack chargedStack = new ItemStack(this);
    addAir(chargedStack, PneumaticValues.PNEUMATIC_HELMET_VOLUME * 10);
    subItems.add(chargedStack);
}
Also used : ItemStack(net.minecraft.item.ItemStack) 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