mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-05-20 17:39:51 +08:00
@@ -14,11 +14,10 @@ public final class DropType {
|
||||
|
||||
public DropType(String value) {
|
||||
this.raw = value;
|
||||
this.value =
|
||||
switch (value) {
|
||||
default -> Integer.parseInt(value);
|
||||
case "ForceDrop" -> 2;
|
||||
};
|
||||
this.value = switch (value) {
|
||||
default -> Integer.parseInt(value);
|
||||
case "ForceDrop" -> 2;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,7 +31,8 @@ public final class DropType {
|
||||
* @return The drop type value as a string.
|
||||
*/
|
||||
public String getAsString() {
|
||||
if (this.raw instanceof String) return (String) this.raw;
|
||||
if (this.raw instanceof String)
|
||||
return (String) this.raw;
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@@ -40,7 +40,8 @@ public final class DropType {
|
||||
* @return The drop type value as an integer.
|
||||
*/
|
||||
public int getAsInt() {
|
||||
if (this.raw instanceof Integer) return (int) this.raw;
|
||||
if (this.raw instanceof Integer)
|
||||
return (int) this.raw;
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user