Ceci est mon code de recherche:changement Spigot teinté de couleur d'argile
for(int x = -100; x < 100; x ++)
{
for(int z = -100; z < 100; z ++)
{
for(int y = 0; y < 50; y ++)
{
Location loc = new Location(Bukkit.getWorld(map_name), x, y, z);
Block block = loc.getBlock();
if(block.getType()
.equals(ConstantsManager.ground_material))
{
if(block.getType().getData()
.equals(ConstantsManager.ground_redId))
orig_redClay.add(block);
if(block.getType().getData()
.equals(ConstantsManager.ground_blueId))
orig_blueClay.add(block);
}
}
}
}
Dans la ConstantsManager classe statique
public static final Material ground_material = Material.STAINED_CLAY;
public static final int ground_blueId = 3;
public static final int ground_redId = 14;
Il est censé chercher dans le volume 100 * 50 * 100 pour le rouge ou bleu argile tachée, en appelant ConstantsManager pour les valeurs matérielles et de couleur. Le code est capable de détecter si le bloc est en argile ou non, mais n'est pas capable de détecter s'il est rouge ou bleu. Que puis-je changer dans mon code pour détecter les couleurs de l'argile?
qu'est-ce que getData() retour? –