Java Code Examples for net.minecraftforge.fml.relauncher.Side

The following are top voted examples for showing how to use net.minecraftforge.fml.relauncher.Side. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: Industrial-Foregoing   File: ContributorsCatEarsRender.java   View source code 6 votes vote down vote up
@SideOnly(Side.CLIENT)
@Override
public void doRenderLayer(AbstractClientPlayer entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
    if (!Arrays.asList(contributors.uuid).contains(entitylivingbaseIn.getUniqueID().toString())) return;
    if (!entitylivingbaseIn.isWearing(EnumPlayerModelParts.CAPE)) return;
    GlStateManager.pushMatrix();
    GlStateManager.enableBlend();
    GlStateManager.disableCull();
    RenderHelper.disableStandardItemLighting();
    if (Minecraft.isAmbientOcclusionEnabled()) {
        GlStateManager.shadeModel(GL11.GL_SMOOTH);
    } else {
        GlStateManager.shadeModel(GL11.GL_FLAT);
    }
    GlStateManager.translate(0, -0.015f, 0);
    if (!entitylivingbaseIn.inventory.armorInventory.get(3).isEmpty()) GlStateManager.translate(0, -0.02f, 0);
    if (entitylivingbaseIn.isSneaking()) GlStateManager.translate(0, 0.27, 0);
    GlStateManager.rotate(90, 0, 1, 0);
    GlStateManager.rotate(180, 1, 0, 0);
    GlStateManager.rotate(netHeadYaw, 0, -1, 0);
    GlStateManager.rotate(headPitch, 0, 0, -1);

    Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    Calendar calendar = Calendar.getInstance();
    if (calendar.get(Calendar.MONTH) == Calendar.OCTOBER) {
        spookyScarySkeletons();
    } else if (calendar.get(Calendar.MONTH) == Calendar.DECEMBER) {
        itsSnowyHere();
    } else {
        Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(ClientProxy.ears_baked, 0.5f, 255, 255, 255);
    }
    RenderHelper.enableStandardItemLighting();
    GlStateManager.depthMask(true);
    GlStateManager.popMatrix();
}
 
Example 2
Project: CustomWorldGen   File: BlockEnderChest.java   View source code 6 votes vote down vote up
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand)
{
    for (int i = 0; i < 3; ++i)
    {
        int j = rand.nextInt(2) * 2 - 1;
        int k = rand.nextInt(2) * 2 - 1;
        double d0 = (double)pos.getX() + 0.5D + 0.25D * (double)j;
        double d1 = (double)((float)pos.getY() + rand.nextFloat());
        double d2 = (double)pos.getZ() + 0.5D + 0.25D * (double)k;
        double d3 = (double)(rand.nextFloat() * (float)j);
        double d4 = ((double)rand.nextFloat() - 0.5D) * 0.125D;
        double d5 = (double)(rand.nextFloat() * (float)k);
        worldIn.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5, new int[0]);
    }
}
 
Example 3
Project: FirstAid   File: FirstAid.java   View source code 6 votes vote down vote up
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
    CapabilityExtendedHealthSystem.register();

    int i = 0;
    NETWORKING = NetworkRegistry.INSTANCE.newSimpleChannel(MODID);
    NETWORKING.registerMessage(MessageReceiveDamage.Handler.class, MessageReceiveDamage.class, ++i, Side.CLIENT);
    NETWORKING.registerMessage(MessageApplyHealingItem.Handler.class, MessageApplyHealingItem.class, ++i , Side.SERVER);
    NETWORKING.registerMessage(MessageReceiveConfiguration.Handler.class, MessageReceiveConfiguration.class, ++i, Side.CLIENT);
    NETWORKING.registerMessage(MessageApplyAbsorption.Handler.class, MessageApplyAbsorption.class, ++i, Side.CLIENT);
    NETWORKING.registerMessage(MessageAddHealth.Handler.class, MessageAddHealth.class, ++i, Side.CLIENT);
    NETWORKING.registerMessage(MessagePlayHurtSound.Handler.class, MessagePlayHurtSound.class, ++i, Side.CLIENT);
    NETWORKING.registerMessage(MessageClientUpdate.Handler.class, MessageClientUpdate.class, ++i, Side.SERVER);
    NETWORKING.registerMessage(MessageResync.Handler.class, MessageResync.class, ++i, Side.CLIENT);
    MessageReceiveConfiguration.validate();

    if (Loader.isModLoaded("morpheus")) {
        enableMorpheusCompat = true;
        logger.info("Morpheus present - enabling compatibility module");
        MorpheusHelper.register();
    }

    RegistryManager.registerDefaults();
    checkEarlyExit();
}
 
Example 4
Project: CustomWorldGen   File: EntityVillager.java   View source code 6 votes vote down vote up
@SideOnly(Side.CLIENT)
public void handleStatusUpdate(byte id)
{
    if (id == 12)
    {
        this.spawnParticles(EnumParticleTypes.HEART);
    }
    else if (id == 13)
    {
        this.spawnParticles(EnumParticleTypes.VILLAGER_ANGRY);
    }
    else if (id == 14)
    {
        this.spawnParticles(EnumParticleTypes.VILLAGER_HAPPY);
    }
    else
    {
        super.handleStatusUpdate(id);
    }
}
 
Example 5
Project: ExSartagine   File: BlockSmelter.java   View source code 6 votes vote down vote up
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand)
{
	double d0 = (double)pos.getX() + 0.5D;
	double d1 = (double)pos.getY() + 0.75D;
	double d2 = (double)pos.getZ() + 0.5D;
	double d3 = 0.22D;
	double d4 = 0.27D;

	if(worldIn.getTileEntity(pos) instanceof TileEntitySmelter)
	{
		if(((TileEntitySmelter)worldIn.getTileEntity(pos)).isCooking() && !((TileEntitySmelter)worldIn.getTileEntity(pos)).getInventory().getStackInSlot(0).isEmpty())
		{
			for(int i = 0; i < 25; i++)
			{
				worldIn.spawnParticle(EnumParticleTypes.FLAME, d0+(RANDOM.nextDouble()/5 - 0.1), d1, d2+(RANDOM.nextDouble()/5 - 0.1), 0.0D, 0.0D, 0.0D, new int[0]);
				worldIn.spawnParticle(EnumParticleTypes.FLAME, d0+(RANDOM.nextDouble()/5 - 0.1), d1, d2+(RANDOM.nextDouble()/5 - 0.1), 0.0D, 0.02D, 0.0D, new int[0]);

				worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0+(RANDOM.nextDouble()/5 - 0.1), d1, d2+(RANDOM.nextDouble()/5 - 0.1), 0.0D, 0.0D, 0.0D, new int[0]);
			}
			worldIn.spawnParticle(EnumParticleTypes.FLAME, d0+(RANDOM.nextDouble()/5 - 0.1), d1, d2+(RANDOM.nextDouble()/5 - 0.1), 0.0D, 0.05D, 0.0D, new int[0]);
		}
	}
}
 
Example 6
Project: CustomWorldGen   File: Clips.java   View source code 6 votes vote down vote up
/**
 * Retrieves the clip from the model.
 */
@SideOnly(Side.CLIENT)
public static IClip getModelClipNode(ResourceLocation modelLocation, String clipName)
{
    IModel model = ModelLoaderRegistry.getModelOrMissing(modelLocation);
    if(model instanceof IAnimatedModel)
    {
        Optional<? extends IClip> clip = ((IAnimatedModel)model).getClip(clipName);
        if(clip.isPresent())
        {
            return new ModelClip(clip.get(), modelLocation, clipName);
        }
        FMLLog.getLogger().error("Unable to find clip " + clipName + " in the model " + modelLocation);
    }
    // FIXME: missing clip?
    return new ModelClip(IdentityClip.INSTANCE, modelLocation, clipName);
}
 
Example 7
Project: Thermionics   File: WColoredSlot.java   View source code 6 votes vote down vote up
@SideOnly(Side.CLIENT)
@Override
public void paintBackground(int x, int y) {
	for (int xi = 0; xi < slotsWide; xi++) {
		for (int yi = 0; yi < slotsHigh; yi++) {
			
			int lo = multiplyColor(color, 0.7f);
			int bg = GuiDrawing.colorAtOpacity(0x000000, 0.29f);
			int hi = multiplyColor(color, 1.7f);
			
			if (big) {
				GuiDrawing.drawBeveledPanel((xi * 18) + x - 4, (yi * 18) + y - 4, 24, 24,
						lo, bg, hi);
			} else {
				GuiDrawing.drawBeveledPanel((xi * 18) + x - 1, (yi * 18) + y - 1, 18, 18,
						lo, bg, hi);
			}
		}
	}
}
 
Example 8
Project: pnc-repressurized   File: CoordTrackUpgradeHandler.java   View source code 6 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void update(EntityPlayer player, int rangeUpgrades) {
    if (coordTracker != null) {
        coordTracker.ticksExisted++;
    } else {
        coordTracker = ItemPneumaticArmor.getCoordTrackLocation(player.getItemStackFromSlot(EntityEquipmentSlot.HEAD));
        if (coordTracker != null) navigator = new RenderNavigator(coordTracker.world, coordTracker.pos);
    }
    if (noPathCooldown > 0) {
        noPathCooldown--;
    }
    if (navigator != null && pathEnabled && noPathCooldown == 0 && --pathCalculateCooldown <= 0) {
        navigator.updatePath();
        if (!navigator.tracedToDestination()) {
            noPathCooldown = 100; // wait 5 seconds before recalculating a path.
        }
        pathCalculateCooldown = pathUpdateSetting == 2 ? 1 : pathUpdateSetting == 1 ? 20 : 100;
    }
}
 
Example 9
Project: Geolosys   File: ClientRegistry.java   View source code 6 votes vote down vote up
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void handleModels(ModelRegistryEvent event)
{
    for (Map.Entry<ItemStack, ModelResourceLocation> entry : LOCATIONS.entrySet())
    {
        ModelLoader.setCustomModelResourceLocation(entry.getKey().getItem(), entry.getKey().getItemDamage(), entry.getValue());
    }
}
 
Example 10
Project: CustomWorldGen   File: EntityFireball.java   View source code 5 votes vote down vote up
/**
 * Checks if the entity is in range to render.
 */
@SideOnly(Side.CLIENT)
public boolean isInRangeToRenderDist(double distance)
{
    double d0 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D;

    if (Double.isNaN(d0))
    {
        d0 = 4.0D;
    }

    d0 = d0 * 64.0D;
    return distance < d0 * d0;
}
 
Example 11
Project: uniquecrops   File: UCDyePlantStitch.java   View source code 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void updateAnimation() {
	
	World world = Minecraft.getMinecraft().theWorld;
	if (world != null) {
		long time = world.getWorldTime() % 24000L;
		this.frameCounter = (int)(time / 1500);
	}
	TextureUtil.uploadTextureMipmap((int[][])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false);
}
 
Example 12
Project: FoodCraft-Reloaded   File: ClientProxy.java   View source code 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public void construct(FMLConstructionEvent event) {
    super.construct(event);
    getLoaderManager().invoke(event, LoaderState.CONSTRUCTING, Side.CLIENT);
}
 
Example 13
Project: BetterThanWeagles   File: ModFluids.java   View source code 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public static void initModels()
{
	Item item = Item.getItemFromBlock(ModBlocks.liquid_butter);

	ModelBakery.registerItemVariants(item);
	ModelResourceLocation location = new ModelResourceLocation("btweagles:fluid", "liquid_butter");
	ModelLoader.setCustomMeshDefinition(item, stack -> location);
	ModelLoader.setCustomStateMapper(ModBlocks.liquid_butter, new StateMapperBase() {
		@Override
		protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
			return location;
		}
	});
}
 
Example 14
Project: pnc-repressurized   File: ItemNetworkComponents.java   View source code 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> subItems) {
    if (isInCreativeTab(tab)) {
        for (int i = 0; i < COMPONENT_AMOUNT; i++) {
            subItems.add(new ItemStack(this, 1, i));
        }
    }
}
 
Example 15
Project: pnc-repressurized   File: TileEntitySecurityStation.java   View source code 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox() {
    if (rangeLineRenderer == null || !rangeLineRenderer.isCurrentlyRendering()) return super.getRenderBoundingBox();
    int range = getSecurityRange();
    return new AxisAlignedBB(getPos().getX() - range, getPos().getY() - range, getPos().getZ() - range, getPos().getX() + 1 + range, getPos().getY() + 1 + range, getPos().getZ() + 1 + range);
}
 
Example 16
Project: MineCamera   File: ItemPictureBook.java   View source code 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
	int num=0;
	if(stack.hasTagCompound())
	{
		if(stack.getTagCompound().hasKey("num")){
			num=stack.getTagCompound().getInteger("num");
		}else if(stack.getTagCompound().hasKey("listPid")&&!stack.getTagCompound().getString("listPid").equals("")){
			num=stack.getTagCompound().getString("listPid").split("%,%").length;
			stack.getTagCompound().setInteger("num", num);
		}
	}
	tooltip.add(TextFormatting.GREEN + I18n.format("lore.picturebook.info") + TextFormatting.GRAY + ""+num);
}
 
Example 17
Project: ExSartagine   File: BlockRange.java   View source code 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand)
{
	double d0 = (double)pos.getX() + 0.5D;
	double d1 = (double)pos.getY() + 1.5D;
	double d2 = (double)pos.getZ() + 0.5D;

	if(worldIn.getTileEntity(pos) instanceof TileEntityRange)
	{
		if(((TileEntityRange)worldIn.getTileEntity(pos)).isFueled())
		{
			EnumFacing enumfacing = (EnumFacing)stateIn.getValue(FACING);
			switch (enumfacing) {
			case NORTH:
				worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0+0.3, d1, d2+0.3, 0.0D, 0.0D, 0.0D, new int[0]);
				break;
			case WEST:
				worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0+0.3, d1, d2-0.3, 0.0D, 0.0D, 0.0D, new int[0]);
				break;
			case SOUTH:
				worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0-0.3, d1, d2-0.3, 0.0D, 0.0D, 0.0D, new int[0]);
				break;
			case EAST:
				worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0-0.3, d1, d2+0.3, 0.0D, 0.0D, 0.0D, new int[0]);
				break;
			default:
				break;
			}
		}
	}
}
 
Example 18
Project: CustomWorldGen   File: BlockEndGateway.java   View source code 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = blockAccess.getBlockState(pos.offset(side));
    Block block = iblockstate.getBlock();
    return !iblockstate.isOpaqueCube() && block != Blocks.END_GATEWAY;
}
 
Example 19
Project: ToughExpansion   File: ItemThirstQuencher.java   View source code 5 votes vote down vote up
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
	tooltip.add(ChatFormatting.ITALIC + "" + ReadableNumberConverter.INSTANCE.toWideReadableForm(getEnergyStored(stack)) + "/" + ReadableNumberConverter.INSTANCE.toWideReadableForm(getMaxEnergyStored(stack)) + " RF");
	tooltip.add("Stored Water: " + getFluidStored(stack) / 1000 + "/" + FLUID_CAPACITY / 1000 + " Buckets");
	tooltip.add("");
	tooltip.add(I18n.format("tooltip.tanaddons.thirstquencher.desc"));
	tooltip.add(I18n.format("tooltip.tanaddons.thirstquencher.desc2"));
	tooltip.add(I18n.format("tooltip.tanaddons.thirstquencher.desc3"));
	if (Loader.isModLoaded(ModGlobals.MODID_BAUBLES)) {
		tooltip.add(I18n.format("tooltip.tanaddons.baublesitem", "any"));
	}
}
 
Example 20
Project: FoodCraft-Reloaded   File: BlockLoader.java   View source code 5 votes vote down vote up
@Load(side = Side.CLIENT)
public void registerRenders() {
    for (Field field : FCRBlocks.class.getFields()) {
        field.setAccessible(true);
        RegBlock anno = field.getAnnotation(RegBlock.class);
        if (anno==null) continue;

        try {
            Block block = (Block) field.get(null);
            registerRender(block,0);
        } catch (Exception e) {
            FoodCraftReloaded.getLogger().warn("Un-able to register block " + field.toGenericString(), e);
        }
    }
}
 
Example 21
Project: Machines-and-Stuff   File: MItems.java   View source code 5 votes vote down vote up
public static void registerItemColour(Item item, String name, String key, int[] layers) {
    if(DEVENV && FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
        writeFile(key, key);
    item.setUnlocalizedName(key).setCreativeTab(TAB);
    renderMap.put(key, item);
    colourMap.put(item, layers);
    GameRegistry.register(item, new ResourceLocation(Reference.MODID + ":" + key));
}
 
Example 22
Project: uniquecrops   File: UCEntities.java   View source code 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public static void initModels() {
	
	Minecraft mc = Minecraft.getMinecraft();
	RenderManager rm = mc.getRenderManager();
	RenderItem ri = mc.getRenderItem();
	
	RenderingRegistry.registerEntityRenderingHandler(EntityCustomPotion.class, new RenderThrowable(rm, UCItems.generic, 13, ri));
	RenderingRegistry.registerEntityRenderingHandler(EntityItemWeepingEye.class, new RenderThrowable(rm, UCItems.generic, 16, ri));
	RenderingRegistry.registerEntityRenderingHandler(EntityEulaBook.class, new RenderThrowable(rm, UCItems.generic, 24, ri));
}
 
Example 23
Project: CustomWorldGen   File: BlockMycelium.java   View source code 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand)
{
    super.randomDisplayTick(stateIn, worldIn, pos, rand);

    if (rand.nextInt(10) == 0)
    {
        worldIn.spawnParticle(EnumParticleTypes.TOWN_AURA, (double)((float)pos.getX() + rand.nextFloat()), (double)((float)pos.getY() + 1.1F), (double)((float)pos.getZ() + rand.nextFloat()), 0.0D, 0.0D, 0.0D, new int[0]);
    }
}
 
Example 24
Project: CustomWorldGen   File: BlockDaylightDetector.java   View source code 5 votes vote down vote up
/**
 * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
 */
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list)
{
    if (!this.inverted)
    {
        super.getSubBlocks(itemIn, tab, list);
    }
}
 
Example 25
Project: ModularMachinery   File: BlockEnergyOutputHatch.java   View source code 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, ITooltipFlag advanced) {
    EnergyHatchSize size = EnergyHatchSize.values()[MathHelper.clamp(stack.getMetadata(), 0, EnergyHatchSize.values().length - 1)];
    tooltip.add(TextFormatting.GRAY + I18n.format("tooltip.energyhatch.storage", size.maxEnergy));
    tooltip.add(TextFormatting.GRAY + I18n.format("tooltip.energyhatch.out.transfer", size.transferLimit));
    if(Loader.isModLoaded("ic2")) {
        tooltip.add("");
        tooltip.add(TextFormatting.GRAY + I18n.format("tooltip.energyhatch.ic2.out.voltage",
                TextFormatting.BLUE + I18n.format(size.getUnlocalizedEnergyDescriptor())));
        tooltip.add(TextFormatting.GRAY + I18n.format("tooltip.energyhatch.ic2.out.transfer",
                TextFormatting.BLUE + String.valueOf(size.getEnergyTransmission()),
                TextFormatting.BLUE + I18n.format("tooltip.energyhatch.ic2.powerrate")));
    }
}
 
Example 26
Project: Clef   File: AbcLibrary.java   View source code 5 votes vote down vote up
public static void handleReceivedFile(String fileName, byte[] fileData, Side side)
{
    File dir = new File(Clef.getResourceHelper().abcDir, "received");
    File file = new File(dir, fileName);
    try
    {
        dir.mkdirs();
        if(file.exists())
        {
            file.delete();
        }

        FileOutputStream fos = new FileOutputStream(file);
        fos.write(fileData);
        fos.close();

        Clef.LOGGER.info("Received " + fileName + ". Reading.");
        readAbc(file, tracks);

        if(side.isServer())
        {
            requestedABCFromPlayers.remove(fileName.substring(0, fileName.length() - 4));
        }
        else
        {
            requestedABCFromServer.remove(fileName.substring(0, fileName.length() - 4));
        }
    }
    catch(Exception e)
    {
        e.printStackTrace();
    }
}
 
Example 27
Project: Soot   File: PotionBase.java   View source code 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public int getStatusIconIndex() {
    Minecraft.getMinecraft().renderEngine.bindTexture(icon);

    return super.getStatusIconIndex();
}
 
Example 28
Project: Bewitchment   File: PacketHandler.java   View source code 5 votes vote down vote up
public static void init() {
	int id = 0;
	HANDLER.registerMessage(ParticleMessage.ParticleMessageHandler.class, ParticleMessage.class, id++, Side.CLIENT);
	HANDLER.registerMessage(EnergyMessage.EnergyMessageHandler.class, EnergyMessage.class, id++, Side.CLIENT);
	HANDLER.registerMessage(BrewMessage.PotionMessageHandler.class, BrewMessage.class, id++, Side.CLIENT);
	HANDLER.registerMessage(TarotMessage.TarotMessageHandler.class, TarotMessage.class, id++, Side.CLIENT);
}
 
Example 29
Project: uniquecrops   File: UCInvisibiliaStitch.java   View source code 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void updateAnimation() {
	
	EntityPlayerSP p = Minecraft.getMinecraft().thePlayer;
	if (p != null)
	{
		if ((p.inventory.armorInventory[3] != null && p.inventory.armorInventory[3].getItem() == UCItems.glasses3D) || p.capabilities.isCreativeMode)
			this.frameCounter = 0;
		else
			this.frameCounter = 1;
	}
	TextureUtil.uploadTextureMipmap((int[][])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false);
}
 
Example 30
Project: PurificatiMagicae   File: IfRegistry.java   View source code 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public void setupJei()
{
    for(IfEntry entr : entries)
    {
        for(IIfPage p : entr.getPages())
        {
            if(p instanceof IfPageCrafting)
            {
                for(Supplied<CraftingControl> sup : ((IfPageCrafting) p).getCrafts())
                    sup.supply();
            }
        }
    }
}
 
Example 31
Project: Mods   File: BlockAmmoFurnace.java   View source code 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings("incomplete-switch")
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) {
	if (stateIn.getValue(BURNING)) {
		EnumFacing enumfacing = stateIn.getValue(FACING);
		double d0 = pos.getX() + 0.5D;
		double d1 = pos.getY() + rand.nextDouble() * 6.0D / 16.0D;
		double d2 = pos.getZ() + 0.5D;
		double d3 = 0.52D;
		double d4 = rand.nextDouble() * 0.6D - 0.3D;

		if (rand.nextDouble() < 0.1D)
			worldIn.playSound(pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D,
					SoundEvents.BLOCK_FURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 1.0F, 1.0F, false);

		switch (enumfacing) {
		case WEST:
			worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D,
					new int[0]);
			worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 - 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
			break;
		case EAST:
			worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D,
					new int[0]);
			worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
			break;
		case NORTH:
			worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - 0.52D, 0.0D, 0.0D, 0.0D,
					new int[0]);
			worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - 0.52D, 0.0D, 0.0D, 0.0D, new int[0]);
			break;
		case SOUTH:
			worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + 0.52D, 0.0D, 0.0D, 0.0D,
					new int[0]);
			worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + 0.52D, 0.0D, 0.0D, 0.0D, new int[0]);
		}
	}
}
 
Example 32
Project: ExPetrum   File: BlockBoulderOre.java   View source code 5 votes vote down vote up
@SideOnly(Side.CLIENT)
@Override
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list)
{
	for (int i = 0; i < EnumRockClass.values().length * EnumOre.values().length; ++i)
	{
		list.add(new ItemStack(this, 1, i));
	}
}
 
Example 33
Project: ObsidianSuite   File: WavefrontObject.java   View source code 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public void renderAll()
{
    Tessellator tessellator = Tessellator.getInstance();
    tessellateAll(tessellator);
    tessellator.draw();
}
 
Example 34
Project: CustomWorldGen   File: SPacketAnimation.java   View source code 4 votes vote down vote up
@SideOnly(Side.CLIENT)
public int getAnimationType()
{
    return this.type;
}
 
Example 35
Project: CustomWorldGen   File: CPacketKeepAlive.java   View source code 4 votes vote down vote up
@SideOnly(Side.CLIENT)
public CPacketKeepAlive(int idIn)
{
    this.key = idIn;
}
 
Example 36
Project: CustomWorldGen   File: ItemBlock.java   View source code 4 votes vote down vote up
/**
 * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
 */
@SideOnly(Side.CLIENT)
public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems)
{
    this.block.getSubBlocks(itemIn, tab, subItems);
}
 
Example 37
Project: CustomWorldGen   File: ChunkCache.java   View source code 4 votes vote down vote up
@SideOnly(Side.CLIENT)
private int getLightForExt(EnumSkyBlock type, BlockPos pos)
{
    if (type == EnumSkyBlock.SKY && this.worldObj.provider.getHasNoSky())
    {
        return 0;
    }
    else if (pos.getY() >= 0 && pos.getY() < 256)
    {
        if (this.getBlockState(pos).useNeighborBrightness())
        {
            int l = 0;

            for (EnumFacing enumfacing : EnumFacing.values())
            {
                int k = this.getLightFor(type, pos.offset(enumfacing));

                if (k > l)
                {
                    l = k;
                }

                if (l >= 15)
                {
                    return l;
                }
            }

            return l;
        }
        else
        {
            int i = (pos.getX() >> 4) - this.chunkX;
            int j = (pos.getZ() >> 4) - this.chunkZ;
            if (i < 0 || i >= chunkArray.length || j < 0 || j >= chunkArray[i].length) return type.defaultLightValue;
            if (chunkArray[i][j] == null) return type.defaultLightValue;
            return this.chunkArray[i][j].getLightFor(type, pos);
        }
    }
    else
    {
        return type.defaultLightValue;
    }
}
 
Example 38
Project: CustomWorldGen   File: EntityHorse.java   View source code 4 votes vote down vote up
@SideOnly(Side.CLIENT)
private void setHorseTexturePaths()
{
    this.texturePrefix = "horse/";
    this.horseTexturesArray[0] = null;
    this.horseTexturesArray[1] = null;
    this.horseTexturesArray[2] = null;
    HorseType horsetype = this.getType();
    int i = this.getHorseVariant();

    if (horsetype == HorseType.HORSE)
    {
        int j = i & 255;
        int k = (i & 65280) >> 8;

        if (j >= HORSE_TEXTURES.length)
        {
            this.hasTexture = false;
            return;
        }

        this.horseTexturesArray[0] = HORSE_TEXTURES[j];
        this.texturePrefix = this.texturePrefix + HORSE_TEXTURES_ABBR[j];

        if (k >= HORSE_MARKING_TEXTURES.length)
        {
            this.hasTexture = false;
            return;
        }

        this.horseTexturesArray[1] = HORSE_MARKING_TEXTURES[k];
        this.texturePrefix = this.texturePrefix + HORSE_MARKING_TEXTURES_ABBR[k];
    }
    else
    {
        this.horseTexturesArray[0] = "";
        this.texturePrefix = this.texturePrefix + "_" + horsetype + "_";
    }

    HorseArmorType horsearmortype = this.getHorseArmorType();
    this.horseTexturesArray[2] = horsearmortype.getTextureName();
    this.texturePrefix = this.texturePrefix + horsearmortype.getHash();
    this.hasTexture = true;
}
 
Example 39
Project: CustomWorldGen   File: AnvilSaveConverter.java   View source code 4 votes vote down vote up
@SideOnly(Side.CLIENT)
public boolean isConvertible(String saveName)
{
    WorldInfo worldinfo = this.getWorldInfo(saveName);
    return worldinfo != null && worldinfo.getSaveVersion() == 19132;
}
 
Example 40
Project: CustomWorldGen   File: IBlockAccess.java   View source code 4 votes vote down vote up
@SideOnly(Side.CLIENT)
Biome getBiome(BlockPos pos);