1.14.4 Material Type?

Discussion in 'Spigot Plugin Development' started by DevSnx, Feb 12, 2020.

  1. Hello guys,

    i will add Plugin support for 1.8-1.15 and i have a problem with my itemstacks...

    my config:
    Code (Text):
    SURVIVALGAMES:
      CHEST:
        ITEMS:
        - WOODEN_SWORD, 1, 60
        - IRON_SWORD, 1, 25
        - GOLDEN_SWORD, 1, 35
      ENDERCHEST:
        ITEMS:
        - DIAMOND_AXE, 1, 35
        - DIAMOND_SWORD, 1, 25
        - GOLDEN_APPLE, 1, 10
     
    and now i will get the Items for 1.8 and 1.14 or 1.15?

    My try :D

    Code (Java):
            for(String all : SurvivalGames.getFileManager().getChestFile().getConfig().getStringList("SURVIVALGAMES.CHEST.ITEMS")){
                String material = "";
                int amount = 0;
                int chance = 0;

                String[] array = all.split(", ");
                material = String.valueOf(array[0]);
                amount = Integer.valueOf(array[1]);
                chance = Integer.valueOf(array[2]);

                for(int i = 0; i < chance; i++){
                    items_tier1.add(new ItemStack(Material.valueOf(material), amount));
                }
            }
     
  2. XSeries are just wonderfull