mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 19:39:07 +00:00
Defaulting Language Behavior
This commit is contained in:
1 parent
326626ad8e
commit
449a10711e
3 files changed
+3
-3
No files matched your search
@@ -74,7 +74,7 @@ public class DataScript implements IScriptHandlerPacket {
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
scripts = readScript(compound.getTagList("ScriptsContainers", 10));
|
||||
this.scriptLanguage = compound.getString("ScriptLanguage");
|
||||
if (!ScriptController.Instance.languages.containsKey(scriptLanguage)) {
|
||||
if (scriptLanguage == null || scriptLanguage.isEmpty()) {
|
||||
if (!ScriptController.Instance.languages.isEmpty()) {
|
||||
this.scriptLanguage = (String) ScriptController.Instance.languages.keySet().toArray()[0];
|
||||
} else {
|
||||
|
||||
@@ -55,7 +55,7 @@ public abstract class MultiScriptHandler extends ScriptHandler implements IScrip
|
||||
* Normalize the language to a valid one if the current language is not available.
|
||||
*/
|
||||
protected void normalizeLanguage() {
|
||||
if (!ScriptController.Instance.languages.containsKey(this.scriptLanguage)) {
|
||||
if (this.scriptLanguage == null || this.scriptLanguage.isEmpty()) {
|
||||
if (!ScriptController.Instance.languages.isEmpty()) {
|
||||
this.scriptLanguage = (String) ScriptController.Instance.languages.keySet().toArray()[0];
|
||||
} else {
|
||||
|
||||
@@ -142,7 +142,7 @@ public abstract class SingleScriptHandler extends ScriptHandler {
|
||||
* Normalize the language to a valid one if the current language is not available.
|
||||
*/
|
||||
protected void normalizeLanguage() {
|
||||
if (!ScriptController.Instance.languages.containsKey(this.getLanguage())) {
|
||||
if (this.getLanguage() == null || this.getLanguage().isEmpty()) {
|
||||
if (!ScriptController.Instance.languages.isEmpty()) {
|
||||
this.setLanguage((String) ScriptController.Instance.languages.keySet().toArray()[0]);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user