Problem with Holos

Discussion in 'Plugin Development' started by Dealyise, Aug 15, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Dealyise

    I got a problem with my holos. Whenever I use the method below, it will just spawn Holos on one location. But it should spawn Holos on every Location.

    Source:
    Code:java
    1. public static void reloadHolos(World world){
    2. try{
    3. for (Hologram hologram : HolographicDisplaysAPI.getHolograms(plugin)) {
    4. hologram.delete();
    5. }
    6. }catch(Exception ex){
    7. ex.printStackTrace();
    8. }
    9.  
    10.  
    11.  
    12.  
    13.  
    14. File folder = new File("plugins/System/Locations/");
    15. File[] listOfFiles = folder.listFiles();
    16. for(File file : listOfFiles){
    17.  
    18.  
    19. FileConfiguration cfg = YamlConfiguration.loadConfiguration(file);
    20. Location loc = new Location(world,cfg.getInt("Location.x"),cfg.getInt("Location.y") + 2,cfg.getInt("Location.z"));
    21. Location loc2 = new Location(world,cfg.getInt("Location.x2"),cfg.getInt("Location.y2") + 2,cfg.getInt("Location.z2"));
    22.  
    23. String type = cfg.getString("Location.type");
    24. if(type.equalsIgnoreCase("waffenladen")){
    25. HolographicDisplaysAPI.createHologram(plugin, loc, "§f[§cWaffenladen§f]", "Drücke Q, um den Laden zu betreten");
    26. HolographicDisplaysAPI.createHologram(plugin, loc2, "Drücke Q, um den Laden zu verlassen");
    27.  
    28. }else if(type.equalsIgnoreCase("tankstelle")){
    29.  
    30. HolographicDisplaysAPI.createHologram(plugin, loc, "§f[§aTankstelle§f]", "Drücke Q, um den Laden zu betreten");
    31. HolographicDisplaysAPI.createHologram(plugin, loc2, "Drücke Q, um den Laden zu verlassen");
    32.  
    33. }else if(type.equalsIgnoreCase("laden")){
    34. HolographicDisplaysAPI.createHologram(plugin, loc, "§f[§eZoneShop§f]", "Drücke Q, um den Laden zu betreten");
    35. HolographicDisplaysAPI.createHologram(plugin, loc2, "Drücke Q, um den Laden zu verlassen");
    36.  
    37. }else if(type.equalsIgnoreCase("burgerlord")){
    38. HolographicDisplaysAPI.createHologram(plugin, loc, "§f[§bBurger Lord§f]", "Drücke Q, um den Laden zu betreten");
    39. HolographicDisplaysAPI.createHologram(plugin, loc2, "Drücke Q, um den Laden zu verlassen");
    40.  
    41. }else{
    42.  
    43. }
    44.  
    45.  
    46. }
    47.  
    48.  
    49.  
    50.  
    51.  
    52.  
    53.  
    54. }


    Any idea?
     
  2. Offline

    fireblast709

    Dealyise start by debugging the for loop / type.
     
  3. Offline

    Dealyise

Thread Status:
Not open for further replies.

Share This Page