feat: option to hide potion effects
This commit is contained in:
parent
95f828c282
commit
c6dff8df7d
1 changed files with 13 additions and 0 deletions
|
@ -42,6 +42,7 @@ public class InfoDisplay extends HudModule implements ICommons {
|
||||||
// public final ForgeConfigSpec.ConfigValue<Boolean> effects_list;
|
// public final ForgeConfigSpec.ConfigValue<Boolean> effects_list;
|
||||||
// public final ForgeConfigSpec.ConfigValue<Boolean> item_quantity;
|
// public final ForgeConfigSpec.ConfigValue<Boolean> item_quantity;
|
||||||
// public final ForgeConfigSpec.ConfigValue<Boolean> client_chunk_size;
|
// public final ForgeConfigSpec.ConfigValue<Boolean> client_chunk_size;
|
||||||
|
public final ForgeConfigSpec.ConfigValue<Boolean> hide_effects;
|
||||||
|
|
||||||
public InfoDisplay(ForgeConfigSpec.Builder builder, CommandDispatcher<CommandSource> dispatcher) {
|
public InfoDisplay(ForgeConfigSpec.Builder builder, CommandDispatcher<CommandSource> dispatcher) {
|
||||||
super("InfoDisplay", builder, dispatcher);
|
super("InfoDisplay", builder, dispatcher);
|
||||||
|
@ -63,6 +64,12 @@ public class InfoDisplay extends HudModule implements ICommons {
|
||||||
BoolArgumentType.bool(), Boolean.class,
|
BoolArgumentType.bool(), Boolean.class,
|
||||||
builder, dispatcher
|
builder, dispatcher
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this.hide_effects = this.option(
|
||||||
|
"hide-effects", "hide effect icons on top right corner", false,
|
||||||
|
BoolArgumentType.bool(), Boolean.class,
|
||||||
|
builder, dispatcher
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
@ -88,6 +95,12 @@ public class InfoDisplay extends HudModule implements ICommons {
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onRenderOverlay(RenderGameOverlayEvent event) {
|
public void onRenderOverlay(RenderGameOverlayEvent event) {
|
||||||
|
if (event.getType() == ElementType.POTION_ICONS) {
|
||||||
|
if (this.hide_effects.get()) {
|
||||||
|
event.setCanceled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (event.getType() != ElementType.TEXT) return;
|
if (event.getType() != ElementType.TEXT) return;
|
||||||
|
|
||||||
Minecraft mc = MC;
|
Minecraft mc = MC;
|
||||||
|
|
Loading…
Reference in a new issue