mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-11-27 12:35:12 +01:00
Fix npe in getMaterial on older versions
This commit is contained in:
parent
64e54fccf1
commit
a20ccf0c1e
@ -1356,10 +1356,10 @@ public enum CompatibleMaterial {
|
||||
if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_13)) { // Flattening
|
||||
return CompatibleMaterial.getMaterialFromNewBlock(block);
|
||||
} else { // Pre-Flattening
|
||||
if(block != null){
|
||||
if(block != null) {
|
||||
if (block.getData() != 0) {
|
||||
for (CompatibleMaterial cm : CompatibleMaterial.values()) {
|
||||
if (cm.getMaterial().equals(block.getType())) {
|
||||
if (cm.isValidItem() && !cm.usesCompatibility() && cm.getMaterial() != null && cm.getMaterial().equals(block.getType())) {
|
||||
if (cm.getData() == block.getData()) {
|
||||
return cm;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user