mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 20:50:41 +01:00
Fix javac workaround in ItemStackTest
This commit is contained in:
parent
9ba5c79c30
commit
71a6a56572
1 changed files with 10 additions and 13 deletions
|
@ -316,20 +316,17 @@ public class ItemStackTest extends AbstractTestingBase {
|
||||||
static final Material[] COMPOUND_MATERIALS;
|
static final Material[] COMPOUND_MATERIALS;
|
||||||
static final int NAME_PARAMETER = 2;
|
static final int NAME_PARAMETER = 2;
|
||||||
static {
|
static {
|
||||||
COMPOUND_MATERIALS = new Object() { // Workaround for JDK5
|
final ItemFactory factory = CraftItemFactory.instance();
|
||||||
Material[] value() {
|
final Map<Class<? extends ItemMeta>, Material> possibleMaterials = new HashMap<Class<? extends ItemMeta>, Material>();
|
||||||
final ItemFactory factory = CraftItemFactory.instance();
|
ItemMeta meta;
|
||||||
final Map<Class<? extends ItemMeta>, Material> possibleMaterials = new HashMap<Class<? extends ItemMeta>, Material>();
|
for (final Material material : Material.values()) {
|
||||||
for (final Material material : Material.values()) {
|
meta = factory.getItemMeta(material);
|
||||||
final ItemMeta meta = factory.getItemMeta(material);
|
if (meta == null || possibleMaterials.containsKey(meta.getClass()))
|
||||||
if (meta == null || possibleMaterials.containsKey(meta.getClass()))
|
continue;
|
||||||
continue;
|
possibleMaterials.put(meta.getClass(), material);
|
||||||
possibleMaterials.put(meta.getClass(), material);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return possibleMaterials.values().toArray(new Material[possibleMaterials.size()]);
|
COMPOUND_MATERIALS = possibleMaterials.values().toArray(new Material[possibleMaterials.size()]);
|
||||||
}
|
|
||||||
}.value();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Parameter(0) public StackProvider provider;
|
@Parameter(0) public StackProvider provider;
|
||||||
|
|
Loading…
Reference in a new issue