diff --git a/src/main/java/net/minestom/server/entity/Entity.java b/src/main/java/net/minestom/server/entity/Entity.java index d04534078..1e89ed313 100644 --- a/src/main/java/net/minestom/server/entity/Entity.java +++ b/src/main/java/net/minestom/server/entity/Entity.java @@ -711,7 +711,7 @@ public abstract class Entity implements Viewable, EventHandler, DataContainer { } /** - * Change the gravity of the entity. + * Changes the gravity of the entity. * * @param gravityDragPerTick the gravity drag per tick */ diff --git a/src/main/java/net/minestom/server/entity/EntityCreature.java b/src/main/java/net/minestom/server/entity/EntityCreature.java index e5461e560..a894d768f 100644 --- a/src/main/java/net/minestom/server/entity/EntityCreature.java +++ b/src/main/java/net/minestom/server/entity/EntityCreature.java @@ -220,7 +220,7 @@ public abstract class EntityCreature extends LivingEntity { } /** - * Change the entity target + * Changes the entity target * * @param target the new entity target */ diff --git a/src/main/java/net/minestom/server/entity/fakeplayer/FakePlayerController.java b/src/main/java/net/minestom/server/entity/fakeplayer/FakePlayerController.java index 00a7f01b5..59a60eff9 100644 --- a/src/main/java/net/minestom/server/entity/fakeplayer/FakePlayerController.java +++ b/src/main/java/net/minestom/server/entity/fakeplayer/FakePlayerController.java @@ -27,7 +27,7 @@ public class FakePlayerController { } /** - * Make the player write a message + * Makes the player write a message * * @param message the message to write */ @@ -142,7 +142,7 @@ public class FakePlayerController { } /** - * Make the player receives a packet + * Makes the player receives a packet * WARNING: pretty much unsafe, used internally to redirect packets here, * you should instead use {@link net.minestom.server.network.player.PlayerConnection#sendPacket(ServerPacket)} * diff --git a/src/main/java/net/minestom/server/entity/pathfinding/PFPathingEntity.java b/src/main/java/net/minestom/server/entity/pathfinding/PFPathingEntity.java index 2392a18a5..7894bdf54 100644 --- a/src/main/java/net/minestom/server/entity/pathfinding/PFPathingEntity.java +++ b/src/main/java/net/minestom/server/entity/pathfinding/PFPathingEntity.java @@ -44,7 +44,7 @@ public class PFPathingEntity implements IPathingEntity { } /** - * Change the search range of the entity + * Changes the search range of the entity * * @param searchRange the new entity's search range */ diff --git a/src/main/java/net/minestom/server/instance/Instance.java b/src/main/java/net/minestom/server/instance/Instance.java index 261d3abbc..1618706a6 100644 --- a/src/main/java/net/minestom/server/instance/Instance.java +++ b/src/main/java/net/minestom/server/instance/Instance.java @@ -370,7 +370,7 @@ public abstract class Instance implements BlockModifier, EventHandler, DataConta } /** - * Change the time rate of the instance + * Changes the time rate of the instance *
* 1 is the default value and can be set to 0 to be completely disabled (constant time) * @@ -392,7 +392,7 @@ public abstract class Instance implements BlockModifier, EventHandler, DataConta } /** - * Change the rate at which the client is updated about the time + * Changes the rate at which the client is updated about the time *
* Setting it to null means that the client will never know about time change * (but will still change server-side) diff --git a/src/main/java/net/minestom/server/inventory/Inventory.java b/src/main/java/net/minestom/server/inventory/Inventory.java index cb6fcd9d2..08de92f8e 100644 --- a/src/main/java/net/minestom/server/inventory/Inventory.java +++ b/src/main/java/net/minestom/server/inventory/Inventory.java @@ -350,7 +350,7 @@ public class Inventory implements InventoryModifier, InventoryClickHandler, View } /** - * Change the internal player's cursor item + * Changes the internal player's cursor item *
* WARNING: the player will not be notified by the change * diff --git a/src/main/java/net/minestom/server/listener/PlayerDiggingListener.java b/src/main/java/net/minestom/server/listener/PlayerDiggingListener.java index fbeaa5b54..083f17983 100644 --- a/src/main/java/net/minestom/server/listener/PlayerDiggingListener.java +++ b/src/main/java/net/minestom/server/listener/PlayerDiggingListener.java @@ -80,7 +80,15 @@ public class PlayerDiggingListener { ClientPlayerDiggingPacket.Status.CANCELLED_DIGGING, true); break; case FINISHED_DIGGING: - breakBlock(instance, player, blockPosition, blockStateId); + final CustomBlock customBlock = instance.getCustomBlock(blockPosition); + if (customBlock != null && customBlock.enableCustomBreakDelay()) { + // Is not supposed to happen, probably a bug + sendAcknowledgePacket(player, blockPosition, blockStateId, + ClientPlayerDiggingPacket.Status.FINISHED_DIGGING, false); + } else { + // Vanilla block + breakBlock(instance, player, blockPosition, blockStateId); + } break; case DROP_ITEM_STACK: final ItemStack droppedItemStack = player.getInventory().getItemInMainHand().clone(); diff --git a/src/main/java/net/minestom/server/network/ConnectionManager.java b/src/main/java/net/minestom/server/network/ConnectionManager.java index e3cdf76dd..082f672ff 100644 --- a/src/main/java/net/minestom/server/network/ConnectionManager.java +++ b/src/main/java/net/minestom/server/network/ConnectionManager.java @@ -238,8 +238,9 @@ public final class ConnectionManager { } /** - * Removes a {@link Player} from the players list, - * used during disconnection. + * Removes a {@link Player} from the players list. + *
+ * Used during disconnection, you shouldn't have to do it manually.
*
* @param connection the player connection
*/
diff --git a/src/main/java/net/minestom/server/scoreboard/Team.java b/src/main/java/net/minestom/server/scoreboard/Team.java
index a84ab1e2c..809dd2e70 100644
--- a/src/main/java/net/minestom/server/scoreboard/Team.java
+++ b/src/main/java/net/minestom/server/scoreboard/Team.java
@@ -76,7 +76,7 @@ public class Team {
private String[] entities;
/**
- * Default constructor to creates a team
+ * Default constructor to creates a team.
*
* @param teamName The registry name for the team
*/
@@ -113,9 +113,9 @@ public class Team {
}
/**
- * Adds a member to the {@link Team}
+ * Adds a member to the {@link Team}.
*
- * This member can be a {@link Player} or an {@link LivingEntity}
+ * This member can be a {@link Player} or an {@link LivingEntity}.
*
* @param member The member to be added
*/
@@ -139,7 +139,7 @@ public class Team {
}
/**
- * Removes a member from the {@link Team}
+ * Removes a member from the {@link Team}.
*
* @param member The member to be removed
*/
@@ -165,9 +165,9 @@ public class Team {
}
/**
- * Change the display name of the team
+ * Changes the display name of the team.
*
- * Warning: This is only changed on the server side
+ * Warning: This is only changed on the server side.
*
* @param teamDisplayName The new display name
*/
@@ -177,7 +177,7 @@ public class Team {
}
/**
- * Change the display name of the team and sends an update packet
+ * Changes the display name of the team and sends an update packet.
*
* @param teamDisplayName The new display name
*/
@@ -187,9 +187,9 @@ public class Team {
}
/**
- * Change the {@link NameTagVisibility} of the team
+ * Changes the {@link NameTagVisibility} of the team.
*
- * Warning: This is only changed on the server side
+ * Warning: This is only changed on the server side.
*
* @param visibility The new tag visibility
*/
@@ -199,7 +199,7 @@ public class Team {
}
/**
- * Change the {@link NameTagVisibility} of the team and sends an update packet
+ * Changes the {@link NameTagVisibility} of the team and sends an update packet.
*
* @param nameTagVisibility The new tag visibility
*/
@@ -209,9 +209,9 @@ public class Team {
}
/**
- * Change the {@link CollisionRule} of the team
+ * Changes the {@link CollisionRule} of the team.
*
- * Warning: This is only changed on the server side
+ * Warning: This is only changed on the server side.
*
* @param rule The new rule
*/
@@ -221,7 +221,7 @@ public class Team {
}
/**
- * Change the collision rule of the team and sends an update packet
+ * Changes the collision rule of the team and sends an update packet.
*
* @param collisionRule The new collision rule
*/
@@ -231,9 +231,9 @@ public class Team {
}
/**
- * Change the color of the team
+ * Changes the color of the team.
*
- * Warning: This is only changed on the server side
+ * Warning: This is only changed on the server side.
*
* @param color The new team color
*/
@@ -243,7 +243,7 @@ public class Team {
}
/**
- * Change the color of the team and sends an update packet
+ * Changes the color of the team and sends an update packet.
*
* @param teamColor The new team color
*/
@@ -253,9 +253,9 @@ public class Team {
}
/**
- * Change the prefix of the team
+ * Changes the prefix of the team.
*
- * Warning: This is only changed on the server side
+ * Warning: This is only changed on the server side.
*
* @param prefix The new prefix
*/
@@ -265,7 +265,7 @@ public class Team {
}
/**
- * Change the prefix of the team and sends an update packet
+ * Changes the prefix of the team and sends an update packet.
*
* @param prefix The new prefix
*/
@@ -275,9 +275,9 @@ public class Team {
}
/**
- * Change the suffix of the team
+ * Changes the suffix of the team.
*
- * Warning: This is only changed on the server side
+ * Warning: This is only changed on the server side.
*
* @param suffix The new suffix
*/
@@ -287,7 +287,7 @@ public class Team {
}
/**
- * Change the suffix of the team and sends an update packet
+ * Changes the suffix of the team and sends an update packet.
*
* @param suffix The new suffix
*/
@@ -297,9 +297,9 @@ public class Team {
}
/**
- * Change the friendly flags of the team
+ * Changes the friendly flags of the team.
*
- * Warning: This is only changed on the server side
+ * Warning: This is only changed on the server side.
*
* @param flag The new friendly flag
*/
@@ -309,7 +309,7 @@ public class Team {
}
/**
- * Change the friendly flags of the team and sends an update packet
+ * Changes the friendly flags of the team and sends an update packet.
*
* @param flag The new friendly flag
*/
@@ -319,7 +319,7 @@ public class Team {
}
/**
- * Gets the registry name of the team
+ * Gets the registry name of the team.
*
* @return the registry name
*/
@@ -328,7 +328,7 @@ public class Team {
}
/**
- * Gets the creation packet to add a team
+ * Gets the creation packet to add a team.
*
* @return the packet to add the team
*/
@@ -341,7 +341,7 @@ public class Team {
}
/**
- * Creates an destruction packet to remove the team
+ * Creates an destruction packet to remove the team.
*
* @return the packet to remove the team
*/
@@ -353,7 +353,7 @@ public class Team {
}
/**
- * Obtains an unmodifiable {@link Set} of registered players who are on the team
+ * Obtains an unmodifiable {@link Set} of registered players who are on the team.
*
* @return an unmodifiable {@link Set} of registered players
*/
@@ -362,7 +362,7 @@ public class Team {
}
/**
- * Gets the display name of the team
+ * Gets the display name of the team.
*
* @return the display name
*/
@@ -371,7 +371,7 @@ public class Team {
}
/**
- * Gets the friendly flags of the team
+ * Gets the friendly flags of the team.
*
* @return the friendly flags
*/
@@ -380,7 +380,7 @@ public class Team {
}
/**
- * Gets the tag visibility of the team
+ * Gets the tag visibility of the team.
*
* @return the tag visibility
*/
@@ -389,7 +389,7 @@ public class Team {
}
/**
- * Gets the collision rule of the team
+ * Gets the collision rule of the team.
*
* @return the collision rule
*/
@@ -398,7 +398,7 @@ public class Team {
}
/**
- * Gets the color of the team
+ * Gets the color of the team.
*
* @return the team color
*/
@@ -407,7 +407,7 @@ public class Team {
}
/**
- * Gets the prefix of the team
+ * Gets the prefix of the team.
*
* @return the team prefix
*/
@@ -416,7 +416,7 @@ public class Team {
}
/**
- * Gets the suffix of the team
+ * Gets the suffix of the team.
*
* @return the suffix team
*/
@@ -429,7 +429,7 @@ public class Team {
}
/**
- * Sends an {@link TeamsPacket.Action#UPDATE_TEAM_INFO} packet
+ * Sends an {@link TeamsPacket.Action#UPDATE_TEAM_INFO} packet.
*/
public void sendUpdatePacket() {
final TeamsPacket updatePacket = new TeamsPacket();
diff --git a/src/main/java/net/minestom/server/scoreboard/TeamBuilder.java b/src/main/java/net/minestom/server/scoreboard/TeamBuilder.java
index d27920413..828812ca4 100644
--- a/src/main/java/net/minestom/server/scoreboard/TeamBuilder.java
+++ b/src/main/java/net/minestom/server/scoreboard/TeamBuilder.java
@@ -6,7 +6,7 @@ import net.minestom.server.network.packet.server.play.TeamsPacket.CollisionRule;
import net.minestom.server.network.packet.server.play.TeamsPacket.NameTagVisibility;
/**
- * A builder which represents a fluent Object to built teams
+ * A builder which represents a fluent Object to built teams.
*/
public class TeamBuilder {
@@ -24,7 +24,7 @@ public class TeamBuilder {
private boolean updateTeam;
/**
- * Creates an team builder
+ * Creates an team builder.
*
* @param name The name of the new team
* @param teamManager The manager for the team
@@ -34,7 +34,7 @@ public class TeamBuilder {
}
/**
- * Creates an team builder
+ * Creates an team builder.
*
* @param team The new team
* @param teamManager The manager for the team
@@ -46,7 +46,7 @@ public class TeamBuilder {
}
/**
- * Updates the prefix of the {@link Team}
+ * Updates the prefix of the {@link Team}.
*
* @param prefix The new prefix
* @return this builder, for chaining
@@ -56,7 +56,7 @@ public class TeamBuilder {
}
/**
- * Updates the prefix of the {@link Team}
+ * Updates the prefix of the {@link Team}.
*
* @param prefix The new prefix
* @return this builder, for chaining
@@ -67,7 +67,7 @@ public class TeamBuilder {
}
/**
- * Updates the color of the {@link Team}
+ * Updates the color of the {@link Team}.
*
* @param color The new color
* @return this builder, for chaining
@@ -78,7 +78,7 @@ public class TeamBuilder {
}
/**
- * Updates the suffix of the {@link Team}
+ * Updates the suffix of the {@link Team}.
*
* @param suffix The new suffix
* @return this builder, for chaining
@@ -88,7 +88,7 @@ public class TeamBuilder {
}
/**
- * Updates the suffix of the {@link Team}
+ * Updates the suffix of the {@link Team}.
*
* @param suffix The new suffix
* @return this builder, for chaining
@@ -99,7 +99,7 @@ public class TeamBuilder {
}
/**
- * Updates the display name of the {@link Team}
+ * Updates the display name of the {@link Team}.
*
* @param displayName The new display name
* @return this builder, for chaining
@@ -109,7 +109,7 @@ public class TeamBuilder {
}
/**
- * Updates the display name of the {@link Team}
+ * Updates the display name of the {@link Team}.
*
* @param displayName The new display name
* @return this builder, for chaining
@@ -120,7 +120,7 @@ public class TeamBuilder {
}
/**
- * Updates the {@link CollisionRule} of the {@link Team}
+ * Updates the {@link CollisionRule} of the {@link Team}.
*
* @param rule The new rule
* @return this builder, for chaining
@@ -131,7 +131,7 @@ public class TeamBuilder {
}
/**
- * Updates the {@link NameTagVisibility} of the {@link Team}
+ * Updates the {@link NameTagVisibility} of the {@link Team}.
*
* @param visibility The new tag visibility
* @return this builder, for chaining
@@ -142,7 +142,7 @@ public class TeamBuilder {
}
/**
- * Updates the friendly flags of the {@link Team}
+ * Updates the friendly flags of the {@link Team}.
*
* @param flag The new friendly flag
* @return this builder, for chaining
@@ -153,7 +153,7 @@ public class TeamBuilder {
}
/**
- * Updates the friendly flags for allow friendly fire
+ * Updates the friendly flags for allow friendly fire.
*
* @return this builder, for chaining
*/
@@ -162,7 +162,7 @@ public class TeamBuilder {
}
/**
- * Updates the friendly flags to sees invisible players of own team
+ * Updates the friendly flags to sees invisible players of own team.
*
* @return this builder, for chaining
*/
@@ -171,9 +171,9 @@ public class TeamBuilder {
}
/**
- * Change the prefix of the {@link Team} without an update packet
+ * Changes the prefix of the {@link Team} without an update packet.
*
- * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side
+ * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side.
*
* @param prefix The new prefix
* @return this builder, for chaining
@@ -183,9 +183,9 @@ public class TeamBuilder {
}
/**
- * Change the prefix of the {@link Team} without an update packet
+ * Changes the prefix of the {@link Team} without an update packet.
*
- * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side
+ * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side.
*
* @param prefix The new prefix
* @return this builder, for chaining
@@ -196,9 +196,9 @@ public class TeamBuilder {
}
/**
- * Change the suffix of the {@link Team} without an update packet
+ * Changes the suffix of the {@link Team} without an update packet.
*
- * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side
+ * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side.
*
* @param suffix The new suffix
* @return this builder, for chaining
@@ -209,9 +209,9 @@ public class TeamBuilder {
}
/**
- * Change the suffix of the {@link Team} without an update packet
+ * Changes the suffix of the {@link Team} without an update packet.
*
- * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side
+ * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side.
*
* @param suffix The new suffix
* @return this builder, for chaining
@@ -222,9 +222,9 @@ public class TeamBuilder {
}
/**
- * Change the color of the {@link Team} without an update packet
+ * Changes the color of the {@link Team} without an update packet.
*
- * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side
+ * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side.
*
* @param color The new team color
* @return this builder, for chaining
@@ -235,9 +235,9 @@ public class TeamBuilder {
}
/**
- * Change the display name of the {@link Team} without an update packet
+ * Changes the display name of the {@link Team} without an update packet.
*
- * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side
+ * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side.
*
* @param displayName The new display name
* @return this builder, for chaining
@@ -247,9 +247,9 @@ public class TeamBuilder {
}
/**
- * Change the display name of the {@link Team} without an update packet
+ * Changes the display name of the {@link Team} without an update packet.
*
- * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side
+ * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side.
*
* @param displayName The new display name
* @return this builder, for chaining
@@ -260,9 +260,9 @@ public class TeamBuilder {
}
/**
- * Change the {@link CollisionRule} of the {@link Team} without an update packet
+ * Changes the {@link CollisionRule} of the {@link Team} without an update packet.
*
- * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side
+ * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side.
*
* @param rule The new rule
* @return this builder, for chaining
@@ -273,9 +273,9 @@ public class TeamBuilder {
}
/**
- * Change the {@link NameTagVisibility} of the {@link Team} without an update packet
+ * Changes the {@link NameTagVisibility} of the {@link Team} without an update packet.
*
- * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side
+ * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side.
*
* @param visibility The new tag visibility
* @return this builder, for chaining
@@ -286,9 +286,9 @@ public class TeamBuilder {
}
/**
- * Change the friendly flags of the {@link Team} without an update packet
+ * Changes the friendly flags of the {@link Team} without an update packet.
*
- * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side
+ * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side.
*
* @param flag The new flag
* @return this builder, for chaining
@@ -299,9 +299,9 @@ public class TeamBuilder {
}
/**
- * Change the friendly flags for allow friendly fire without an update packet
+ * Changes the friendly flags for allow friendly fire without an update packet.
*
- * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side
+ * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side.
*
* @return this builder, for chaining
*/
@@ -310,9 +310,9 @@ public class TeamBuilder {
}
/**
- * Change the friendly flags to sees invisible players of own team without an update packet
+ * Changes the friendly flags to sees invisible players of own team without an update packet.
*
- * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side
+ * Warning: If you do not call {@link #updateTeamPacket()}, this is only changed of the server side.
*
* @return this builder, for chaining
*/
@@ -321,7 +321,7 @@ public class TeamBuilder {
}
/**
- * Allows to send an update packet when the team is built
+ * Allows to send an update packet when the team is built.
*
* @return this builder, for chaining
*/
@@ -331,7 +331,7 @@ public class TeamBuilder {
}
/**
- * Built a team
+ * Built a team.
*
* @return the built team
*/
diff --git a/src/main/java/net/minestom/server/utils/inventory/PlayerInventoryUtils.java b/src/main/java/net/minestom/server/utils/inventory/PlayerInventoryUtils.java
index 61234f0c4..6c77c3f43 100644
--- a/src/main/java/net/minestom/server/utils/inventory/PlayerInventoryUtils.java
+++ b/src/main/java/net/minestom/server/utils/inventory/PlayerInventoryUtils.java
@@ -21,7 +21,7 @@ public final class PlayerInventoryUtils {
}
/**
- * Convert a packet slot to an internal one
+ * Converts a packet slot to an internal one.
*
* @param slot the packet slot
* @param offset the slot count separating the up part of the inventory to the bottom part (armor/craft in PlayerInventory, inventory slots in others)
diff --git a/src/main/java/net/minestom/server/utils/time/TimeUnit.java b/src/main/java/net/minestom/server/utils/time/TimeUnit.java
index 4ecc4248c..0b9805391 100644
--- a/src/main/java/net/minestom/server/utils/time/TimeUnit.java
+++ b/src/main/java/net/minestom/server/utils/time/TimeUnit.java
@@ -7,7 +7,7 @@ public enum TimeUnit {
TICK, DAY, HOUR, MINUTE, SECOND, MILLISECOND;
/**
- * Convert a value and its unit to milliseconds
+ * Converts a value and its unit to milliseconds.
*
* @param value the time value
* @return the converted milliseconds based on the time value and the unit