mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Code style, remove deprecated ChatMode
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
e6db47ec6e
commit
3ddf729a46
@ -1279,8 +1279,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
*
|
*
|
||||||
* @return the player settings
|
* @return the player settings
|
||||||
*/
|
*/
|
||||||
@NotNull
|
public @NotNull PlayerSettings getSettings() {
|
||||||
public PlayerSettings getSettings() {
|
|
||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1293,8 +1292,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
return dimensionType;
|
return dimensionType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
public @NotNull PlayerInventory getInventory() {
|
||||||
public PlayerInventory getInventory() {
|
|
||||||
return inventory;
|
return inventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1441,8 +1439,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
*
|
*
|
||||||
* @return the currently open inventory, null if there is not (player inventory is not detected)
|
* @return the currently open inventory, null if there is not (player inventory is not detected)
|
||||||
*/
|
*/
|
||||||
@Nullable
|
public @Nullable Inventory getOpenInventory() {
|
||||||
public Inventory getOpenInventory() {
|
|
||||||
return openInventory;
|
return openInventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1453,7 +1450,6 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
* @return true if the inventory has been opened/sent to the player, false otherwise (cancelled by event)
|
* @return true if the inventory has been opened/sent to the player, false otherwise (cancelled by event)
|
||||||
*/
|
*/
|
||||||
public boolean openInventory(@NotNull Inventory inventory) {
|
public boolean openInventory(@NotNull Inventory inventory) {
|
||||||
|
|
||||||
InventoryOpenEvent inventoryOpenEvent = new InventoryOpenEvent(inventory, this);
|
InventoryOpenEvent inventoryOpenEvent = new InventoryOpenEvent(inventory, this);
|
||||||
|
|
||||||
EventDispatcher.callCancellable(inventoryOpenEvent, () -> {
|
EventDispatcher.callCancellable(inventoryOpenEvent, () -> {
|
||||||
@ -1463,7 +1459,6 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Inventory newInventory = inventoryOpenEvent.getInventory();
|
Inventory newInventory = inventoryOpenEvent.getInventory();
|
||||||
|
|
||||||
if (newInventory == null) {
|
if (newInventory == null) {
|
||||||
// just close the inventory
|
// just close the inventory
|
||||||
return;
|
return;
|
||||||
@ -1475,9 +1470,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
playerConnection.sendPacket(openWindowPacket);
|
playerConnection.sendPacket(openWindowPacket);
|
||||||
newInventory.addViewer(this);
|
newInventory.addViewer(this);
|
||||||
this.openInventory = newInventory;
|
this.openInventory = newInventory;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return !inventoryOpenEvent.isCancelled();
|
return !inventoryOpenEvent.isCancelled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1936,8 +1929,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
*
|
*
|
||||||
* @return a {@link PlayerInfoPacket} to add the player
|
* @return a {@link PlayerInfoPacket} to add the player
|
||||||
*/
|
*/
|
||||||
@NotNull
|
protected @NotNull PlayerInfoPacket getAddPlayerToList() {
|
||||||
protected PlayerInfoPacket getAddPlayerToList() {
|
|
||||||
PlayerInfoPacket playerInfoPacket = new PlayerInfoPacket(PlayerInfoPacket.Action.ADD_PLAYER);
|
PlayerInfoPacket playerInfoPacket = new PlayerInfoPacket(PlayerInfoPacket.Action.ADD_PLAYER);
|
||||||
|
|
||||||
PlayerInfoPacket.AddPlayer addPlayer =
|
PlayerInfoPacket.AddPlayer addPlayer =
|
||||||
@ -1963,14 +1955,9 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
*
|
*
|
||||||
* @return a {@link PlayerInfoPacket} to remove the player
|
* @return a {@link PlayerInfoPacket} to remove the player
|
||||||
*/
|
*/
|
||||||
@NotNull
|
protected @NotNull PlayerInfoPacket getRemovePlayerToList() {
|
||||||
protected PlayerInfoPacket getRemovePlayerToList() {
|
|
||||||
PlayerInfoPacket playerInfoPacket = new PlayerInfoPacket(PlayerInfoPacket.Action.REMOVE_PLAYER);
|
PlayerInfoPacket playerInfoPacket = new PlayerInfoPacket(PlayerInfoPacket.Action.REMOVE_PLAYER);
|
||||||
|
playerInfoPacket.playerInfos.add(new PlayerInfoPacket.RemovePlayer(getUuid()));
|
||||||
PlayerInfoPacket.RemovePlayer removePlayer =
|
|
||||||
new PlayerInfoPacket.RemovePlayer(getUuid());
|
|
||||||
|
|
||||||
playerInfoPacket.playerInfos.add(removePlayer);
|
|
||||||
return playerInfoPacket;
|
return playerInfoPacket;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1998,9 +1985,8 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
connection.sendPacket(new EntityHeadLookPacket(getEntityId(), position.yaw()));
|
connection.sendPacket(new EntityHeadLookPacket(getEntityId(), position.yaw()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getItemInMainHand() {
|
public @NotNull ItemStack getItemInMainHand() {
|
||||||
return inventory.getItemInMainHand();
|
return inventory.getItemInMainHand();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2009,9 +1995,8 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
inventory.setItemInMainHand(itemStack);
|
inventory.setItemInMainHand(itemStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getItemInOffHand() {
|
public @NotNull ItemStack getItemInOffHand() {
|
||||||
return inventory.getItemInOffHand();
|
return inventory.getItemInOffHand();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2020,9 +2005,8 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
inventory.setItemInOffHand(itemStack);
|
inventory.setItemInOffHand(itemStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getHelmet() {
|
public @NotNull ItemStack getHelmet() {
|
||||||
return inventory.getHelmet();
|
return inventory.getHelmet();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2031,9 +2015,8 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
inventory.setHelmet(itemStack);
|
inventory.setHelmet(itemStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getChestplate() {
|
public @NotNull ItemStack getChestplate() {
|
||||||
return inventory.getChestplate();
|
return inventory.getChestplate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2042,9 +2025,8 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
inventory.setChestplate(itemStack);
|
inventory.setChestplate(itemStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getLeggings() {
|
public @NotNull ItemStack getLeggings() {
|
||||||
return inventory.getLeggings();
|
return inventory.getLeggings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2053,9 +2035,8 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
inventory.setLeggings(itemStack);
|
inventory.setLeggings(itemStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getBoots() {
|
public @NotNull ItemStack getBoots() {
|
||||||
return inventory.getBoots();
|
return inventory.getBoots();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2132,16 +2113,6 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
RIGHT
|
RIGHT
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated See {@link ChatMessageType}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public enum ChatMode {
|
|
||||||
ENABLED,
|
|
||||||
COMMANDS_ONLY,
|
|
||||||
HIDDEN
|
|
||||||
}
|
|
||||||
|
|
||||||
public class PlayerSettings {
|
public class PlayerSettings {
|
||||||
|
|
||||||
private String locale;
|
private String locale;
|
||||||
@ -2173,17 +2144,6 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
return viewDistance;
|
return viewDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the player chat mode.
|
|
||||||
*
|
|
||||||
* @return the player chat mode
|
|
||||||
* @deprecated Use {@link #getChatMessageType()}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public ChatMode getChatMode() {
|
|
||||||
return ChatMode.values()[chatMessageType.ordinal()];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the messages this player wants to receive.
|
* Gets the messages this player wants to receive.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user