use of org.spongepowered.common.interfaces.text.IMixinClickEvent in project SpongeCommon by SpongePowered.
the class SpongeClickAction method getHandle.
public static ClickEvent getHandle(ClickAction<?> action) {
final String text;
if (action instanceof ClickAction.ExecuteCallback) {
UUID callbackId = SpongeCallbackHolder.getInstance().getOrCreateIdForCallback(((ClickAction.ExecuteCallback) action).getResult());
text = SpongeCallbackHolder.CALLBACK_COMMAND_QUALIFIED + " " + callbackId;
} else {
text = action.getResult().toString();
}
ClickEvent event = new ClickEvent(getType(action), text);
((IMixinClickEvent) event).setHandle(action);
return event;
}
Aggregations