mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-22 02:25:49 +01:00
chore: pre-commit linting
This commit is contained in:
parent
5373620243
commit
ee21d237d3
@ -75,8 +75,9 @@ public abstract class CreateTaggedSubCommand implements SubCommand {
|
||||
String baseString = endsWithSplit
|
||||
? argData
|
||||
: argData.substring(
|
||||
0,
|
||||
argData.lastIndexOf(multiTagSplit) + 1);
|
||||
0,
|
||||
argData.lastIndexOf(multiTagSplit)
|
||||
+ 1);
|
||||
|
||||
tagSuggestions =
|
||||
tagSuggestions
|
||||
|
@ -127,8 +127,8 @@ public class ReflectiveConstructor<T> extends Constructor {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
infoLogger.warning("Failed to set field " + field.getName()
|
||||
+ " in " + currentClass.getName() + ": "
|
||||
+ e.getMessage());
|
||||
+ " in " + currentClass.getName()
|
||||
+ ": " + e.getMessage());
|
||||
infoLogger.error(e);
|
||||
throw new RuntimeException("Failed to set field "
|
||||
+ field.getName() + " in "
|
||||
@ -193,7 +193,6 @@ public class ReflectiveConstructor<T> extends Constructor {
|
||||
*/
|
||||
private void setField(Object instance, Field field, Object value)
|
||||
throws IllegalAccessException {
|
||||
|
||||
// Check for numeric type compatibility and cast if necessary
|
||||
if (field.getType() == float.class &&value instanceof Double) {
|
||||
value = ((Double) value).floatValue();
|
||||
|
@ -49,9 +49,9 @@ public class CommandTag implements Tag.Activation, Tag.Split, Tag.Creation {
|
||||
ActivationData activeData, String[] argData) {
|
||||
var commandPortals = configRepository.getCommandPortals();
|
||||
|
||||
if(!commandPortals.enabled) {
|
||||
if (!commandPortals.enabled) {
|
||||
player.sendMessage(Lang.translate("messageprefix.negative")
|
||||
+ Lang.translate("tag.command.disabled"));
|
||||
+ Lang.translate("tag.command.disabled"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -60,22 +60,26 @@ public class CommandTag implements Tag.Activation, Tag.Split, Tag.Creation {
|
||||
switch (executionCommand) {
|
||||
case '!':
|
||||
if (!commandPortals.op) {
|
||||
player.sendMessage(Lang.translate("messageprefix.negative")
|
||||
+ Lang.translate("tag.command.op.disabled"));
|
||||
player.sendMessage(
|
||||
Lang.translate("messageprefix.negative")
|
||||
+ Lang.translate("tag.command.op.disabled"));
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case '#':
|
||||
if (!commandPortals.console) {
|
||||
player.sendMessage(Lang.translate("messageprefix.negative")
|
||||
+ Lang.translate("tag.command.console.disabled"));
|
||||
player.sendMessage(
|
||||
Lang.translate("messageprefix.negative")
|
||||
+ Lang.translate("tag.command.console.disabled"));
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case '^':
|
||||
if (!commandPortals.permsWildcard) {
|
||||
player.sendMessage(Lang.translate("messageprefix.negative")
|
||||
+ Lang.translate("tag.command.permswildcard.disabled"));
|
||||
player.sendMessage(
|
||||
Lang.translate("messageprefix.negative")
|
||||
+ Lang.translate(
|
||||
"tag.command.permswildcard.disabled"));
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@ -134,9 +138,9 @@ public class CommandTag implements Tag.Activation, Tag.Split, Tag.Creation {
|
||||
String[] argData) {
|
||||
if (argData != null) {
|
||||
var commandPortals = configRepository.getCommandPortals();
|
||||
if(!commandPortals.enabled) {
|
||||
if (!commandPortals.enabled) {
|
||||
player.sendMessage(Lang.translate("messageprefix.negative")
|
||||
+ Lang.translate("tag.command.disabled"));
|
||||
+ Lang.translate("tag.command.disabled"));
|
||||
return false;
|
||||
}
|
||||
for (String command : argData) {
|
||||
|
@ -51,13 +51,15 @@ public class FriendlyDataOutput {
|
||||
public void writeUtf(String text, int maxLength) {
|
||||
if (text.length() > maxLength) {
|
||||
throw new EncoderException("String too big (was " + text.length()
|
||||
+ " characters, max " + maxLength + ")");
|
||||
+ " characters, max " + maxLength
|
||||
+ ")");
|
||||
} else {
|
||||
byte[] abyte = text.getBytes(StandardCharsets.UTF_8);
|
||||
int i = getMaxEncodedUtfLength(maxLength);
|
||||
if (abyte.length > i) {
|
||||
throw new EncoderException("String too big (was " + abyte.length
|
||||
+ " bytes encoded, max " + i + ")");
|
||||
+ " bytes encoded, max " + i
|
||||
+ ")");
|
||||
} else {
|
||||
this.writeVarInt(abyte.length);
|
||||
this.writeBytes(abyte);
|
||||
|
@ -51,7 +51,7 @@ public class TagReader {
|
||||
currentIdentifier = arg.substring(0, colonIndex);
|
||||
currentValue = new StringBuilder(arg.substring(colonIndex + 1));
|
||||
inQuotes = currentValue.toString().startsWith("\"");
|
||||
if(inQuotes) {
|
||||
if (inQuotes) {
|
||||
currentValue.deleteCharAt(0);
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user