mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-24 11:45:31 +01:00
Fixed code smells
This commit is contained in:
parent
c078d8dce6
commit
01b7ace0be
@ -10,7 +10,7 @@ import world.bentobox.bentobox.api.commands.ConfirmableCommand;
|
||||
import world.bentobox.bentobox.api.user.User;
|
||||
|
||||
/**
|
||||
* Unlike {@link AdminClearresetsCommand}, this command will be removed.
|
||||
* @deprecated Unlike {@link AdminClearresetsCommand}, this command will be removed.
|
||||
* We will be working on an alternative which will use {@link world.bentobox.bentobox.api.commands.admin.resets.AdminResetsResetCommand} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
|
@ -118,7 +118,8 @@ public class ServerCompatibility {
|
||||
|
||||
if (version == null || version.getCompatibility().equals(Compatibility.INCOMPATIBLE)) {
|
||||
// 'Version = null' means that it's not listed. And therefore, it's implicitly incompatible.
|
||||
return result = Compatibility.INCOMPATIBLE;
|
||||
result = Compatibility.INCOMPATIBLE;
|
||||
return result;
|
||||
}
|
||||
|
||||
// Now, check the server software
|
||||
@ -126,19 +127,23 @@ public class ServerCompatibility {
|
||||
|
||||
if (software == null || software.getCompatibility().equals(Compatibility.INCOMPATIBLE)) {
|
||||
// 'software = null' means that it's not listed. And therefore, it's implicitly incompatible.
|
||||
return result = Compatibility.INCOMPATIBLE;
|
||||
result = Compatibility.INCOMPATIBLE;
|
||||
return result;
|
||||
}
|
||||
|
||||
if (software.getCompatibility().equals(Compatibility.NOT_SUPPORTED) || version.getCompatibility().equals(Compatibility.NOT_SUPPORTED)) {
|
||||
return result = Compatibility.NOT_SUPPORTED;
|
||||
result = Compatibility.NOT_SUPPORTED;
|
||||
return result;
|
||||
}
|
||||
|
||||
if (software.getCompatibility().equals(Compatibility.SUPPORTED) || version.getCompatibility().equals(Compatibility.SUPPORTED)) {
|
||||
return result = Compatibility.SUPPORTED;
|
||||
result = Compatibility.SUPPORTED;
|
||||
return result;
|
||||
}
|
||||
|
||||
// Nothing's wrong, the server is compatible.
|
||||
return result = Compatibility.COMPATIBLE;
|
||||
result = Compatibility.COMPATIBLE;
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package world.bentobox.bentobox.api.localization;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
@ -10,21 +7,19 @@ import org.junit.Test;
|
||||
/**
|
||||
* Test class just to check that these constants don't accidentally change
|
||||
* @author tastybento
|
||||
*
|
||||
*/
|
||||
public class TextVariablesTest {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
assertEquals("[name]", TextVariables.NAME);
|
||||
assertEquals("[description]", TextVariables.DESCRIPTION);
|
||||
assertEquals("[number]", TextVariables.NUMBER);
|
||||
assertEquals("[rank]", TextVariables.RANK);
|
||||
assertEquals("[label]", TextVariables.LABEL);
|
||||
assertEquals("[permission]", TextVariables.PERMISSION);
|
||||
assertEquals("[spawn_here]", TextVariables.SPAWN_HERE);
|
||||
assertEquals("[version]", TextVariables.VERSION);
|
||||
assertEquals("[start]", TextVariables.START_TEXT);
|
||||
assertEquals(TextVariables.NAME, "[name]");
|
||||
assertEquals(TextVariables.DESCRIPTION, "[description]");
|
||||
assertEquals(TextVariables.NUMBER, "[number]");
|
||||
assertEquals(TextVariables.RANK, "[rank]");
|
||||
assertEquals(TextVariables.LABEL, "[label]");
|
||||
assertEquals(TextVariables.PERMISSION, "[permission]");
|
||||
assertEquals(TextVariables.SPAWN_HERE, "[spawn_here]");
|
||||
assertEquals(TextVariables.VERSION, "[version]");
|
||||
assertEquals(TextVariables.START_TEXT, "[start]");
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user