Modify the target creation methods.

This commit is contained in:
Matthew Miller 2018-08-06 19:03:08 +10:00
parent 3203a81710
commit 34efb6e40e

View File

@ -187,7 +187,8 @@ public static boolean isIntensiveEntity(Entity entity) {
*/
public static Target createTarget(Block block) {
checkNotNull(block);
return new BlockTarget(BukkitAdapter.adapt(block.getBlockData()).getBlockType());
checkNotNull(block.getType());
return new BlockTarget(BukkitAdapter.asBlockType(block.getType()));
}
/**
@ -198,7 +199,8 @@ public static Target createTarget(Block block) {
*/
public static Target createTarget(ItemStack item) {
checkNotNull(item);
return new ItemTarget(BukkitAdapter.adapt(item).getType());
checkNotNull(item.getType());
return new ItemTarget(BukkitAdapter.asItemType(item.getType()));
}
/**