package com.publicuhc.scatterlib.logic;

import org.bukkit.Location;
import org.bukkit.Material;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;

public abstract class StandardScatterLogic extends ScatterLogic {

    protected int m_maxAttempts;
    protected double m_radius;
    protected Location m_centre;
    protected List<Material> m_materials = new ArrayList<Material>();

    public StandardScatterLogic(Random random, Location centre, int maxAttempts, double radius, Material... allowedMaterials)
    {
        super(random);
        m_maxAttempts = maxAttempts;
        m_radius = radius;
        m_centre = centre;
        m_materials.addAll(Arrays.asList(allowedMaterials));
    }

    public StandardScatterLogic(Random random)
    {
        super(random);
    }

    public int getMaxAttempts()
    {
        return m_maxAttempts;
    }

    public StandardScatterLogic setMaxAttempts(int attempts)
    {
        m_maxAttempts = attempts;
        return this;
    }

    public double getRadius()
    {
        return m_radius;
    }

    public StandardScatterLogic setRadius(double radius)
    {
        m_radius = radius;
        return this;
    }

    public Location getCentre() {
        return m_centre;
    }

    public StandardScatterLogic setCentre(Location centre)
    {
        m_centre = centre;
        return this;
    }

    public List<Material> getMaterials() {
        return m_materials;
    }

    public StandardScatterLogic setMaterials(List<Material> materials)
    {
        m_materials = materials;
        return this;
    }

    public StandardScatterLogic addMaterials(Material... materials)
    {
        m_materials.addAll(Arrays.asList(materials));
        return this;
    }
}

@@ -45,27 +45,38 @@
 ort 
-org.bukkit.Location
+com.google.common.collect.Sets
 ;%0Aim
@@ -95,94 +95,46 @@
 kit.
-Material
+Location
 ;%0A
-%0A
 import 
-java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.List;
+org.bukkit.Material;%0A
 %0Aimp
@@ -147,22 +147,17 @@
 va.util.
-Random
+*
 ;%0A%0Apubli
@@ -329,19 +329,18 @@
 otected 
-Lis
+Se
 t%3CMateri
@@ -361,31 +361,23 @@
 s = 
-new ArrayList%3CMaterial%3E
+Sets.newHashSet
 ();%0A
@@ -1361,19 +1361,18 @@
  public 
-Lis
+Se
 t%3CMateri
@@ -1472,19 +1472,18 @@
 terials(
-Lis
+Se
 t%3CMateri

use a set of materials instead