Fix ISFUEL/ISHEATABLE toString no longer working
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
This commit is contained in:
1 parent
348701b5dd
commit
281c79a8e6
2 files changed
+15
-1
No files matched your search
@@ -1,5 +1,7 @@
|
||||
package com.bergerkiller.bukkit.common;
|
||||
|
||||
import com.bergerkiller.bukkit.common.internal.CommonCapabilities;
|
||||
import com.bergerkiller.bukkit.common.utils.MaterialUtil;
|
||||
import org.bukkit.Material;
|
||||
|
||||
import java.util.*;
|
||||
@@ -18,11 +20,17 @@ public abstract class MaterialBooleanProperty extends MaterialProperty<Boolean>
|
||||
*/
|
||||
public Collection<Material> getMaterials() {
|
||||
List<Material> mats = new ArrayList<Material>(20);
|
||||
for (Material mat : mats) {
|
||||
for (Material mat : MaterialUtil.getAllMaterials()) {
|
||||
// Only include 1.13+ material names on 1.13+, exclude LEGACY_
|
||||
if (CommonCapabilities.MATERIAL_ENUM_CHANGES && MaterialUtil.isLegacyType(mat)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Boolean.TRUE.equals(get(mat))) {
|
||||
mats.add(mat);
|
||||
}
|
||||
}
|
||||
|
||||
return Collections.unmodifiableCollection(mats);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,12 @@ import com.bergerkiller.bukkit.common.utils.RecipeUtil;
|
||||
|
||||
public class RecipeTest {
|
||||
|
||||
@Test
|
||||
public void testFurnaceHeatablesAndFuels() {
|
||||
assertTrue(MaterialUtil.ISFUEL.toString().length() > 100);
|
||||
assertTrue(MaterialUtil.ISHEATABLE.toString().length() > 100);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFireworkRecipe() {
|
||||
Material fireworkType = MaterialUtil.getFirst("FIREWORK_ROCKET", "LEGACY_FIREWORK");
|
||||
|
||||
Reference in new issue
Block a user