当前位置: 首页>>代码示例>>Java>>正文


Java SideOnly类代码示例

本文整理汇总了Java中net.minecraftforge.fml.relauncher.SideOnly的典型用法代码示例。如果您正苦于以下问题:Java SideOnly类的具体用法?Java SideOnly怎么用?Java SideOnly使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SideOnly类属于net.minecraftforge.fml.relauncher包,在下文中一共展示了SideOnly类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addInformation

import net.minecraftforge.fml.relauncher.SideOnly; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack is, @Nullable World worldIn, List<String> list, ITooltipFlag flag)
{
    NBTTagCompound tag = is.getTagCompound();
    if(tag != null)
    {
        Instrument instrument = InstrumentLibrary.getInstrumentByName(tag.getString("itemName"));
        if(instrument != null)
        {
            list.add(I18n.translateToLocal("item.clef.instrument." + instrument.info.itemName + ".desc"));
            list.add(I18n.translateToLocal(instrument.info.twoHanded && Clef.config.allowOneHandedTwoHandedInstrumentUse == 0 ? "clef.item.twoHanded" : "clef.item.oneHanded"));
            if(GuiScreen.isShiftKeyDown())
            {
                list.add("");
                list.add(I18n.translateToLocal("clef.item.packName") + ": " + instrument.packInfo.packName);
                list.add(I18n.translateToLocal("clef.item.itemName") + ": " + instrument.info.itemName);
            }
        }
    }
}
 
开发者ID:iChun,项目名称:Clef,代码行数:22,代码来源:ItemInstrument.java

示例2: pressUnicode

import net.minecraftforge.fml.relauncher.SideOnly; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public static void pressUnicode(Robot r, int key_code) {
    r.keyPress(KeyEvent.VK_ALT);
    for(int i = 3; i >= 0; --i) {
        int numpad_kc = key_code / (int) (Math.pow(10, i)) % 10 + KeyEvent.VK_NUMPAD0;
        r.keyPress(numpad_kc);
        r.keyRelease(numpad_kc);
    }
    r.keyRelease(KeyEvent.VK_ALT);
}
 
开发者ID:lukas2005,项目名称:Device-Mod-Apps,代码行数:11,代码来源:Utils.java

示例3: randomDisplayTick

import net.minecraftforge.fml.relauncher.SideOnly; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand)
{
    if (rand.nextInt(16) == 0)
    {
        BlockPos blockpos = pos.down();

        if (canFallThrough(worldIn.getBlockState(blockpos)))
        {
            double d0 = (double)((float)pos.getX() + rand.nextFloat());
            double d1 = (double)pos.getY() - 0.05D;
            double d2 = (double)((float)pos.getZ() + rand.nextFloat());
            worldIn.spawnParticle(EnumParticleTypes.FALLING_DUST, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[] {Block.getStateId(stateIn)});
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:17,代码来源:BlockFalling.java

示例4: setVelocity

import net.minecraftforge.fml.relauncher.SideOnly; //导入依赖的package包/类
/**
 * Updates the velocity of the entity to a new value.
 */
@SideOnly(Side.CLIENT)
public void setVelocity(double x, double y, double z)
{
    this.motionX = x;
    this.motionY = y;
    this.motionZ = z;

    if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
    {
        float f = MathHelper.sqrt_double(x * x + z * z);
        this.rotationPitch = (float)(MathHelper.atan2(y, (double)f) * (180D / Math.PI));
        this.rotationYaw = (float)(MathHelper.atan2(x, z) * (180D / Math.PI));
        this.prevRotationPitch = this.rotationPitch;
        this.prevRotationYaw = this.rotationYaw;
        this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
        this.ticksInGround = 0;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:22,代码来源:EntityArrow.java

示例5: shouldRenderSides

import net.minecraftforge.fml.relauncher.SideOnly; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public boolean shouldRenderSides(IBlockAccess blockAccess, BlockPos pos)
{
    for (int i = -1; i <= 1; ++i)
    {
        for (int j = -1; j <= 1; ++j)
        {
            IBlockState iblockstate = blockAccess.getBlockState(pos.add(i, 0, j));

            if (iblockstate.getMaterial() != this.blockMaterial && !iblockstate.isFullBlock())
            {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:19,代码来源:BlockLiquid.java

示例6: InjectDedicated

import net.minecraftforge.fml.relauncher.SideOnly; //导入依赖的package包/类
@SideOnly(Side.SERVER)
public static void InjectDedicated(MinecraftServer server)
{
	PlayerList playerList = server.getPlayerList();

	try {
		if (playerList instanceof DedicatedPlayerList)
		{
			server.setPlayerList(new HookedDedicatedPlayerList((DedicatedPlayerList)playerList));
		}
		else
		{
			// uh ho...
			Util.logger.error("Unable to inject custom PlayerList into server due to unknown type! PlayerList was of type {}.", playerList.getClass().toString());
		}
	} catch (IllegalAccessException | NoSuchFieldException | SecurityException e) {
		Util.logger.logException("Exception trying to inject custom PlayerList into server!", e);
	}
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:20,代码来源:ServerInjector.java

示例7: updateProgressBar

import net.minecraftforge.fml.relauncher.SideOnly; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void updateProgressBar(int barId, int newValue)
{
	if (barId == 0)
	{
		tileEntity.cookTime = newValue;
	}
	if (barId == 1)
	{
		tileEntity.burnTime = newValue;
	}
	if (barId == 2)
	{
		tileEntity.currentItemBurnTime = newValue;
	}
	if (barId == 3)
	{
		tileEntity.decayTime = newValue;
	}
}
 
开发者ID:einsteinsci,项目名称:BetterBeginningsReborn,代码行数:21,代码来源:ContainerCampfire.java

示例8: render

import net.minecraftforge.fml.relauncher.SideOnly; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void render(float width) {
	//Render ties using current texture but with dynamic width.
	//This will cause stretching of the texture, but it ensures uniformity for all sizes.
	GL11.glBegin(GL11.GL_QUADS);
	renderTieBottom(width);
	renderTieTop(width);
	renderTieFront(width);
	renderTieRear(width);
	renderTieLeft(width);
	renderTieRight(width);
	GL11.glEnd();
}
 
开发者ID:DonBruce64,项目名称:OpenFlexiTrack,代码行数:15,代码来源:DefaultSleeperType.java

示例9: getSubBlocks

import net.minecraftforge.fml.relauncher.SideOnly; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
	if (tab!=this.getCreativeTabToDisplayOn()) return;
	
    for (int i=0; i<16; i++) {
        list.add(new ItemStack(ItemBlock.getItemFromBlock(this), 1, i));
    }
}
 
开发者ID:elytra,项目名称:ThermionicsWorld,代码行数:10,代码来源:BlockVarieties.java

示例10: init

import net.minecraftforge.fml.relauncher.SideOnly; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@EventHandler
public void init(FMLInitializationEvent event) {
	overlayRenderer = new LithiumOverlay();
	MinecraftForge.EVENT_BUS.register(NetworkEventHandler.INSTANCE);
	MinecraftForge.EVENT_BUS.register(overlayRenderer);
	network = NetworkRegistry.INSTANCE.newSimpleChannel(LithiumMod.CHANNELNAME);
	Handle.setPacketHandler(new PacketHandlerImpl());
	getSimpleNetworkWrapper().registerMessage(Handle.class, LithiumMessage.class, 0, Side.CLIENT);

}
 
开发者ID:NickAcPT,项目名称:Lithium-Forge,代码行数:12,代码来源:LithiumMod.java

示例11: getSubBlocks

import net.minecraftforge.fml.relauncher.SideOnly; //导入依赖的package包/类
/**
 * 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 (itemIn != Item.getItemFromBlock(Blocks.DOUBLE_STONE_SLAB))
    {
        for (BlockStoneSlab.EnumType blockstoneslab$enumtype : BlockStoneSlab.EnumType.values())
        {
            if (blockstoneslab$enumtype != BlockStoneSlab.EnumType.WOOD)
            {
                list.add(new ItemStack(itemIn, 1, blockstoneslab$enumtype.getMetadata()));
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:BlockStoneSlab.java

示例12: addClientHandlers

import net.minecraftforge.fml.relauncher.SideOnly; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
private static void addClientHandlers()
{
    FMLEmbeddedChannel clientChannel = channelPair.get(Side.CLIENT);
    String handlerName = clientChannel.findChannelHandlerNameForType(ForgeRuntimeCodec.class);
    clientChannel.pipeline().addAfter(handlerName, "DimensionHandler", new DimensionMessageHandler());
    clientChannel.pipeline().addAfter(handlerName, "FluidIdRegistryHandler", new FluidIdRegistryMessageHandler());
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:9,代码来源:ForgeNetworkHandler.java

示例13: onModelLoad

import net.minecraftforge.fml.relauncher.SideOnly; //导入依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onModelLoad(ModelRegistryEvent ev) {
    RandoresBlocks.registerModels();
    RandoresItems.registerModels();
    CraftingBlocks.registerModels();
    CraftingItems.registerModels();
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:9,代码来源:RandoresClientListener.java

示例14: getLightFor

import net.minecraftforge.fml.relauncher.SideOnly; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public int getLightFor(EnumSkyBlock p_175628_1_, BlockPos pos)
{
    if (pos.getY() >= 0 && pos.getY() < 256)
    {
        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 p_175628_1_.defaultLightValue;
        return this.chunkArray[i][j].getLightFor(p_175628_1_, pos);
    }
    else
    {
        return p_175628_1_.defaultLightValue;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:16,代码来源:ChunkCache.java

示例15: getTabIconItem

import net.minecraftforge.fml.relauncher.SideOnly; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public ItemStack getTabIconItem() {
	ItemStack stack = new ItemStack(ModItems.pickaxe);
	NBTTagCompound tag = new NBTTagCompound();
	tag.setString(IHeadTool.HEAD_TAG, "iron");
	tag.setString(IHaftTool.HAFT_TAG, "wood");
	tag.setString(IHandleTool.HANDLE_TAG, "leather");
	tag.setString(IAdornedTool.ADORNMENT_TAG, "diamond");
	stack.setTagCompound(tag);
	return stack;
}
 
开发者ID:the-realest-stu,项目名称:Adventurers-Toolbox,代码行数:13,代码来源:Toolbox.java


注:本文中的net.minecraftforge.fml.relauncher.SideOnly类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。