Reformat code

This commit is contained in:
NichtStudioCode 2023-01-28 16:09:05 +01:00
parent 9b03a9a2db
commit b6c09de2bc
20 changed files with 38 additions and 41 deletions

@ -5,12 +5,8 @@ package xyz.xenondevs.invui.window.type
import xyz.xenondevs.invui.window.Window
import xyz.xenondevs.invui.window.type.context.WindowContext
fun <W: Window, C : WindowContext> WindowType<W, C>.create(contextConsumer: C.() -> Unit): W {
fun <W : Window, C : WindowContext> WindowType<W, C>.create(contextConsumer: C.() -> Unit): W {
val ctx = createContext()
ctx.contextConsumer()
return createWindow(ctx)
}
fun main() {
WindowType.NORMAL.create { }
}

@ -506,7 +506,7 @@ public abstract class AbstractGui implements Gui, GuiParent {
@Override
@Nullable
public SlotElement @NotNull[] getSlotElements() {
public SlotElement @NotNull [] getSlotElements() {
return slotElements.clone();
}
@ -533,7 +533,8 @@ public abstract class AbstractGui implements Gui, GuiParent {
return ((SlotElement.ItemSlotElement) slotElement).getItem();
} else if (slotElement instanceof SlotElement.LinkedSlotElement) {
SlotElement holdingElement = slotElement.getHoldingElement();
if (holdingElement instanceof SlotElement.ItemSlotElement) return ((SlotElement.ItemSlotElement) holdingElement).getItem();
if (holdingElement instanceof SlotElement.ItemSlotElement)
return ((SlotElement.ItemSlotElement) holdingElement).getItem();
}
return null;

@ -39,7 +39,7 @@ public abstract class AbstractWindowContext<V> implements WindowContext {
this.title = title;
}
public void setTitle(@NotNull BaseComponent @NotNull[] title) {
public void setTitle(@NotNull BaseComponent @NotNull [] title) {
this.title = new BaseComponentWrapper(title);
}