mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-01 13:01:36 +01:00
Removed deprecated FlagsManager#getFlagByID(String)
This method was actually still used in some classes, so I had to fix them as well.
This commit is contained in:
parent
57d70c3d24
commit
de69c9c571
@ -83,18 +83,6 @@ public class FlagsManager {
|
|||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get flag by ID
|
|
||||||
* @param id unique id for this flag
|
|
||||||
* @return Flag or null if not known
|
|
||||||
* @deprecated As of 1.1, use {@link #getFlag(String)} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@Nullable
|
|
||||||
public Flag getFlagByID(@NonNull String id) {
|
|
||||||
return getFlag(id).orElse(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a Flag by providing an ID.
|
* Gets a Flag by providing an ID.
|
||||||
* @param id Unique ID for this Flag.
|
* @param id Unique ID for this Flag.
|
||||||
|
@ -42,11 +42,7 @@ public class SettingsPanel {
|
|||||||
|
|
||||||
// Get a list of flags of the correct type and sort by the translated names
|
// Get a list of flags of the correct type and sort by the translated names
|
||||||
List<Flag> flags = plugin.getFlagsManager().getFlags().stream().filter(f -> f.getType().equals(flagType))
|
List<Flag> flags = plugin.getFlagsManager().getFlags().stream().filter(f -> f.getType().equals(flagType))
|
||||||
.sorted(Comparator.comparing(Flag::getID, (s1, s2) -> {
|
.sorted(Comparator.comparing(flag -> user.getTranslation(flag.getNameReference())))
|
||||||
String s1Translation = user.getTranslation(plugin.getFlagsManager().getFlagByID(s1).getNameReference());
|
|
||||||
String s2Translation = user.getTranslation(plugin.getFlagsManager().getFlagByID(s2).getNameReference());
|
|
||||||
return s1Translation.compareTo(s2Translation);
|
|
||||||
}))
|
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
// Use paging
|
// Use paging
|
||||||
|
@ -101,7 +101,7 @@ public class InvincibleVisitorsListenerTest {
|
|||||||
PanelItem item = mock(PanelItem.class);
|
PanelItem item = mock(PanelItem.class);
|
||||||
when(item.getItem()).thenReturn(mock(ItemStack.class));
|
when(item.getItem()).thenReturn(mock(ItemStack.class));
|
||||||
when(flag.toPanelItem(Mockito.any(), Mockito.eq(user))).thenReturn(item);
|
when(flag.toPanelItem(Mockito.any(), Mockito.eq(user))).thenReturn(item);
|
||||||
when(fm.getFlagByID(Mockito.anyString())).thenReturn(flag);
|
when(fm.getFlag(Mockito.anyString())).thenReturn(Optional.of(flag));
|
||||||
when(plugin.getFlagsManager()).thenReturn(fm);
|
when(plugin.getFlagsManager()).thenReturn(fm);
|
||||||
|
|
||||||
// Island Manager
|
// Island Manager
|
||||||
|
@ -149,7 +149,7 @@ public class PVPListenerTest {
|
|||||||
PanelItem item = mock(PanelItem.class);
|
PanelItem item = mock(PanelItem.class);
|
||||||
when(item.getItem()).thenReturn(mock(ItemStack.class));
|
when(item.getItem()).thenReturn(mock(ItemStack.class));
|
||||||
when(flag.toPanelItem(Mockito.any(), Mockito.any())).thenReturn(item);
|
when(flag.toPanelItem(Mockito.any(), Mockito.any())).thenReturn(item);
|
||||||
when(fm.getFlagByID(Mockito.anyString())).thenReturn(flag);
|
when(fm.getFlag(Mockito.anyString())).thenReturn(Optional.of(flag));
|
||||||
when(plugin.getFlagsManager()).thenReturn(fm);
|
when(plugin.getFlagsManager()).thenReturn(fm);
|
||||||
|
|
||||||
im = mock(IslandsManager.class);
|
im = mock(IslandsManager.class);
|
||||||
|
Loading…
Reference in New Issue
Block a user