use of com.almuradev.almura.core.client.config.ClientConfiguration in project Almura by AlmuraDev.
the class MixinTileEntityChestRenderer method onRender.
@Inject(method = "render", at = @At("HEAD"), cancellable = true)
private void onRender(TileEntityChest te, double x, double y, double z, float partialTicks, int destroyStage, float val, CallbackInfo ci) {
// 0 means perform Minecraft logic only, we do not interfere
final ClientConfiguration configuration = ClientStaticAccess.configAdapter.get();
if (configuration.general.chestRenderDistance == 0) {
return;
}
EntityLivingBase viewer = (EntityLivingBase) Minecraft.getMinecraft().getRenderViewEntity();
if (viewer == null) {
viewer = Minecraft.getMinecraft().player;
}
if (viewer != null && te.getDistanceSq(viewer.posX, viewer.posY, viewer.posZ) > (configuration.general.chestRenderDistance * 16) && te.hasWorld()) {
ci.cancel();
}
}
use of com.almuradev.almura.core.client.config.ClientConfiguration in project Almura by AlmuraDev.
the class SimpleOptionsMenu method onButtonClick.
@Subscribe
public void onButtonClick(UIButton.ClickEvent event) {
switch(event.getComponent().getName()) {
case "button.optimized":
AlmuraSettings.optimizeGame();
this.close();
break;
case "button.hudType":
final ClientConfiguration configuration = configAdapter.get();
// Check if the current HUD is the Origin HUD
boolean isOrigin = configuration.general.hud.equalsIgnoreCase(HUDType.ORIGIN);
configuration.general.hud = isOrigin ? HUDType.VANILLA : HUDType.ORIGIN;
// Flip the boolean since we're now on the vanilla HUD
isOrigin = !isOrigin;
this.buttonHudType.setText("HUD: " + (isOrigin ? "Origin" : "Vanilla"));
this.sliderOriginHudOpacity.setAlpha(isOrigin ? 255 : 128);
this.sliderOriginHudOpacity.setEnabled(isOrigin);
if (isOrigin) {
this.sliderOriginHudOpacity.setTooltip((UITooltip) null);
} else {
this.sliderOriginHudOpacity.setTooltip("Only available when Origin HUD is in use.");
}
break;
case "button.done":
this.close();
break;
}
saveAndLoad();
}
use of com.almuradev.almura.core.client.config.ClientConfiguration in project Almura by AlmuraDev.
the class SimpleOptionsMenu method onValueChange.
@Subscribe
public void onValueChange(ComponentEvent.ValueChange event) {
final ClientConfiguration configuration = configAdapter.get();
switch(event.getComponent().getName()) {
case "slider.originHudOpacity":
configuration.general.originHudOpacity = (int) event.getNewValue();
break;
case "slider.chestRenderDistance":
configuration.general.chestRenderDistance = ((OptionsConverter.Options) event.getNewValue()).value;
break;
case "slider.signTextRenderDistance":
configuration.general.signTextRenderDistance = ((OptionsConverter.Options) event.getNewValue()).value;
break;
case "slider.itemFrameRenderDistance":
configuration.general.itemFrameRenderDistance = ((OptionsConverter.Options) event.getNewValue()).value;
break;
case "slider.playerNameRenderDistance":
configuration.general.playerNameRenderDistance = ((OptionsConverter.Options) event.getNewValue()).value;
break;
case "slider.enemyNameRenderDistance":
configuration.general.enemyNameRenderDistance = ((OptionsConverter.Options) event.getNewValue()).value;
break;
case "slider.animalNameRenderDistance":
configuration.general.animalNameRenderDistance = ((OptionsConverter.Options) event.getNewValue()).value;
break;
case "checkbox.world_compass_widget":
configuration.general.displayWorldCompassWidget = (boolean) event.getNewValue();
break;
case "checkbox.location_widget":
configuration.general.displayLocationWidget = (boolean) event.getNewValue();
break;
case "checkbox.numeric_hud_values":
configuration.general.displayNumericHUDValues = (boolean) event.getNewValue();
break;
case "checkbox.display_names":
configuration.general.displayNames = (boolean) event.getNewValue();
break;
case "checkbox.display_healthbars":
configuration.general.displayHealthbars = (boolean) event.getNewValue();
break;
case "checkbox.disable_offhand_torch_placement":
configuration.general.disableOffhandTorchPlacement = (boolean) event.getNewValue();
break;
case "checkbox.display_guide_on_login":
configuration.general.displayGuideOnLogin = (boolean) event.getNewValue();
break;
}
saveAndLoad();
}
use of com.almuradev.almura.core.client.config.ClientConfiguration in project Almura by AlmuraDev.
the class AlmuraSettings method setFirstLaunched.
protected static void setFirstLaunched(boolean value) {
final ClientConfiguration configuration = configAdapter.get();
configuration.general.firstLaunch = value;
saveAlmuraConfigs();
}
Aggregations