本文整理匯總了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])));
}
示例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();
}