Skip to content

Commit 617b1f4

Browse files
author
Loko
authored
Merge pull request #11 from FerusGrim/page-id-removal
Remove overlapping ID from Page
2 parents 63ecf77 + e55b7e4 commit 617b1f4

1 file changed

Lines changed: 4 additions & 21 deletions

File tree

  • src/main/java/com/codehusky/huskyui/states

src/main/java/com/codehusky/huskyui/states/Page.java

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ public class Page extends State {
5555
.add(Keys.DYE_COLOR, DyeColors.BLACK)
5656
.add(Keys.DISPLAY_NAME, Text.of(TextColors.DARK_GRAY, "HuskyUI")).build();
5757

58-
/**
59-
* The ID for this Page which will be removed after I post these Javadocs
60-
* because I just realized how fucking pointless it is that we do this
61-
* when {@link State} already controls it lol were we high or something?
62-
*/
63-
@Nonnull private final String id;
64-
6558
/**
6659
* The {@link Element}s that will be used by this Page.
6760
*
@@ -139,7 +132,7 @@ public Page(@Nonnull final String id,
139132
final boolean autoPaging,
140133
final boolean centered,
141134
final int rows) {
142-
this.id = id;
135+
super(id);
143136
this.elements = elements;
144137
this.inventoryDimension = inventoryDimension;
145138
this.title = title;
@@ -150,16 +143,6 @@ public Page(@Nonnull final String id,
150143
this.rows = rows;
151144
}
152145

153-
/**
154-
* lolol I'll be removing this in a second hi Loki how are you doing?
155-
*
156-
* @return the luldata that won't exist about 4 seconds after this push
157-
*/
158-
@Nonnull
159-
public String getId() {
160-
return this.id;
161-
}
162-
163146
/**
164147
* Gets the {@link ItemStack}s in use by this Page.
165148
*
@@ -254,11 +237,11 @@ public Inventory generatePageView() {
254237
this.getObserver().closeInventory(HuskyUI.getInstance().getGenericCause());
255238
}
256239
} else if (this.elements.get(num) instanceof ActionableElement) {
257-
((ActionableElement) this.elements.get(num)).getAction().runAction(this.id);
240+
((ActionableElement) this.elements.get(num)).getAction().runAction(this.getId());
258241
}
259242
} else {
260243
if (this.elements.get(num) instanceof ActionableElement) {
261-
((ActionableElement) this.elements.get(num)).getAction().runAction(this.id);
244+
((ActionableElement) this.elements.get(num)).getAction().runAction(this.getId());
262245
}
263246
}
264247
});
@@ -358,7 +341,7 @@ public Page copy(@Nonnull final StateContainer newContainer) {
358341
builder.setAutoPaging(this.autoPaging);
359342
builder.setCentered(this.centered);
360343

361-
final Page page = builder.build(this.id);
344+
final Page page = builder.build(this.getId());
362345

363346
page.setContainer(newContainer);
364347
page.setObserver(this.getObserver());

0 commit comments

Comments
 (0)