Skip to content

Commit fc207b6

Browse files
Merge pull request #3232 from svr333/FixCategoryNaming
Rename category -> itemGroup
2 parents 3450019 + ed89b23 commit fc207b6

File tree

263 files changed

+633
-637
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+633
-637
lines changed

src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public void openTransmitterControlPanel(@Nonnull Player p) {
158158
menu.addItem(4, new CustomItemStack(SlimefunItems.GPS_CONTROL_PANEL, "&7Network Info", "", "&8\u21E8 &7Status: " + (complexity > 0 ? "&2&lONLINE" : "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &f" + complexity));
159159
menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler());
160160

161-
menu.addItem(6, new CustomItemStack(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"), "", ChatColor.GRAY + "\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-category")));
161+
menu.addItem(6, new CustomItemStack(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"), "", ChatColor.GRAY + "\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup")));
162162
menu.addMenuClickHandler(6, (pl, slot, item, action) -> {
163163
openWaypointControlPanel(pl);
164164
return false;
@@ -221,7 +221,7 @@ public void openWaypointControlPanel(@Nonnull Player p) {
221221
menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler());
222222
}
223223

224-
menu.addItem(2, new CustomItemStack(SlimefunItems.GPS_TRANSMITTER, "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters"), "", ChatColor.GRAY + "\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-category")));
224+
menu.addItem(2, new CustomItemStack(SlimefunItems.GPS_TRANSMITTER, "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters"), "", ChatColor.GRAY + "\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup")));
225225
menu.addMenuClickHandler(2, (pl, slot, item, action) -> {
226226
openTransmitterControlPanel(pl);
227227
return false;

src/main/java/io/github/thebusybiscuit/slimefun4/api/items/ItemGroup.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public void remove(@Nonnull SlimefunItem item) {
202202
@Nonnull
203203
public ItemStack getItem(@Nonnull Player p) {
204204
return new CustomItemStack(item, meta -> {
205-
String name = Slimefun.getLocalization().getCategoryName(p, getKey());
205+
String name = Slimefun.getLocalization().getItemGroupName(p, getKey());
206206

207207
if (name == null) {
208208
name = item.getItemMeta().getDisplayName();
@@ -214,7 +214,7 @@ public ItemStack getItem(@Nonnull Player p) {
214214
meta.setDisplayName(ChatColor.YELLOW + name);
215215
}
216216

217-
meta.setLore(Arrays.asList("", ChatColor.GRAY + "\u21E8 " + ChatColor.GREEN + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-category")));
217+
meta.setLore(Arrays.asList("", ChatColor.GRAY + "\u21E8 " + ChatColor.GREEN + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup")));
218218
});
219219
}
220220

@@ -240,7 +240,7 @@ public String getUnlocalizedName() {
240240
*/
241241
@Nonnull
242242
public String getDisplayName(@Nonnull Player p) {
243-
String localized = Slimefun.getLocalization().getCategoryName(p, getKey());
243+
String localized = Slimefun.getLocalization().getItemGroupName(p, getKey());
244244

245245
if (localized != null) {
246246
return localized;

src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ public void register(@Nonnull SlimefunAddon addon) {
500500
* <strong>This method is for internal purposes, like {@link ItemGroup} registration only</strong>
501501
*/
502502
private final void onEnable() {
503-
// Register the Category too if it hasn't been registered yet
503+
// Register the ItemGroup too if it hasn't been registered yet
504504
if (!itemGroup.isRegistered()) {
505505
itemGroup.register(addon);
506506
}
@@ -671,16 +671,16 @@ public void setRecipeType(@Nonnull RecipeType type) {
671671
/**
672672
* This sets the {@link ItemGroup} in which this {@link SlimefunItem} will be displayed.
673673
*
674-
* @param category
674+
* @param itemGroup
675675
* The new {@link ItemGroup}
676676
*/
677-
public void setItemGroup(@Nonnull ItemGroup category) {
678-
Validate.notNull(category, "The Category is not allowed to be null!");
677+
public void setItemGroup(@Nonnull ItemGroup itemGroup) {
678+
Validate.notNull(itemGroup, "The ItemGroup is not allowed to be null!");
679679

680680
this.itemGroup.remove(this);
681-
category.add(this);
681+
itemGroup.add(this);
682682

683-
this.itemGroup = category;
683+
this.itemGroup = itemGroup;
684684
}
685685

686686
/**

src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/FlexItemGroup.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected FlexItemGroup(NamespacedKey key, ItemStack item, int tier) {
3838

3939
/**
4040
* This method returns whether this {@link FlexItemGroup} is visible under the given context.
41-
* Implementing this method gives full flexibility over who can see the Category when and where.
41+
* Implementing this method gives full flexibility over who can see the ItemGroup when and where.
4242
*
4343
* @param p
4444
* The {@link Player} who opened his {@link SlimefunGuide}
@@ -78,22 +78,22 @@ public final boolean isHidden(@Nonnull Player p) {
7878

7979
@Override
8080
public final void add(@Nonnull SlimefunItem item) {
81-
throw new UnsupportedOperationException("You cannot add items to a FlexCategory!");
81+
throw new UnsupportedOperationException("You cannot add items to a FlexItemGroup!");
8282
}
8383

8484
@Override
8585
public final @Nonnull List<SlimefunItem> getItems() {
86-
throw new UnsupportedOperationException("A FlexCategory has no items!");
86+
throw new UnsupportedOperationException("A FlexItemGroup has no items!");
8787
}
8888

8989
@Override
9090
public final boolean contains(SlimefunItem item) {
91-
throw new UnsupportedOperationException("A FlexCategory has no items!");
91+
throw new UnsupportedOperationException("A FlexItemGroup has no items!");
9292
}
9393

9494
@Override
9595
public final void remove(@Nonnull SlimefunItem item) {
96-
throw new UnsupportedOperationException("A FlexCategory has no items, so there is nothing remove!");
96+
throw new UnsupportedOperationException("A FlexItemGroup has no items, so there is nothing remove!");
9797
}
9898

9999
}

src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/LockedItemGroup.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ public void register(@Nonnull SlimefunAddon addon) {
8787
}
8888
}
8989

90-
for (ItemGroup category : Slimefun.getRegistry().getAllItemGroups()) {
91-
if (namespacedKeys.remove(category.getKey())) {
92-
addParent(category);
90+
for (ItemGroup itemGroup : Slimefun.getRegistry().getAllItemGroups()) {
91+
if (namespacedKeys.remove(itemGroup.getKey())) {
92+
addParent(itemGroup);
9393
}
9494
}
9595

src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/NestedItemGroup.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ private void openGuide(Player p, PlayerProfile profile, SlimefunGuideMode mode,
102102
while (target < (subGroups.size() - 1) && index < GROUP_SIZE + 9) {
103103
target++;
104104

105-
SubItemGroup category = subGroups.get(target);
106-
menu.addItem(index, category.getItem(p));
105+
SubItemGroup itemGroup = subGroups.get(target);
106+
menu.addItem(index, itemGroup.getItem(p));
107107
menu.addMenuClickHandler(index, (pl, slot, item, action) -> {
108-
SlimefunGuide.openCategory(profile, category, mode, 1);
108+
SlimefunGuide.openItemGroup(profile, itemGroup, mode, 1);
109109
return false;
110110
});
111111

src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/SeasonalItemGroup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public SeasonalItemGroup(NamespacedKey key, Month month, int tier, ItemStack ite
5757

5858
@Override
5959
public boolean isHidden(@Nonnull Player p) {
60-
// Hide this Category if the month differs
60+
// Hide this ItemGroup if the month differs
6161
if (month != LocalDate.now().getMonth()) {
6262
return true;
6363
}

src/main/java/io/github/thebusybiscuit/slimefun4/api/researches/Research.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,24 +199,24 @@ public List<SlimefunItem> getAffectedItems() {
199199
* The {@link PlayerProfile} of that {@link Player}.
200200
* @param sfItem
201201
* The {@link SlimefunItem} on which the {@link Player} clicked.
202-
* @param category
202+
* @param itemGroup
203203
* The {@link ItemGroup} where the {@link Player} was.
204204
* @param page
205205
* The page number of where the {@link Player} was in the {@link ItemGroup};
206206
*
207207
*/
208208
@ParametersAreNonnullByDefault
209-
public void unlockFromGuide(SlimefunGuideImplementation guide, Player player, PlayerProfile profile, SlimefunItem sfItem, ItemGroup category, int page) {
209+
public void unlockFromGuide(SlimefunGuideImplementation guide, Player player, PlayerProfile profile, SlimefunItem sfItem, ItemGroup itemGroup, int page) {
210210
if (!Slimefun.getRegistry().getCurrentlyResearchingPlayers().contains(player.getUniqueId())) {
211211
if (profile.hasUnlocked(this)) {
212-
guide.openItemGroup(profile, category, page);
212+
guide.openItemGroup(profile, itemGroup, page);
213213
} else {
214214
PlayerPreResearchEvent event = new PlayerPreResearchEvent(player, this, sfItem);
215215
Bukkit.getPluginManager().callEvent(event);
216216

217217
if (!event.isCancelled()) {
218218
if (this.canUnlock(player)) {
219-
guide.unlockItem(player, sfItem, pl -> guide.openItemGroup(profile, category, page));
219+
guide.unlockItem(player, sfItem, pl -> guide.openItemGroup(profile, itemGroup, page));
220220
} else {
221221
Slimefun.getLocalization().sendMessage(player, "messages.not-enough-xp", true);
222222
}

src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/GuideHistory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ public int getMainMenuPage() {
7474
* Should the {@link ItemGroup} already be the last element in this {@link GuideHistory},
7575
* then the entry will be overridden with the new page.
7676
*
77-
* @param category
77+
* @param itemGroup
7878
* The {@link ItemGroup} that should be added to this {@link GuideHistory}
7979
* @param page
8080
* The current page of the {@link ItemGroup} that should be stored
8181
*/
82-
public void add(@Nonnull ItemGroup category, int page) {
83-
refresh(category, page);
82+
public void add(@Nonnull ItemGroup itemGroup, int page) {
83+
refresh(itemGroup, page);
8484
}
8585

8686
/**

src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/SlimefunGuide.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ public static void openMainMenu(PlayerProfile profile, SlimefunGuideMode mode, i
8282
}
8383

8484
@ParametersAreNonnullByDefault
85-
public static void openCategory(PlayerProfile profile, ItemGroup category, SlimefunGuideMode mode, int selectedPage) {
86-
Slimefun.getRegistry().getSlimefunGuide(mode).openItemGroup(profile, category, selectedPage);
85+
public static void openItemGroup(PlayerProfile profile, ItemGroup itemGroup, SlimefunGuideMode mode, int selectedPage) {
86+
Slimefun.getRegistry().getSlimefunGuide(mode).openItemGroup(profile, itemGroup, selectedPage);
8787
}
8888

8989
@ParametersAreNonnullByDefault

0 commit comments

Comments
 (0)