All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.parzivail.util.client.screen.EventCheckboxWidget Maven / Gradle / Ivy

There is a newer version: 0.0.114+1.20.2
Show newest version
package com.parzivail.util.client.screen;

import java.util.function.Consumer;
import net.minecraft.class_2561;
import net.minecraft.class_4286;

public class EventCheckboxWidget extends class_4286
{
	private final Consumer checkChanged;

	public EventCheckboxWidget(int x, int y, int width, int height, class_2561 text, boolean checked, boolean showLabel, Consumer checkChanged)
	{
		super(x, y, width, height, text, checked, showLabel);
		this.checkChanged = checkChanged;
	}

	@Override
	public void method_25306()
	{
		super.method_25306();
		checkChanged.accept(method_20372());
	}

	public void setChecked(boolean checked)
	{
		if (this.method_20372() == checked)
			return;
		this.method_25306();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy