Java Code Examples for cpw.mods.fml.relauncher.Side

The following examples show how to use cpw.mods.fml.relauncher.Side. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister){
    texture = new IIcon[UPGRADES_AMOUNT];
    texture[0] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_VOLUME);
    texture[1] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_DISPENSER);
    texture[2] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_ITEM_LIFE);
    texture[3] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_ENTITY_TRACKER);
    texture[4] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_BLOCK_TRACKER);
    texture[5] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_SPEED);
    texture[6] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_SEARCH);
    texture[7] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_COORDINATE_TRACKER);
    texture[8] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_RANGE);
    texture[9] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_SECURITY);
    texture[10] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_THAUMCRAFT);
}
 
Example 2
Source Project: SimplyJetpacks   Source File: PackBase.java    License: MIT License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
@SuppressWarnings("unchecked")
public void addSubItems(ItemPack item, int meta, List list) {
    if (!this.showInCreativeTab) {
        return;
    }
    if (this.showEmptyInCreativeTab) {
        list.add(new ItemStack(item, 1, meta));
    }
    ItemStack full = new ItemStack(item, 1, meta);
    item.addFuel(full, item.getMaxFuelStored(full), false);
    list.add(full);
}
 
Example 3
@Override
@SideOnly(Side.CLIENT)
public void render3D(float partialTicks){
    if(coordTracker != null) {
        if(FMLClientHandler.instance().getClient().thePlayer.worldObj.provider.dimensionId != coordTracker.worldObj.provider.dimensionId) return;
        coordTracker.render(partialTicks);
        if(pathEnabled && navigator != null) {
            navigator.render(wirePath, xRayEnabled, partialTicks);
        }
    }
}
 
Example 4
Source Project: GardenCollection   Source File: BlockLargePot.java    License: MIT License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
@Override
public void registerBlockIcons (IIconRegister iconRegister) {
    iconOverlayArray = new IIcon[256];
    for (int i = 1; i < iconOverlayArray.length; i++) {
        PatternConfig pattern = GardenContainers.config.getPattern(i);
        if (pattern != null && pattern.getOverlay() != null)
            iconOverlayArray[i] = iconRegister.registerIcon(GardenContainers.MOD_ID + ":" + pattern.getOverlay());
    }
}
 
Example 5
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister ir) {
    icons = new IIcon[2];

    icons[0] = ir.registerIcon("forbidden:emptycrystal");
    icons[1] = ir.registerIcon("forbidden:mobcrystal");
}
 
Example 6
Source Project: NOVA-Core   Source File: FWBlock.java    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
@SideOnly(Side.CLIENT)
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, net.minecraft.block.Block block, int modelId, RenderBlocks renderBlocks) {
	Block blockInstance = getBlockInstance(world, new Vector3D(x, y, z));
	Optional<StaticRenderer> staticRenderer = blockInstance.components.getOp(StaticRenderer.class);
	if (staticRenderer.isPresent()) {
		BWModel model = new BWModel();
		model.matrix = new MatrixStack().translate(x + 0.5, y + 0.5, z + 0.5);
		staticRenderer.get().onRender.accept(model);
		model.render(world);

		return Tessellator.instance.rawBufferIndex != 0; // Returns true if Tesselator is not empty. Avoids crash on empty Tesselator buffer.
	}
	return false;
}
 
Example 7
Source Project: mocreaturesdev   Source File: MoCBlockDirt.java    License: GNU General Public License v3.0 5 votes vote down vote up
@SideOnly(Side.CLIENT)
@Override
public void getSubBlocks(int par1, CreativeTabs tab, List subItems) 
{
    for (int ix = 0; ix < MoCreatures.multiBlockNames.size(); ix++) 
    {
        subItems.add(new ItemStack(this, 1, ix));
    }
}
 
Example 8
Source Project: SimplyJetpacks   Source File: ItemPack.java    License: MIT License 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings("unchecked")
public void getSubItems(Item item, CreativeTabs tab, List list) {
    for (Entry<Integer, T> e : this.packs.entrySet()) {
        e.getValue().addSubItems(this, e.getKey(), list);
    }
}
 
Example 9
Source Project: ExtraCells1   Source File: PacketMEBattery.java    License: MIT License 5 votes vote down vote up
@Override
public void execute(EntityPlayer player, Side side) throws ProtocolException
{
	if (side.isServer())
	{
		TileEntityMEBattery tile = (TileEntityMEBattery) world.getBlockTileEntity(x, y, z);
		tile.updateGuiTile(playername);
	}
}
 
Example 10
Source Project: mocreaturesdev   Source File: MoCBlockRock.java    License: GNU General Public License v3.0 5 votes vote down vote up
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister par1IconRegister)
{
    icons = new Icon[MoCreatures.multiBlockNames.size()];
    
    for (int x = 0; x < MoCreatures.multiBlockNames.size(); x++)
    {
        icons[x] = par1IconRegister.registerIcon("mocreatures:" + "rock_" + MoCreatures.multiBlockNames.get(x));
    }
    
}
 
Example 11
@Override
@SideOnly(Side.CLIENT)
public IMessage onMessage(PacketTCNodeBolt p, MessageContext ctx) {
    FXLightningBolt bolt = new FXLightningBolt(Minecraft.getMinecraft().theWorld, p.x, p.y, p.z, p.targetX, p.targetY, p.targetZ, Minecraft.getMinecraft().theWorld.rand.nextLong(), 10, 4.0F, 5);
    bolt.defaultFractal();
    bolt.setType(p.type);
    bolt.finalizeBolt();
    return null;
}
 
Example 12
Source Project: ExtraCells1   Source File: ItemStoragePhysical.java    License: MIT License 5 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{
	Boolean partitioned = Util.getCellRegistry().getHandlerForCell(stack).isPreformatted();
	Boolean fuzzy = Util.getCellRegistry().getHandlerForCell(stack).isFuzzyPreformatted();
	long used_bytes = Util.getCellRegistry().getHandlerForCell(stack).usedBytes();
	long total_bytes = Util.getCellRegistry().getHandlerForCell(stack).totalBytes();
	long used_types = Util.getCellRegistry().getHandlerForCell(stack).storedItemTypes();
	long total_types = Util.getCellRegistry().getHandlerForCell(stack).getTotalItemTypes();
	if (stack.getItemDamage() != 4)
	{
		list.add(used_bytes + " " + StatCollector.translateToLocal("Appeng.GuiITooltip.Of") + " " + total_bytes + " " + StatCollector.translateToLocal("Appeng.GuiITooltip.BytesUsed"));
		list.add(used_types + " " + StatCollector.translateToLocal("Appeng.GuiITooltip.Of") + " " + total_types + " " + StatCollector.translateToLocal("Appeng.GuiITooltip.Types"));
	} else if (stack.getItemDamage() == 4)
	{
		if (used_bytes != 0)
		{
			list.add(StatCollector.translateToLocal("tooltip.block") + ": " + Util.getCellRegistry().getHandlerForCell(stack).getAvailableItems().getItems().get(0).getDisplayName());
		} else
		{
			list.add(StatCollector.translateToLocal("tooltip.block") + ": -");
		}
		list.add(used_bytes + " " + StatCollector.translateToLocal("Appeng.GuiITooltip.Of") + " " + total_bytes + " " + StatCollector.translateToLocal("Appeng.GuiITooltip.BytesUsed"));
	}
	if (partitioned)
	{
		if (fuzzy)
		{
			list.add(StatCollector.translateToLocal("Appeng.GuiITooltip.Partitioned") + " - " + StatCollector.translateToLocal("Appeng.GuiITooltip.Fuzzy"));
		} else
		{
			list.add(StatCollector.translateToLocal("Appeng.GuiITooltip.Partitioned") + " - " + StatCollector.translateToLocal("Appeng.GuiITooltip.Precise"));
		}
	}
}
 
Example 13
Source Project: ExtraCells1   Source File: BlockMEDropper.java    License: MIT License 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public Icon getBlockTexture(IBlockAccess blockAccess, int x, int y, int z, int side)
{
	TileEntity tileentity = blockAccess.getBlockTileEntity(x, y, z);
	int metadata = blockAccess.getBlockMetadata(x, y, z);

	if (tileentity != null)
	{
		return side == metadata ? (metadata != 1 && metadata != 0 ? frontHorizontalIcon : frontVerticalIcon) : (metadata != 1 && metadata != 0 ? (side != 1 && side != 0 ? sideIcon : topIcon) : topIcon);
	}
	return null;
}
 
Example 14
Source Project: mocreaturesdev   Source File: MoCBlockDirt.java    License: GNU General Public License v3.0 5 votes vote down vote up
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister par1IconRegister)
{
    icons = new Icon[MoCreatures.multiBlockNames.size()];
    
    for (int x = 0; x < MoCreatures.multiBlockNames.size(); x++)
    {
        icons[x] = par1IconRegister.registerIcon("mocreatures:" + "dirt_" + MoCreatures.multiBlockNames.get(x));
        //System.out.println("adding icon " + icons[x] + " with texture " + "mocreatures:" + "dirt_" +MoCreatures.multiBlockNames.get(x));
    }
    
}
 
Example 15
Source Project: Et-Futurum   Source File: ClientEventHandler.java    License: The Unlicense 5 votes vote down vote up
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void loadTextures(TextureStitchEvent.Pre event) {
	if (EtFuturum.enablePrismarine)
		if (event.map.getTextureType() == 0) {
			TextureAtlasSprite icon = new PrismarineIcon("prismarine_rough");
			if (event.map.setTextureEntry("prismarine_rough", icon))
				((PrismarineBlocks) ModBlocks.prismarine).setIcon(0, icon);
			else
				((PrismarineBlocks) ModBlocks.prismarine).setIcon(0, event.map.registerIcon("prismarine_rough"));
		}
}
 
Example 16
Source Project: GardenCollection   Source File: TileEntityBloomeryFurnace.java    License: MIT License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public int getBurnTimeRemainingScaled (int ceiling) {
    if (currentItemBurnTime == 0)
        currentItemBurnTime = 200;

    return ceiling * furnaceBurnTime / currentItemBurnTime;
}
 
Example 17
Source Project: SimplyJetpacks   Source File: ItemPack.java    License: MIT License 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void addHUDInfo(List<String> list, ItemStack stack, boolean showFuel, boolean showState) {
    T pack = this.getPack(stack);
    if (pack != null) {
        if (showFuel && pack.hasFuelIndicator) {
            list.add(pack.getHUDFuelInfo(stack, this));
        }
        if (showState && pack.hasStateIndicators) {
            list.add(pack.getHUDStatesInfo(stack, this));
        }
    }
}
 
Example 18
Source Project: Et-Futurum   Source File: TippedArrow.java    License: The Unlicense 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass) {
	PotionEffect effect = getEffect(stack);
	if (effect == null || effect.getPotionID() < 0 || effect.getPotionID() >= Potion.potionTypes.length)
		return super.getColorFromItemStack(stack, pass);
	return pass == 0 ? Potion.potionTypes[effect.getPotionID()].getLiquidColor() : super.getColorFromItemStack(stack, pass);
}
 
Example 19
Source Project: Et-Futurum   Source File: ContainerNewBrewingStand.java    License: The Unlicense 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void updateProgressBar(int id, int value) {
	if (id == 0)
		tile.func_145938_d(value);
	else if (id == 1)
		tile.setFuel(value);
	else if (id == 2)
		tile.setCurrentFuel(value);
}
 
Example 20
Source Project: OpenPeripheral-Addons   Source File: LiquidIcon.java    License: MIT License 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
protected void drawContents(RenderState renderState, float partialTicks) {
	if (fluidIcon == null || iconWidth <= 0 || iconHeight <= 0) return;

	renderState.setupTexturedRender();
	renderState.setColor(0xFFFFFF, alpha);

	TextureManager render = FMLClientHandler.instance().getClient().renderEngine;
	render.bindTexture(TextureMap.locationBlocksTexture);
	float xIterations = width / iconWidth;
	float yIterations = height / iconHeight;

	for (float xIteration = 0; xIteration < xIterations; xIteration += 1) {
		for (float yIteration = 0; yIteration < yIterations; yIteration += 1) {
			// Draw whole or partial
			final float xDrawSize = Math.min(xIterations - xIteration, 1);
			final float yDrawSize = Math.min(yIterations - yIteration, 1);

			GlassesRenderingUtils.drawTexturedQuad(
					xIteration * iconWidth,
					yIteration * iconHeight,
					fluidIcon,
					xDrawSize * iconWidth,
					yDrawSize * iconHeight,
					xDrawSize,
					yDrawSize);
		}
	}
}
 
Example 21
@SideOnly(Side.CLIENT)
public String getText() {
    if (Config.tagResearch) {
        if (inter == null)
            return "[FM] " + StatCollector.translateToLocal("forbidden.research_text." + key);
        else
            return "[FM] " + inter + " " + StatCollector.translateToLocal("forbidden.research_text." + key);
    } else
        return StatCollector.translateToLocal("forbidden.research_text." + key);
}
 
Example 22
Source Project: OpenPeripheral-Addons   Source File: ItemGlasses.java    License: MIT License 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({ "unchecked", "rawtypes" })
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
	Long guid = extractGuid(itemStack);
	if (guid != null) list.add(StatCollector.translateToLocalFormatted("openperipheral.misc.key", TerminalUtils.formatTerminalId(guid)));
}
 
Example 23
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister){

    super.registerIcons(iconRegister);
    overlayTexture = iconRegister.registerIcon(getIconString() + "Overlay");
}
 
Example 24
Source Project: Et-Futurum   Source File: EntityRabbit.java    License: The Unlicense 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void handleHealthUpdate(byte id) {
	if (id == 1) {
		createRunningParticles();
		field_175535_bn = 10;
		field_175540_bm = 0;
	} else
		super.handleHealthUpdate(id);
}
 
Example 25
Source Project: archimedes-ships   Source File: BlockGauge.java    License: MIT License 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconregister)
{
	super.registerBlockIcons(iconregister);
	extendedIcon = iconregister.registerIcon(getTextureName() + "_ext");
}
 
Example 26
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1) {
    return this.icon;
}
 
Example 27
@SideOnly(Side.CLIENT)
public ItemStack getBindDisplayForFlowerType(SubTileEntity e);
 
Example 28
Source Project: AdvancedMod   Source File: PotionFluxTaint.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public int getStatusIconIndex() {
	Minecraft.getMinecraft().renderEngine.bindTexture(rl);
	return super.getStatusIconIndex();
}
 
Example 29
Source Project: Framez   Source File: IFillerPattern.java    License: GNU General Public License v3.0 4 votes vote down vote up
@SideOnly(Side.CLIENT)
IIcon getIcon();
 
Example 30
Source Project: Et-Futurum   Source File: BlockSilkedMushroom.java    License: The Unlicense 4 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister reg) {
}