Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 13:00:06 +01:00
SPIGOT-2481: Implement EnchantmentTarget.BREAKABLE
Dieser Commit ist enthalten in:
Ursprung
e3b4dd3d9a
Commit
9c02c12179
@ -47,6 +47,8 @@ public class CraftEnchantment extends Enchantment {
|
||||
return EnchantmentTarget.BOW;
|
||||
case FISHING_ROD:
|
||||
return EnchantmentTarget.FISHING_ROD;
|
||||
case BREAKABLE:
|
||||
return EnchantmentTarget.BREAKABLE;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import java.util.Map;
|
||||
import net.minecraft.server.Block;
|
||||
import net.minecraft.server.Blocks;
|
||||
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
|
||||
@RunWith(Parameterized.class)
|
||||
public class PerMaterialTest extends AbstractTestingBase {
|
||||
@ -146,4 +147,13 @@ public class PerMaterialTest extends AbstractTestingBase {
|
||||
assertFalse(material.hasGravity());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void usesDurability() {
|
||||
if (!material.isBlock()) {
|
||||
assertThat(EnchantmentTarget.BREAKABLE.includes(material), is(CraftMagicNumbers.getItem(material).usesDurability()));
|
||||
} else {
|
||||
assertFalse(EnchantmentTarget.BREAKABLE.includes(material));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren