當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。