mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-09-24 20:42:46 +02:00
[CI-SKIP] Fix some formatting inconsistencies
Remove spaces on empty lines and changed doc comment formatting Also includes some minor comments and import fixes
This commit is contained in:
parent
b3e62f199f
commit
036d309965
@ -206,8 +206,7 @@ public class InventoryUtil {
|
||||
}
|
||||
|
||||
// Don't use the armor slots or extra slots
|
||||
private static int effectiveSize(Inventory inventory)
|
||||
{
|
||||
private static int effectiveSize(Inventory inventory) {
|
||||
return getStorageContents(inventory).length;
|
||||
}
|
||||
|
||||
@ -333,6 +332,7 @@ public class InventoryUtil {
|
||||
|
||||
/**
|
||||
* Get the max size an item stack is allowed to stack to while respecting the STACK_TO_64 config property
|
||||
*
|
||||
* @param item The item to get the max stacksize of
|
||||
* @return The max stacksize of the item stack's type or 64 if STACK_TO_64 is enabled
|
||||
*/
|
||||
@ -342,6 +342,7 @@ public class InventoryUtil {
|
||||
|
||||
/**
|
||||
* Get an array of different item stacks that are properly stacked to their max stack size
|
||||
*
|
||||
* @param items The items to stack
|
||||
* @return An array of item stacks which's amount is a maximum of the allowed stack size
|
||||
*/
|
||||
|
@ -202,6 +202,7 @@ public class MaterialUtil {
|
||||
|
||||
/**
|
||||
* Get an item name shortened to a max length that is still reversable by {@link #getMaterial(String)}
|
||||
*
|
||||
* @param itemName The name of the item
|
||||
* @param maxLength The max length
|
||||
* @return The name shortened to the max length
|
||||
@ -552,7 +553,8 @@ public class MaterialUtil {
|
||||
if (!aliases.isEmpty()) {
|
||||
return aliases.iterator().next();
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -78,6 +78,6 @@ public class Messages {
|
||||
public static String TOGGLE_MESSAGES_ON = "You will now receive messages from your shop(s).";
|
||||
|
||||
public static String prefix(String message) {
|
||||
return Configuration.getColoured( prefix + message);
|
||||
return Configuration.getColoured(prefix + message);
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,11 @@ import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.material.Directional;
|
||||
import org.bukkit.material.PistonBaseMaterial;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
import java.util.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.Acrobot.Breeze.Utils.BlockUtil.getAttachedBlock;
|
||||
import static com.Acrobot.Breeze.Utils.BlockUtil.isSign;
|
||||
|
@ -46,8 +46,7 @@ import static org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK;
|
||||
public class PlayerInteract implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||
public static void onInteract(PlayerInteractEvent event)
|
||||
{
|
||||
public static void onInteract(PlayerInteractEvent event) {
|
||||
Block block = event.getClickedBlock();
|
||||
if (block == null)
|
||||
return;
|
||||
@ -148,7 +147,7 @@ public class PlayerInteract implements Listener {
|
||||
boolean adminShop = ChestShopSign.isAdminShop(sign);
|
||||
|
||||
// check if player exists in economy
|
||||
if(!adminShop && !VaultListener.getProvider().hasAccount(account.getName())) {
|
||||
if (!adminShop && !VaultListener.getProvider().hasAccount(account.getName())) {
|
||||
player.sendMessage(Messages.prefix(Messages.NO_ECONOMY_ACCOUNT));
|
||||
return null;
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ public class NameManager {
|
||||
|
||||
/**
|
||||
* Get account info from a UUID
|
||||
*
|
||||
* @param uuid The UUID of the player to get the account info
|
||||
* @return The account info or <tt>null</tt> if none was found
|
||||
*/
|
||||
@ -49,7 +50,7 @@ public class NameManager {
|
||||
try {
|
||||
Account account = accounts.queryBuilder().orderBy("lastSeen", false).where().eq("uuid", uuid).queryForFirst();
|
||||
if (account != null) {
|
||||
account.setUuid(uuid); //HOW IS IT EVEN POSSIBLE THAT UUID IS NOT SET EVEN IF WE HAVE FOUND THE PLAYER?!
|
||||
account.setUuid(uuid); // HOW IS IT EVEN POSSIBLE THAT UUID IS NOT SET EVEN IF WE HAVE FOUND THE PLAYER?!
|
||||
shortToAccount.put(account.getShortName(), account);
|
||||
usernameToAccount.put(account.getName(), account);
|
||||
return account;
|
||||
@ -66,6 +67,7 @@ public class NameManager {
|
||||
|
||||
/**
|
||||
* Get account info from a non-shortened username
|
||||
*
|
||||
* @param fullName The full name of the player to get the account info
|
||||
* @return The account info or <tt>null</tt> if none was found
|
||||
* @throws IllegalArgumentException if the username is empty or null
|
||||
@ -77,7 +79,7 @@ public class NameManager {
|
||||
try {
|
||||
Account account = accounts.queryBuilder().orderBy("lastSeen", false).where().eq("name", fullName).queryForFirst();
|
||||
if (account != null) {
|
||||
account.setName(fullName); //HOW IS IT EVEN POSSIBLE THAT UUID IS NOT SET EVEN IF WE HAVE FOUND THE PLAYER?!
|
||||
account.setName(fullName); // HOW IS IT EVEN POSSIBLE THAT THE NAME IS NOT SET EVEN IF WE HAVE FOUND THE PLAYER?!
|
||||
shortToAccount.put(account.getShortName(), account);
|
||||
return account;
|
||||
}
|
||||
@ -93,6 +95,7 @@ public class NameManager {
|
||||
|
||||
/**
|
||||
* Get account info from a username that might be shortened
|
||||
*
|
||||
* @param shortName The name of the player to get the account info
|
||||
* @return The account info or <tt>null</tt> if none was found
|
||||
* @throws IllegalArgumentException if the username is empty
|
||||
@ -108,7 +111,7 @@ public class NameManager {
|
||||
try {
|
||||
Account account = accounts.queryBuilder().where().eq("shortName", shortName).queryForFirst();
|
||||
if (account != null) {
|
||||
account.setShortName(shortName); //HOW IS IT EVEN POSSIBLE THAT UUID IS NOT SET EVEN IF WE HAVE FOUND THE PLAYER?!
|
||||
account.setShortName(shortName); // HOW IS IT EVEN POSSIBLE THAT THE NAME IS NOT SET EVEN IF WE HAVE FOUND THE PLAYER?!
|
||||
return account;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
@ -123,6 +126,7 @@ public class NameManager {
|
||||
|
||||
/**
|
||||
* Get the information from the last time a player logged in that previously used the shortened name
|
||||
*
|
||||
* @param shortName The name of the player to get the last account for
|
||||
* @return The last account or <tt>null</tt> if none was found
|
||||
* @throws IllegalArgumentException if the username is not a shortened name and longer than 15 chars
|
||||
@ -137,6 +141,7 @@ public class NameManager {
|
||||
|
||||
/**
|
||||
* Get the UUID from a player's (non-shortened) username
|
||||
*
|
||||
* @param username The player's username
|
||||
* @return The UUID or <tt>null</tt> if the UUID can't be found or an error occurred
|
||||
* @deprecated Use {@link NameManager#getAccount(String)}
|
||||
@ -161,6 +166,7 @@ public class NameManager {
|
||||
|
||||
/**
|
||||
* Get the username from a player's UUID
|
||||
*
|
||||
* @param uuid The UUID of the player
|
||||
* @return The username that is stored or <tt>null</tt> if none was found
|
||||
* @deprecated Use {@link NameManager#getAccount(UUID)}
|
||||
@ -184,6 +190,7 @@ public class NameManager {
|
||||
|
||||
/**
|
||||
* Get the full username from another username that might be shortened
|
||||
*
|
||||
* @param shortName The name of the player to get the full username for
|
||||
* @return The full username or <tt>null</tt> if none was found
|
||||
* @throws IllegalArgumentException if the username is not a shortened name and longer than 15 chars
|
||||
@ -200,6 +207,7 @@ public class NameManager {
|
||||
|
||||
/**
|
||||
* Get the short username from a full username
|
||||
*
|
||||
* @param fullName The name of the player to get the short username for
|
||||
* @return The short username or <tt>null</tt> if none was found
|
||||
* @deprecated Use {@link NameManager#getAccount(String)}
|
||||
@ -212,6 +220,7 @@ public class NameManager {
|
||||
|
||||
/**
|
||||
* Store the username of a player into the database and the username-uuid cache
|
||||
*
|
||||
* @param player The data transfer object of the player to store
|
||||
*/
|
||||
public static void storeUsername(final PlayerDTO player) {
|
||||
@ -243,6 +252,7 @@ public class NameManager {
|
||||
|
||||
/**
|
||||
* Get a new unique shortened name that hasn't been used by another player yet
|
||||
*
|
||||
* @param player The player data to get the shortened name for
|
||||
* @return A new shortened name that hasn't been used before and is a maximum of 15 chars long
|
||||
*/
|
||||
|
@ -63,7 +63,7 @@ public class uBlock {
|
||||
}
|
||||
|
||||
private static Chest findConnectedChest(Block block, BlockFace signFace) {
|
||||
if (signFace != null ) {
|
||||
if (signFace != null) {
|
||||
Block faceBlock = block.getRelative(signFace);
|
||||
if (BlockUtil.isChest(faceBlock)) {
|
||||
return (Chest) faceBlock.getState();
|
||||
|
Loading…
Reference in New Issue
Block a user