-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to configure specific JEI plugins to run on main thread
- Loading branch information
Showing
6 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
Common/src/main/java/mezz/jei/common/config/file/serializers/StringSerializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package mezz.jei.common.config.file.serializers; | ||
|
||
import mezz.jei.api.runtime.config.IJeiConfigValueSerializer; | ||
|
||
import java.util.Collection; | ||
import java.util.Optional; | ||
|
||
public class StringSerializer implements IJeiConfigValueSerializer<String> { | ||
@Override | ||
public String serialize(String value) { | ||
return value; | ||
} | ||
|
||
@Override | ||
public IDeserializeResult<String> deserialize(String string) { | ||
string = string.trim(); | ||
if (string.startsWith("\"") && string.endsWith("\"")) { | ||
string = string.substring(1, string.length() - 1); | ||
}; | ||
return new DeserializeResult<>(string); | ||
} | ||
|
||
@Override | ||
public boolean isValid(String value) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public Optional<Collection<String>> getAllValidValues() { | ||
return Optional.empty(); | ||
} | ||
|
||
@Override | ||
public String getValidValuesDescription() { | ||
return ""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters