Improve protection type mapping
This will return if a non-compatible type is used instead of using private.
This commit is contained in:
parent
0d8d37eb85
commit
37c7b97fe8
|
@ -162,8 +162,11 @@ public class LightweightChestProtection implements Listener {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Protection.Type type = Protection.Type.PRIVATE;
|
Protection.Type type;
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
|
case PRIVATE:
|
||||||
|
type = Protection.Type.PRIVATE;
|
||||||
|
break;
|
||||||
case PUBLIC:
|
case PUBLIC:
|
||||||
type = Protection.Type.PUBLIC;
|
type = Protection.Type.PUBLIC;
|
||||||
break;
|
break;
|
||||||
|
@ -173,8 +176,14 @@ public class LightweightChestProtection implements Listener {
|
||||||
case DISPLAY:
|
case DISPLAY:
|
||||||
try {
|
try {
|
||||||
type = Protection.Type.valueOf("DISPLAY");
|
type = Protection.Type.valueOf("DISPLAY");
|
||||||
} catch (IllegalArgumentException ignored) {}
|
} catch (IllegalArgumentException e) {
|
||||||
|
// Not supported
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
// Not supported
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Protection protection = null;
|
Protection protection = null;
|
||||||
|
|
Loading…
Reference in New Issue