mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-01 05:58:00 +01:00
Proper List#toArray array initialization
This commit is contained in:
parent
2fdebae7e5
commit
6254ec93e9
@ -135,7 +135,7 @@ public class CommandManager {
|
||||
|
||||
nodes.add(rootNode);
|
||||
|
||||
declareCommandsPacket.nodes = nodes.toArray(new DeclareCommandsPacket.Node[nodes.size()]);
|
||||
declareCommandsPacket.nodes = nodes.toArray(new DeclareCommandsPacket.Node[0]);
|
||||
declareCommandsPacket.rootIndex = nodes.size() - 1;
|
||||
|
||||
return declareCommandsPacket;
|
||||
@ -185,7 +185,7 @@ public class CommandManager {
|
||||
|
||||
nodes.add(rootNode);
|
||||
|
||||
declareCommandsPacket.nodes = nodes.toArray(new DeclareCommandsPacket.Node[nodes.size()]);
|
||||
declareCommandsPacket.nodes = nodes.toArray(new DeclareCommandsPacket.Node[0]);
|
||||
declareCommandsPacket.rootIndex = nodes.size() - 1;
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,7 @@ public class Player extends LivingEntity {
|
||||
recipesIdentifier.add(recipe.getRecipeId());
|
||||
}
|
||||
if (!recipesIdentifier.isEmpty()) {
|
||||
String[] identifiers = recipesIdentifier.toArray(new String[recipesIdentifier.size()]);
|
||||
String[] identifiers = recipesIdentifier.toArray(new String[0]);
|
||||
UnlockRecipesPacket unlockRecipesPacket = new UnlockRecipesPacket();
|
||||
unlockRecipesPacket.mode = 0;
|
||||
unlockRecipesPacket.recipesId = identifiers;
|
||||
|
@ -33,7 +33,7 @@ public class StatusListener {
|
||||
statisticList.add(statistic);
|
||||
}
|
||||
|
||||
statisticsPacket.statistics = statisticList.toArray(new StatisticsPacket.Statistic[statisticList.size()]);
|
||||
statisticsPacket.statistics = statisticList.toArray(new StatisticsPacket.Statistic[0]);
|
||||
|
||||
player.getPlayerConnection().sendPacket(statisticsPacket);
|
||||
break;
|
||||
|
@ -48,7 +48,7 @@ public class RecipeManager {
|
||||
packetRecipe.group = recipe.getGroup();
|
||||
ShapelessRecipe shapelessRecipe = (ShapelessRecipe) recipe;
|
||||
List<DeclareRecipesPacket.Ingredient> ingredients = shapelessRecipe.getIngredients();
|
||||
packetRecipe.ingredients = ingredients.toArray(new DeclareRecipesPacket.Ingredient[ingredients.size()]);
|
||||
packetRecipe.ingredients = ingredients.toArray(new DeclareRecipesPacket.Ingredient[0]);
|
||||
packetRecipe.result = shapelessRecipe.getResult();
|
||||
break;
|
||||
case SHAPED:
|
||||
@ -56,7 +56,7 @@ public class RecipeManager {
|
||||
packetRecipe.group = recipe.getGroup();
|
||||
ShapedRecipe shapedRecipe = (ShapedRecipe) recipe;
|
||||
List<DeclareRecipesPacket.Ingredient> ingredients2 = shapedRecipe.getIngredients();
|
||||
packetRecipe.ingredients = ingredients2.toArray(new DeclareRecipesPacket.Ingredient[ingredients2.size()]);
|
||||
packetRecipe.ingredients = ingredients2.toArray(new DeclareRecipesPacket.Ingredient[0]);
|
||||
packetRecipe.result = shapedRecipe.getResult();
|
||||
break;
|
||||
case SMELTING:
|
||||
@ -75,7 +75,7 @@ public class RecipeManager {
|
||||
recipesCache.add(packetRecipe);
|
||||
}
|
||||
|
||||
declareRecipesPacket.recipes = recipesCache.toArray(new DeclareRecipesPacket.Recipe[recipesCache.size()]);
|
||||
declareRecipesPacket.recipes = recipesCache.toArray(new DeclareRecipesPacket.Recipe[0]);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public class RegistryMain {
|
||||
|
||||
for (RegistryBlock.BlockState blockState : registryBlock.states) {
|
||||
short id = blockState.id;
|
||||
String[] properties = blockState.propertiesValues.toArray(new String[blockState.propertiesValues.size()]);
|
||||
String[] properties = blockState.propertiesValues.toArray(new String[0]);
|
||||
Block.BlockAlternative blockAlternative = new Block.BlockAlternative(id, properties);
|
||||
|
||||
block.addBlockAlternative(blockAlternative);
|
||||
|
Loading…
Reference in New Issue
Block a user