package net.geforcemods.securitycraft.screen.components;

import java.util.function.Consumer;

import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.widget.ExtendedButton;

public class IdButton extends ExtendedButton
{
	public final int id;

	public IdButton(int id, int xPos, int yPos, int width, int height, String displayString, Consumer<IdButton> onClick)
	{
		this(id, xPos, yPos, width, height, new StringTextComponent(displayString), onClick);
	}

	public IdButton(int id, int xPos, int yPos, int width, int height, ITextComponent displayString, Consumer<IdButton> onClick)
	{
		super(xPos, yPos, width, height, displayString, b -> onClick.accept((IdButton)b));

		this.id = id;
	}
}

@@ -738,16 +738,47 @@
 g, b -%3E 
+%7B%0D%0A%09%09%09if(onClick != null)%0D%0A%09%09%09%09
 onClick.
@@ -796,16 +796,22 @@
 utton)b)
+;%0D%0A%09%09%7D
 );%0D%0A%0D%0A%09%09

fix crash when click handler is null