mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-30 21:17:53 +01:00
Style cleanup
This commit is contained in:
parent
73c53a9b17
commit
7a54b4162d
@ -34,7 +34,7 @@ public final class Bootstrap {
|
|||||||
Class<?> mainClass = classLoader.loadClass(mainClassFullName);
|
Class<?> mainClass = classLoader.loadClass(mainClassFullName);
|
||||||
Method main = mainClass.getDeclaredMethod("main", String[].class);
|
Method main = mainClass.getDeclaredMethod("main", String[].class);
|
||||||
main.setAccessible(true);
|
main.setAccessible(true);
|
||||||
main.invoke(null, new Object[] { args });
|
main.invoke(null, new Object[]{args});
|
||||||
} catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException | ClassNotFoundException e) {
|
} catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException | ClassNotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -44,7 +44,7 @@ public final class Bootstrap {
|
|||||||
// hacks required to pass custom arguments
|
// hacks required to pass custom arguments
|
||||||
Method start = MixinBootstrap.class.getDeclaredMethod("start");
|
Method start = MixinBootstrap.class.getDeclaredMethod("start");
|
||||||
start.setAccessible(true);
|
start.setAccessible(true);
|
||||||
if (! ((boolean)start.invoke(null)) ) {
|
if (!((boolean) start.invoke(null))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,9 +2,15 @@ package net.minestom.server.benchmark;
|
|||||||
|
|
||||||
public class ThreadResult {
|
public class ThreadResult {
|
||||||
|
|
||||||
private final double cpuPercentage, userPercentage, waitedPercentage, blockedPercentage;
|
private final double cpuPercentage;
|
||||||
|
private final double userPercentage;
|
||||||
|
private final double waitedPercentage;
|
||||||
|
private final double blockedPercentage;
|
||||||
|
|
||||||
protected ThreadResult(double cpuPercentage, double userPercentage, double waitedPercentage, double blockedPercentage) {
|
protected ThreadResult(double cpuPercentage,
|
||||||
|
double userPercentage,
|
||||||
|
double waitedPercentage,
|
||||||
|
double blockedPercentage) {
|
||||||
this.cpuPercentage = cpuPercentage;
|
this.cpuPercentage = cpuPercentage;
|
||||||
this.userPercentage = userPercentage;
|
this.userPercentage = userPercentage;
|
||||||
this.waitedPercentage = waitedPercentage;
|
this.waitedPercentage = waitedPercentage;
|
||||||
|
@ -2,6 +2,8 @@ package net.minestom.server.ping;
|
|||||||
|
|
||||||
import com.google.gson.JsonArray;
|
import com.google.gson.JsonArray;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -29,7 +31,9 @@ public class ResponseData {
|
|||||||
|
|
||||||
private String favicon;
|
private String favicon;
|
||||||
|
|
||||||
/** Constructs a new {@link ResponseData}. */
|
/**
|
||||||
|
* Constructs a new {@link ResponseData}.
|
||||||
|
*/
|
||||||
public ResponseData() {
|
public ResponseData() {
|
||||||
this.jsonObject = new JsonObject();
|
this.jsonObject = new JsonObject();
|
||||||
this.versionObject = new JsonObject();
|
this.versionObject = new JsonObject();
|
||||||
@ -119,6 +123,7 @@ public class ResponseData {
|
|||||||
*
|
*
|
||||||
* @return The converted response data as a json tree.
|
* @return The converted response data as a json tree.
|
||||||
*/
|
*/
|
||||||
|
@NotNull
|
||||||
public JsonObject build() {
|
public JsonObject build() {
|
||||||
versionObject.addProperty("name", name);
|
versionObject.addProperty("name", name);
|
||||||
versionObject.addProperty("protocol", protocol);
|
versionObject.addProperty("protocol", protocol);
|
||||||
@ -143,7 +148,9 @@ public class ResponseData {
|
|||||||
return jsonObject;
|
return jsonObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Represents a player line in the server list hover. */
|
/**
|
||||||
|
* Represents a player line in the server list hover.
|
||||||
|
*/
|
||||||
private static class PingPlayer {
|
private static class PingPlayer {
|
||||||
private String name;
|
private String name;
|
||||||
private UUID uuid;
|
private UUID uuid;
|
||||||
|
@ -6,19 +6,21 @@ import net.minestom.server.entity.Player;
|
|||||||
import net.minestom.server.network.packet.server.play.DisplayScoreboardPacket;
|
import net.minestom.server.network.packet.server.play.DisplayScoreboardPacket;
|
||||||
import net.minestom.server.network.packet.server.play.ScoreboardObjectivePacket;
|
import net.minestom.server.network.packet.server.play.ScoreboardObjectivePacket;
|
||||||
import net.minestom.server.network.packet.server.play.UpdateScorePacket;
|
import net.minestom.server.network.packet.server.play.UpdateScorePacket;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface represents all scoreboard of Minecraft
|
* This interface represents all scoreboard of Minecraft.
|
||||||
*/
|
*/
|
||||||
public interface Scoreboard extends Viewable {
|
public interface Scoreboard extends Viewable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a creation objective packet
|
* Creates a creation objective packet.
|
||||||
*
|
*
|
||||||
* @param value The value for the objective
|
* @param value The value for the objective
|
||||||
* @param type The type for the objective
|
* @param type The type for the objective
|
||||||
* @return the creation objective packet
|
* @return the creation objective packet
|
||||||
*/
|
*/
|
||||||
|
@NotNull
|
||||||
default ScoreboardObjectivePacket getCreationObjectivePacket(String value, ScoreboardObjectivePacket.Type type) {
|
default ScoreboardObjectivePacket getCreationObjectivePacket(String value, ScoreboardObjectivePacket.Type type) {
|
||||||
final ScoreboardObjectivePacket packet = new ScoreboardObjectivePacket();
|
final ScoreboardObjectivePacket packet = new ScoreboardObjectivePacket();
|
||||||
packet.objectiveName = this.getObjectiveName();
|
packet.objectiveName = this.getObjectiveName();
|
||||||
@ -30,10 +32,11 @@ public interface Scoreboard extends Viewable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the destruction objective packet
|
* Creates the destruction objective packet.
|
||||||
*
|
*
|
||||||
* @return the destruction objective packet
|
* @return the destruction objective packet
|
||||||
*/
|
*/
|
||||||
|
@NotNull
|
||||||
default ScoreboardObjectivePacket getDestructionObjectivePacket() {
|
default ScoreboardObjectivePacket getDestructionObjectivePacket() {
|
||||||
final ScoreboardObjectivePacket packet = new ScoreboardObjectivePacket();
|
final ScoreboardObjectivePacket packet = new ScoreboardObjectivePacket();
|
||||||
packet.objectiveName = this.getObjectiveName();
|
packet.objectiveName = this.getObjectiveName();
|
||||||
@ -43,11 +46,12 @@ public interface Scoreboard extends Viewable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the {@link DisplayScoreboardPacket}
|
* Creates the {@link DisplayScoreboardPacket}.
|
||||||
*
|
*
|
||||||
* @param position The position of the scoreboard
|
* @param position The position of the scoreboard
|
||||||
* @return the created display scoreboard packet
|
* @return the created display scoreboard packet
|
||||||
*/
|
*/
|
||||||
|
@NotNull
|
||||||
default DisplayScoreboardPacket getDisplayScoreboardPacket(byte position) {
|
default DisplayScoreboardPacket getDisplayScoreboardPacket(byte position) {
|
||||||
final DisplayScoreboardPacket packet = new DisplayScoreboardPacket();
|
final DisplayScoreboardPacket packet = new DisplayScoreboardPacket();
|
||||||
packet.position = position;
|
packet.position = position;
|
||||||
@ -57,7 +61,7 @@ public interface Scoreboard extends Viewable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the score of a {@link Player}
|
* Updates the score of a {@link Player}.
|
||||||
*
|
*
|
||||||
* @param player The player
|
* @param player The player
|
||||||
* @param score The new score
|
* @param score The new score
|
||||||
@ -73,10 +77,11 @@ public interface Scoreboard extends Viewable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the objective name of the scoreboard
|
* Gets the objective name of the scoreboard.
|
||||||
*
|
*
|
||||||
* @return the objective name
|
* @return the objective name
|
||||||
*/
|
*/
|
||||||
|
@NotNull
|
||||||
String getObjectiveName();
|
String getObjectiveName();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,43 +25,43 @@ public class Team {
|
|||||||
private static final ConnectionManager CONNECTION_MANAGER = MinecraftServer.getConnectionManager();
|
private static final ConnectionManager CONNECTION_MANAGER = MinecraftServer.getConnectionManager();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A collection of all registered entities who are on the team
|
* A collection of all registered entities who are on the team.
|
||||||
*/
|
*/
|
||||||
private final Set<String> members;
|
private final Set<String> members;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The registry name of the team
|
* The registry name of the team.
|
||||||
*/
|
*/
|
||||||
private final String teamName;
|
private final String teamName;
|
||||||
/**
|
/**
|
||||||
* The display name of the team
|
* The display name of the team.
|
||||||
*/
|
*/
|
||||||
private JsonMessage teamDisplayName;
|
private JsonMessage teamDisplayName;
|
||||||
/**
|
/**
|
||||||
* A BitMask
|
* A BitMask.
|
||||||
*/
|
*/
|
||||||
private byte friendlyFlags;
|
private byte friendlyFlags;
|
||||||
/**
|
/**
|
||||||
* The visibility of the team
|
* The visibility of the team.
|
||||||
*/
|
*/
|
||||||
private NameTagVisibility nameTagVisibility;
|
private NameTagVisibility nameTagVisibility;
|
||||||
/**
|
/**
|
||||||
* The collision rule of the team
|
* The collision rule of the team.
|
||||||
*/
|
*/
|
||||||
private CollisionRule collisionRule;
|
private CollisionRule collisionRule;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to color the name of players on the team <br>
|
* Used to color the name of players on the team <br>
|
||||||
* The color of a team defines how the names of the team members are visualized
|
* The color of a team defines how the names of the team members are visualized.
|
||||||
*/
|
*/
|
||||||
private ChatColor teamColor;
|
private ChatColor teamColor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shown before the names of the players who belong to this team
|
* Shown before the names of the players who belong to this team.
|
||||||
*/
|
*/
|
||||||
private JsonMessage prefix;
|
private JsonMessage prefix;
|
||||||
/**
|
/**
|
||||||
* Shown after the names of the player who belong to this team
|
* Shown after the names of the player who belong to this team.
|
||||||
*/
|
*/
|
||||||
private JsonMessage suffix;
|
private JsonMessage suffix;
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ package net.minestom.server.scoreboard;
|
|||||||
|
|
||||||
import net.minestom.server.MinecraftServer;
|
import net.minestom.server.MinecraftServer;
|
||||||
import net.minestom.server.chat.ChatColor;
|
import net.minestom.server.chat.ChatColor;
|
||||||
import net.minestom.server.chat.ColoredText;
|
|
||||||
import net.minestom.server.chat.JsonMessage;
|
import net.minestom.server.chat.JsonMessage;
|
||||||
import net.minestom.server.entity.LivingEntity;
|
import net.minestom.server.entity.LivingEntity;
|
||||||
import net.minestom.server.entity.Player;
|
import net.minestom.server.entity.Player;
|
||||||
|
@ -10,7 +10,9 @@ public class ByteRange extends Range<Byte> {
|
|||||||
super(value);
|
super(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isInRange(Byte value) {
|
public boolean isInRange(Byte value) {
|
||||||
return value >= this.getMinimum() && value <= this.getMaximum();
|
return value >= this.getMinimum() && value <= this.getMaximum();
|
||||||
|
@ -10,7 +10,9 @@ public class DoubleRange extends Range<Double> {
|
|||||||
super(value);
|
super(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isInRange(Double value) {
|
public boolean isInRange(Double value) {
|
||||||
return value >= this.getMinimum() && value <= this.getMaximum();
|
return value >= this.getMinimum() && value <= this.getMaximum();
|
||||||
|
@ -10,10 +10,11 @@ public class IntRange extends Range<Integer> {
|
|||||||
super(value);
|
super(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isInRange(Integer value) {
|
public boolean isInRange(Integer value) {
|
||||||
return value >= this.getMinimum() && value <= this.getMaximum();
|
return value >= this.getMinimum() && value <= this.getMaximum();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,9 @@ public class LongRange extends Range<Long> {
|
|||||||
super(value);
|
super(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean isInRange(Long value) {
|
public boolean isInRange(Long value) {
|
||||||
return value >= this.getMinimum() && value <= this.getMaximum();
|
return value >= this.getMinimum() && value <= this.getMaximum();
|
||||||
|
Loading…
Reference in New Issue
Block a user