Return null if the material is null.

Dieser Commit ist enthalten in:
Matthew Miller 2018-10-04 20:29:40 +10:00
Ursprung 7961fa5891
Commit 79a4121098

Datei anzeigen

@ -38,8 +38,11 @@ public class BukkitBlockRegistry extends BundledBlockRegistry {
@Nullable @Nullable
@Override @Override
public BlockMaterial getMaterial(BlockType blockType) { public BlockMaterial getMaterial(BlockType blockType) {
return materialMap.computeIfAbsent(BukkitAdapter.adapt(blockType), Material mat = BukkitAdapter.adapt(blockType);
material -> new BukkitBlockMaterial(BukkitBlockRegistry.super.getMaterial(blockType), material)); if (mat == null) {
return null;
}
return materialMap.computeIfAbsent(mat, material -> new BukkitBlockMaterial(BukkitBlockRegistry.super.getMaterial(blockType), material));
} }
@Nullable @Nullable