mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-10 10:28:21 +01:00
Complexity reduction
This commit is contained in:
parent
585f720f6f
commit
a0b349ec27
@ -153,7 +153,7 @@ public class IslandTeamInviteCommand extends CompositeCommand {
|
||||
}
|
||||
|
||||
private boolean isInviteTypeTeam(UUID invitedPlayerUUID) {
|
||||
return itc.getInvite(invitedPlayerUUID).getType().equals(Type.TEAM);
|
||||
return Objects.requireNonNull(itc.getInvite(invitedPlayerUUID)).getType().equals(Type.TEAM);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,13 +122,17 @@ public class TemplatedPanel extends Panel
|
||||
}
|
||||
|
||||
private void fillBorder(PanelItem[][] itemArray) {
|
||||
if (panelTemplate.border() != null) {
|
||||
if (panelTemplate.border() == null) {
|
||||
return;
|
||||
}
|
||||
PanelItem template = makeTemplate(panelTemplate.border());
|
||||
// Hard coded 6
|
||||
for (int i = 0; i < 6; i++) {
|
||||
if (i == 0 || i == 5) {
|
||||
int numRows = itemArray.length;
|
||||
int numCols = itemArray[0].length;
|
||||
|
||||
for (int i = 0; i < numRows; i++) {
|
||||
if (i == 0 || i == numRows - 1) {
|
||||
// Fill first and last row completely with border.
|
||||
for (int k = 0; k < 9; k++) {
|
||||
for (int k = 0; k < numCols; k++) {
|
||||
if (itemArray[i][k] == null) {
|
||||
itemArray[i][k] = template;
|
||||
}
|
||||
@ -138,14 +142,13 @@ public class TemplatedPanel extends Panel
|
||||
if (itemArray[i][0] == null) {
|
||||
itemArray[i][0] = template;
|
||||
}
|
||||
if (itemArray[i][8] == null) {
|
||||
itemArray[i][8] = template;
|
||||
if (itemArray[i][numCols - 1] == null) {
|
||||
itemArray[i][numCols - 1] = template;
|
||||
}
|
||||
}
|
||||
}
|
||||
panelTemplate.forcedRows()[0] = true;
|
||||
panelTemplate.forcedRows()[5] = true;
|
||||
}
|
||||
panelTemplate.forcedRows()[numRows - 1] = true;
|
||||
}
|
||||
|
||||
private void fillBackground(PanelItem[][] itemArray) {
|
||||
|
Loading…
Reference in New Issue
Block a user