Try to update NoCraft

Discussion in 'Plugin Development' started by alexspy, Jul 12, 2011.

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

    alexspy

    Hi guy! help please
    Code:
        int g = 0;
        forbidden = new HashSet<Integer>(list);
        Iterator<?> itr = CraftingManager.a().b().iterator();
        while (itr.hasNext()) {
            Object o = itr.next();
            if (o instanceof ShapedRecipes) {
                if (forbidden.contains(((ShapedRecipes) o).a)) {
                    itr.remove();
                    ++g;
                }
            } else if (o instanceof ShapelessRecipes) {
                if (forbidden.contains(((ShapelessRecipes) o).b().id)) {
                    itr.remove();
                    ++g;
                }
            }
        }
    The method a() is undefined for the type CraftingManager
     
  2. Offline

    Bruno Lanevik

    Code:
        int g = 0;
        forbidden = new HashSet<Integer>(list);
        Iterator<?> itr = CraftingManager.a().b().iterator();
        while (itr.hasNext()) {
            Object o = itr.next();
            if (o instanceof ShapedRecipes) {
                if (forbidden.contains(((ShapedRecipes) o).a)) {
                    itr.remove();
                    ++g;
                }
            } else if (o instanceof ShapelessRecipes) {
                if (forbidden.contains(((ShapelessRecipes) o).b().id)) {
                    itr.remove();
                    ++g;
                }
            }
        }
    It's way easier to read if you use indetation.
     
  3. Offline

    Hretsam

    What exactly are you trying to do?
    Remove the possibility to craft things?
     
  4. Offline

    alexspy

  5. Offline

    nisovin

    Change the a() to getInstance().
     
  6. Offline

    alexspy

    thx nisovin
     
Thread Status:
Not open for further replies.

Share This Page