mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Little bit of refactoring
This commit is contained in:
parent
7a4712f930
commit
f6a9150296
@ -82,10 +82,6 @@ public final class SlimefunGuide {
|
||||
|
||||
@ParametersAreNonnullByDefault
|
||||
public static void openCategory(PlayerProfile profile, Category category, SlimefunGuideMode layout, int selectedPage) {
|
||||
if (category == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
SlimefunPlugin.getRegistry().getGuideLayout(layout).openCategory(profile, category, selectedPage);
|
||||
}
|
||||
|
||||
@ -110,8 +106,12 @@ public final class SlimefunGuide {
|
||||
SlimefunPlugin.getRegistry().getGuideLayout(SlimefunGuideMode.SURVIVAL_MODE).displayItem(profile, item, addToHistory);
|
||||
}
|
||||
|
||||
public static boolean isGuideItem(@Nonnull ItemStack item) {
|
||||
return SlimefunUtils.isItemSimilar(item, getItem(SlimefunGuideMode.SURVIVAL_MODE), true) || SlimefunUtils.isItemSimilar(item, getItem(SlimefunGuideMode.CHEAT_MODE), true);
|
||||
public static boolean isGuideItem(@Nullable ItemStack item) {
|
||||
if (item == null) {
|
||||
return false;
|
||||
} else {
|
||||
return SlimefunUtils.isItemSimilar(item, getItem(SlimefunGuideMode.SURVIVAL_MODE), true) || SlimefunUtils.isItemSimilar(item, getItem(SlimefunGuideMode.CHEAT_MODE), true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -393,19 +393,6 @@ final class CargoUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the whitelist/blacklist slots in a Cargo Input Node. If you wish to access the items
|
||||
* in the cargo (without hardcoding the slots in case of change) then you can use this method.
|
||||
*
|
||||
* @deprecated Renamed to {@link #getFilteringSlots()}
|
||||
*
|
||||
* @return The slot indexes for the whitelist/blacklist section.
|
||||
*/
|
||||
@Deprecated
|
||||
public static int[] getWhitelistBlacklistSlots() {
|
||||
return getFilteringSlots();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the {@link ItemFilter} slots for a Cargo Node. If you wish to access the items
|
||||
* in the cargo (without hardcoding the slots in case of change) then you can use this method.
|
||||
|
@ -136,7 +136,6 @@ public class ElevatorPlate extends SimpleSlimefunItem<BlockUseHandler> {
|
||||
ChestMenu menu = new ChestMenu(SlimefunPlugin.getLocalization().getMessage(p, "machines.ELEVATOR.pick-a-floor"));
|
||||
menu.setEmptySlotsClickable(false);
|
||||
|
||||
int pages = 1 + (floors.size() / GUI_SIZE);
|
||||
int index = GUI_SIZE * (page - 1);
|
||||
|
||||
for (int i = 0; i < Math.min(GUI_SIZE, floors.size() - index); i++) {
|
||||
@ -162,6 +161,8 @@ public class ElevatorPlate extends SimpleSlimefunItem<BlockUseHandler> {
|
||||
// @formatter:on
|
||||
}
|
||||
|
||||
int pages = 1 + (floors.size() / GUI_SIZE);
|
||||
|
||||
// 0 index so size is the first slot of the last row.
|
||||
for (int i = GUI_SIZE; i < GUI_SIZE + 9; i++) {
|
||||
if (i == GUI_SIZE + 2 && pages > 1 && page != 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user