當前位置: 首頁>>代碼示例>>Java>>正文


Java SoundCategory.values方法代碼示例

本文整理匯總了Java中net.minecraft.util.SoundCategory.values方法的典型用法代碼示例。如果您正苦於以下問題:Java SoundCategory.values方法的具體用法?Java SoundCategory.values怎麽用?Java SoundCategory.values使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.util.SoundCategory的用法示例。


在下文中一共展示了SoundCategory.values方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initGui

import net.minecraft.util.SoundCategory; //導入方法依賴的package包/類
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.title = I18n.format("options.sounds.title", new Object[0]);
    this.offDisplayString = I18n.format("options.off", new Object[0]);
    int i = 0;
    this.buttonList.add(new GuiScreenOptionsSounds.Button(SoundCategory.MASTER.ordinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), SoundCategory.MASTER, true));
    i = i + 2;

    for (SoundCategory soundcategory : SoundCategory.values())
    {
        if (soundcategory != SoundCategory.MASTER)
        {
            this.buttonList.add(new GuiScreenOptionsSounds.Button(soundcategory.ordinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), soundcategory, false));
            ++i;
        }
    }

    int j = this.width / 2 - 75;
    int k = this.height / 6 - 12;
    ++i;
    this.buttonList.add(new GuiOptionButton(201, j, k + 24 * (i >> 1), GameSettings.Options.SHOW_SUBTITLES, this.game_settings_4.getKeyBinding(GameSettings.Options.SHOW_SUBTITLES)));
    this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.format("gui.done", new Object[0])));
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:28,代碼來源:GuiScreenOptionsSounds.java

示例2: fromBytes

import net.minecraft.util.SoundCategory; //導入方法依賴的package包/類
@Override
public void fromBytes(ByteBuf buffer) {
    super.fromBytes(buffer);
    soundEvent = new SoundEvent(new ResourceLocation(ByteBufUtils.readUTF8String(buffer)));
    category = SoundCategory.values()[buffer.readInt()];
    volume = buffer.readFloat();
    pitch = buffer.readFloat();
    bool = buffer.readBoolean();
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:10,代碼來源:PacketPlaySound.java


注:本文中的net.minecraft.util.SoundCategory.values方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。