Search in sources :

Example 66 with SideOnly

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

the class Minigun method render.

@SideOnly(Side.CLIENT)
public void render(double x, double y, double z, double gunRadius) {
    if (isMinigunActivated() && getMinigunSpeed() == MAX_GUN_SPEED && gunAimedAtTarget && attackTarget != null) {
        GL11.glPushMatrix();
        GL11.glScaled(1, 1, 1);
        GL11.glTranslated(-x, -y, -z);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        // GL11.glDisable(GL11.GL_LIGHTING);
        RenderUtils.glColorHex(0xFF000000 | getAmmoColor());
        for (int i = 0; i < 5; i++) {
            Vec3 vec = Vec3.createVectorHelper(attackTarget.posX - x, attackTarget.posY - y, attackTarget.posZ - z).normalize();
            minigunFire.startX = x + vec.xCoord * gunRadius;
            minigunFire.startY = y + vec.yCoord * gunRadius;
            minigunFire.startZ = z + vec.zCoord * gunRadius;
            minigunFire.endX = attackTarget.posX + rand.nextDouble() - 0.5;
            minigunFire.endY = attackTarget.posY + attackTarget.height / 2 + rand.nextDouble() - 0.5;
            minigunFire.endZ = attackTarget.posZ + rand.nextDouble() - 0.5;
            minigunFire.render();
        }
        GL11.glColor4d(1, 1, 1, 1);
        // GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glPopMatrix();
    }
}
Also used : Vec3(net.minecraft.util.Vec3) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 67 with SideOnly

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

the class ItemGunAmmo method addInformation.

@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List infoList, boolean extraInfo) {
    infoList.add(I18n.format("gui.tooltip.gunAmmo.combineWithPotion"));
    ItemStack potion = getPotion(stack);
    if (potion != null) {
        potion.getItem().addInformation(potion, player, infoList, extraInfo);
        if (infoList.size() > 2)
            infoList.set(2, I18n.format("gui.tooltip.gunAmmo") + " " + infoList.get(2));
    }
    super.addInformation(stack, player, infoList, extraInfo);
}
Also used : ItemStack(net.minecraft.item.ItemStack) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 68 with SideOnly

use of cpw.mods.fml.relauncher.SideOnly in project Minechem by iopleke.

the class MoleculeItem method addInformation.

@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
    list.add("\u00A79" + getFormulaWithSubscript(itemstack));
    RadiationEnum radioactivity = RadiationInfo.getRadioactivity(itemstack);
    String radioactivityColor = radioactivity.getColour();
    String radioactiveName = MinechemUtil.getLocalString("element.property." + radioactivity.name(), true);
    String timeLeft = "";
    if (RadiationInfo.getRadioactivity(itemstack) != RadiationEnum.stable && itemstack.getTagCompound() != null) {
        long worldTime = player.worldObj.getTotalWorldTime();
        timeLeft = TimeHelper.getTimeFromTicks(RadiationInfo.getRadioactivity(itemstack).getLife() - (worldTime - itemstack.getTagCompound().getLong("decayStart")));
    }
    list.add(radioactivityColor + radioactiveName + (timeLeft.equals("") ? "" : " (" + timeLeft + ")"));
    list.add(getRoomState(itemstack));
    MoleculeEnum molecule = MoleculeEnum.getById(itemstack.getItemDamage());
    if (PharmacologyEffectRegistry.hasEffect(molecule) && Settings.displayMoleculeEffects) {
        if (PolytoolHelper.getTypeFromElement(ElementItem.getElement(itemstack), 1) != null) {
            // Polytool Detail
            if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
                for (PharmacologyEffect effect : PharmacologyEffectRegistry.getEffects(molecule)) {
                    list.add(effect.getColour() + effect.toString());
                }
            } else {
                list.add(EnumColour.DARK_GREEN + MinechemUtil.getLocalString("effect.information", true));
            }
        }
    }
}
Also used : RadiationEnum(minechem.radiation.RadiationEnum) PharmacologyEffect(minechem.potion.PharmacologyEffect) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 69 with SideOnly

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

the class ProgWidgetBlockCondition method getOptionWindow.

@Override
@SideOnly(Side.CLIENT)
public GuiScreen getOptionWindow(GuiProgrammer guiProgrammer) {
    return new GuiProgWidgetCondition(this, guiProgrammer) {

        @Override
        public void initGui() {
            super.initGui();
            addWidget(new GuiCheckBox(500, guiLeft + 5, guiTop + 60, 0xFF000000, I18n.format("gui.progWidget.conditionBlock.checkForAir")).setChecked(checkingForAir).setTooltip(I18n.format("gui.progWidget.conditionBlock.checkForAir.tooltip")));
            addWidget(new GuiCheckBox(501, guiLeft + 5, guiTop + 72, 0xFF000000, I18n.format("gui.progWidget.conditionBlock.checkForLiquids")).setChecked(checkingForLiquids).setTooltip(I18n.format("gui.progWidget.conditionBlock.checkForLiquids.tooltip")));
        }

        @Override
        protected boolean requiresNumber() {
            return false;
        }

        @Override
        protected boolean isSidedWidget() {
            return false;
        }

        @Override
        public void actionPerformed(IGuiWidget widget) {
            if (widget.getID() == 500)
                checkingForAir = !checkingForAir;
            if (widget.getID() == 501)
                checkingForLiquids = !checkingForLiquids;
            else
                super.actionPerformed(widget);
        }
    };
}
Also used : IGuiWidget(pneumaticCraft.client.gui.widget.IGuiWidget) GuiProgWidgetCondition(pneumaticCraft.client.gui.programmer.GuiProgWidgetCondition) GuiCheckBox(pneumaticCraft.client.gui.widget.GuiCheckBox) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 70 with SideOnly

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

the class BlockManaBattery method getSubBlocks.

@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
    ItemStack stack = new ItemStack(this);
    par3List.add(stack);
    for (PowerTypes type : PowerTypes.all()) {
        stack = new ItemStack(this, 1, type.ID());
        stack.stackTagCompound = new NBTTagCompound();
        stack.stackTagCompound.setFloat("mana_battery_charge", new TileEntityManaBattery().getCapacity());
        stack.stackTagCompound.setInteger("mana_battery_powertype", type.ID());
        par3List.add(stack);
    }
}
Also used : PowerTypes(am2.api.power.PowerTypes) TileEntityManaBattery(am2.blocks.tileentities.TileEntityManaBattery) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) 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