mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 17:57:34 +01:00
#955: Add test for BlockData class of Material
By: BlackHole <black-hole@live.com>
This commit is contained in:
parent
0e36e68e8b
commit
e3c01e2bf0
@ -20,12 +20,14 @@ import net.minecraft.world.level.block.entity.TileEntityFurnace;
|
||||
import net.minecraft.world.level.block.state.BlockBase;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.craftbukkit.CraftEquipmentSlot;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||
import org.bukkit.enchantments.EnchantmentTarget;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.bukkit.support.AbstractTestingBase;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
@ -273,4 +275,15 @@ public class PerMaterialTest extends AbstractTestingBase {
|
||||
assertThat(material.getEquipmentSlot(), is(expected));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBlockDataClass() {
|
||||
if (material.isBlock()) {
|
||||
Class<?> expectedClass = material.data;
|
||||
if (expectedClass != MaterialData.class) {
|
||||
BlockData blockData = Bukkit.createBlockData(material);
|
||||
assertTrue(expectedClass + " <> " + blockData.getClass(), expectedClass.isInstance(blockData));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user