use of net.minecraft.client.GameSettings in project ModernUI by BloCamLimb.
the class SettingGeneral method addAccessibilityCategory.
private void addAccessibilityCategory(List<SettingCategoryGroup> groups) {
List<SettingEntry> list = new ArrayList<>();
GameSettings gameSettings = minecraft.gameSettings;
list.add(SettingsManager.NARRATOR.apply(window));
list.add(SettingsManager.SHOW_SUBTITLES.apply(window));
List<String> textBackgrounds = Lists.newArrayList(I18n.format("options.accessibility.text_background.chat"), I18n.format("options.accessibility.text_background.everywhere"));
list.add(new DropdownSettingEntry(window, I18n.format("options.accessibility.text_background"), textBackgrounds, gameSettings.accessibilityTextBackground ? 0 : 1, i -> gameSettings.accessibilityTextBackground = i == 0));
list.add(SettingsManager.TEXT_BACKGROUND_OPACITY.apply(window));
list.add(SettingsManager.AUTO_JUMP.apply(window));
List<String> toggle = Lists.newArrayList(I18n.format("options.key.toggle"), I18n.format("options.key.hold"));
DropdownSettingEntry sneak = new DropdownSettingEntry(window, I18n.format("key.sneak"), toggle, gameSettings.toggleCrouch ? 0 : 1, i -> gameSettings.toggleCrouch = i == 0);
list.add(sneak);
DropdownSettingEntry sprint = new DropdownSettingEntry(window, I18n.format("key.sprint"), toggle, gameSettings.toggleSprint ? 0 : 1, i -> gameSettings.toggleSprint = i == 0);
list.add(sprint);
SettingCategoryGroup categoryGroup = new SettingCategoryGroup(window, I18n.format("gui.modernui.settings.category.accessibility"), list);
groups.add(categoryGroup);
}
use of net.minecraft.client.GameSettings in project BetterDiving by Meldexun.
the class EntitySeamoth method updateControls.
@OnlyIn(Dist.CLIENT)
public void updateControls() {
Minecraft mc = Minecraft.getInstance();
this.prevControlled = this.controlled;
this.controlled = this.getControllingPassenger() == mc.player;
this.prevSteered = this.isPlayerSteering();
if (this.controlled) {
GameSettings settings = mc.options;
this.inputForward = settings.keyUp.isDown();
this.inputRight = settings.keyRight.isDown();
this.inputBack = settings.keyDown.isDown();
this.inputLeft = settings.keyLeft.isDown();
this.inputUp = settings.keyJump.isDown();
this.inputDown = ClientBetterDiving.KEY_BIND_DESCEND.isDown();
BetterDiving.NETWORK.sendToServer(new CPacketSyncSeamothInput(this));
} else if (this.prevControlled) {
this.inputForward = false;
this.inputRight = false;
this.inputBack = false;
this.inputLeft = false;
this.inputUp = false;
this.inputDown = false;
BetterDiving.NETWORK.sendToServer(new CPacketSyncSeamothInput(this));
}
}
use of net.minecraft.client.GameSettings in project ModernUI by BloCamLimb.
the class KeyBindingEntry method bindKey.
private void bindKey(@Nonnull InputMappings.Input inputIn) {
GameSettings gameSettings = Minecraft.getInstance().gameSettings;
if (inputIn.getType() != InputMappings.Type.MOUSE) {
keyBinding.setKeyModifierAndCode(KeyModifier.getActiveModifier(), inputIn);
}
gameSettings.setKeyBindingCode(keyBinding, inputIn);
updateKeyText();
conflictsCallback.run();
}
Aggregations