From 0321c67231a798962e5d868e84d8affe0e1d6ed5 Mon Sep 17 00:00:00 2001 From: Defective4 Date: Tue, 4 Apr 2023 18:47:19 +0200 Subject: [PATCH 01/14] Prepare for 1.12.0 --- Changes | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Changes b/Changes index 9730a8f..6083e9b 100644 --- a/Changes +++ b/Changes @@ -1,12 +1,2 @@ AMCC Change Log -v1.11.0 - -[+] Added: - - Microsoft authentication! (finally) - Microsoft authentication is now fully supported on versions 1.8-1.18.x - - Packet analyzer is now DISABLED by default - - Missing translation keys - -[+] Fixed: - - Improved color formatting - - Performance improvements \ No newline at end of file +v1.12.0 \ No newline at end of file From e2719579e9ffef16b33ad15df7677d758fd91caa Mon Sep 17 00:00:00 2001 From: Defective4 Date: Mon, 17 Apr 2023 17:38:48 +0200 Subject: [PATCH 02/14] Added Intellij project icon - Migration to IDEA --- .gitignore | 8 +++++++ .idea/icon.svg | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ logo.svg | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 .idea/icon.svg create mode 100644 logo.svg diff --git a/.gitignore b/.gitignore index 31390c2..877ea24 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,11 @@ pmd.html # Ignore Gradle build output directory build +/.idea/compiler.xml +/.idea/dictionaries +/.idea/discord.xml +/.idea/encodings.xml +/.idea/jarRepositories.xml +/.idea/misc.xml +/.idea/vcs.xml +/.idea/workspace.xml diff --git a/.idea/icon.svg b/.idea/icon.svg new file mode 100644 index 0000000..b5b5a4b --- /dev/null +++ b/.idea/icon.svg @@ -0,0 +1,64 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/logo.svg b/logo.svg new file mode 100644 index 0000000..b5b5a4b --- /dev/null +++ b/logo.svg @@ -0,0 +1,64 @@ + + + + + + + + image/svg+xml + + + + + + + + + From 3142cb61ea76b031b6fffc8e726bdd2167e5f5c5 Mon Sep 17 00:00:00 2001 From: Defective4 Date: Mon, 17 Apr 2023 20:50:34 +0200 Subject: [PATCH 03/14] Deprecated TheAltening authentication --- .../src/main/java/net/defekt/mc/chatclient/ui/Main.java | 4 ++-- .../java/net/defekt/mc/chatclient/protocol/AuthType.java | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/amcc-app/src/main/java/net/defekt/mc/chatclient/ui/Main.java b/amcc-app/src/main/java/net/defekt/mc/chatclient/ui/Main.java index 082b0ec..01d8e15 100644 --- a/amcc-app/src/main/java/net/defekt/mc/chatclient/ui/Main.java +++ b/amcc-app/src/main/java/net/defekt/mc/chatclient/ui/Main.java @@ -955,7 +955,7 @@ public void actionPerformed(final ActionEvent e) { final JTabbedPane userTabs = new JTabbedPane(); final JVBoxPanel box = new JVBoxPanel(); - final JComboBox authType = new JComboBox(AuthType.values()); + final JComboBox authType = new JComboBox(AuthType.valuesX()); box.add(new JLabel(Messages.getString("Main.selectAuthType") + ":") { { @@ -1185,7 +1185,7 @@ public void actionPerformed(final ActionEvent e) { ex.printStackTrace(); } } - if (((AuthType) authType.getSelectedItem()) != AuthType.TheAltening && !up.isUsernameAlertSeen() + if (!up.isUsernameAlertSeen() && !uname.replaceAll("[^a-zA-Z0-9]", "").equals(uname)) { SwingUtils.playAsterisk(); final int alResp = JOptionPane.showOptionDialog(win, diff --git a/amcc-protocol/src/main/java/net/defekt/mc/chatclient/protocol/AuthType.java b/amcc-protocol/src/main/java/net/defekt/mc/chatclient/protocol/AuthType.java index 40d805f..5787b29 100644 --- a/amcc-protocol/src/main/java/net/defekt/mc/chatclient/protocol/AuthType.java +++ b/amcc-protocol/src/main/java/net/defekt/mc/chatclient/protocol/AuthType.java @@ -2,11 +2,14 @@ /** * Enum containing all authentication methods supported by client - * - * @author Defective4 * + * @author Defective4 */ @SuppressWarnings("javadoc") public enum AuthType { - Offline, Microsoft, TheAltening + Offline, Microsoft, @Deprecated TheAltening; + + public static AuthType[] valuesX() { + return new AuthType[] { Offline, Microsoft }; + } } From b491ef8eb7dfa4dd580e132bf842e5dbd01ba8b8 Mon Sep 17 00:00:00 2001 From: Defective4 Date: Tue, 18 Apr 2023 17:19:46 +0200 Subject: [PATCH 04/14] Change project compiler target --- .idea/inspectionProfiles/Project_Default.xml | 19 ++++ pom.xml | 101 ++++++++++--------- 2 files changed, 71 insertions(+), 49 deletions(-) create mode 100644 .idea/inspectionProfiles/Project_Default.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..3c42847 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,19 @@ + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 7974265..54a5d04 100644 --- a/pom.xml +++ b/pom.xml @@ -1,50 +1,53 @@ - - 4.0.0 - io.github.defective4.amcc - amcc - 1.11.0 - pom - Another Minecraft Chat Client - - - sonatype-nexus-snapshots - Sonatype Nexus Snapshots - https://s01.oss.sonatype.org/content/repositories/snapshots - - - sonatype-nexus-staging - Nexus Release Repository - https://s01.oss.sonatype.org/content/repositories/releases - - - - amcc-protocol - amcc-app - amcc-api - - - UTF-8 - UTF-8 - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.11.0 - - utf-8 - 1.8 - 1.8 - - - - - https://github.com/Defective4/Another-Minecraft-Chat-Client - Root project for AMCC Protocol and Plugin API - - https://github.com/Defective4/Another-Minecraft-Chat-Client - git - Defective4 - + + 4.0.0 + io.github.defective4.amcc + amcc + 1.11.0 + pom + Another Minecraft Chat Client + + + sonatype-nexus-snapshots + Sonatype Nexus Snapshots + https://s01.oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + Nexus Release Repository + https://s01.oss.sonatype.org/content/repositories/releases + + + + amcc-protocol + amcc-app + amcc-api + + + UTF-8 + UTF-8 + 8 + 8 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + utf-8 + 1.8 + 1.8 + + + + + https://github.com/Defective4/Another-Minecraft-Chat-Client + Root project for AMCC Protocol and Plugin API + + https://github.com/Defective4/Another-Minecraft-Chat-Client + git + Defective4 + From 674e144e8ea318ea0eb317b6f6be5c3f1cd99d5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 02:03:09 +0000 Subject: [PATCH 05/14] Bump flatlaf from 3.1 to 3.1.1 Bumps [flatlaf](https://github.com/JFormDesigner/FlatLaf) from 3.1 to 3.1.1. - [Release notes](https://github.com/JFormDesigner/FlatLaf/releases) - [Changelog](https://github.com/JFormDesigner/FlatLaf/blob/main/CHANGELOG.md) - [Commits](https://github.com/JFormDesigner/FlatLaf/compare/3.1...3.1.1) --- updated-dependencies: - dependency-name: com.formdev:flatlaf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- amcc-app/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amcc-app/pom.xml b/amcc-app/pom.xml index 1a41785..7aa18c4 100644 --- a/amcc-app/pom.xml +++ b/amcc-app/pom.xml @@ -27,7 +27,7 @@ com.formdev flatlaf - 3.1 + 3.1.1 io.github.defective4.amcc From 8da84ef282827dab4d00b83c754a754a7c76b5dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 02:07:42 +0000 Subject: [PATCH 06/14] Bump maven-gpg-plugin from 3.0.1 to 3.1.0 Bumps [maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.0.1 to 3.1.0. - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.0.1...maven-gpg-plugin-3.1.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- amcc-api/pom.xml | 2 +- amcc-protocol/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/amcc-api/pom.xml b/amcc-api/pom.xml index fa01cad..b1e3afc 100644 --- a/amcc-api/pom.xml +++ b/amcc-api/pom.xml @@ -19,7 +19,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.1.0 sign-artifacts diff --git a/amcc-protocol/pom.xml b/amcc-protocol/pom.xml index 2ac1e47..403ca6d 100644 --- a/amcc-protocol/pom.xml +++ b/amcc-protocol/pom.xml @@ -48,7 +48,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.1.0 sign-artifacts From 8195faf5911ab9392c4065fe2cb16d96f71ca2cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 02:02:20 +0000 Subject: [PATCH 07/14] Bump maven-assembly-plugin from 3.5.0 to 3.6.0 Bumps [maven-assembly-plugin](https://github.com/apache/maven-assembly-plugin) from 3.5.0 to 3.6.0. - [Commits](https://github.com/apache/maven-assembly-plugin/compare/maven-assembly-plugin-3.5.0...maven-assembly-plugin-3.6.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-assembly-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- amcc-api/pom.xml | 2 +- amcc-app/pom.xml | 2 +- amcc-protocol/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/amcc-api/pom.xml b/amcc-api/pom.xml index b1e3afc..92d7921 100644 --- a/amcc-api/pom.xml +++ b/amcc-api/pom.xml @@ -33,7 +33,7 @@ org.apache.maven.plugins maven-assembly-plugin - 3.5.0 + 3.6.0 diff --git a/amcc-app/pom.xml b/amcc-app/pom.xml index 7aa18c4..f4eae0b 100644 --- a/amcc-app/pom.xml +++ b/amcc-app/pom.xml @@ -40,7 +40,7 @@ org.apache.maven.plugins maven-assembly-plugin - 3.5.0 + 3.6.0 diff --git a/amcc-protocol/pom.xml b/amcc-protocol/pom.xml index 403ca6d..5758505 100644 --- a/amcc-protocol/pom.xml +++ b/amcc-protocol/pom.xml @@ -24,7 +24,7 @@ org.apache.maven.plugins maven-assembly-plugin - 3.5.0 + 3.6.0 From 9f3a2c731fc95f986fb3efe462ac795cc656661a Mon Sep 17 00:00:00 2001 From: Defective4 Date: Wed, 12 Jul 2023 10:10:47 +0200 Subject: [PATCH 08/14] Removed eclipse files --- .classpath | 6 - .idea/intellij-javadocs-4.0.1.xml | 204 ++++++++++++++++++ .project | 23 -- .settings/org.eclipse.buildship.core.prefs | 13 -- .settings/org.eclipse.core.resources.prefs | 2 - .settings/org.eclipse.jdt.core.prefs | 29 --- .settings/org.eclipse.jdt.ui.prefs | 119 ---------- .settings/org.eclipse.m2e.core.prefs | 4 - amcc-api/.classpath | 27 --- .../org.eclipse.core.resources.prefs | 4 - amcc-api/.settings/org.eclipse.jdt.core.prefs | 22 -- amcc-api/.settings/org.eclipse.m2e.core.prefs | 4 - amcc-app/.classpath | 32 --- .../org.eclipse.core.resources.prefs | 4 - amcc-app/.settings/org.eclipse.jdt.core.prefs | 8 - amcc-app/.settings/org.eclipse.m2e.core.prefs | 4 - amcc-protocol/.classpath | 32 --- .../org.eclipse.core.resources.prefs | 5 - .../.settings/org.eclipse.jdt.core.prefs | 25 --- .../.settings/org.eclipse.m2e.core.prefs | 4 - 20 files changed, 204 insertions(+), 367 deletions(-) delete mode 100644 .classpath create mode 100644 .idea/intellij-javadocs-4.0.1.xml delete mode 100644 .project delete mode 100644 .settings/org.eclipse.buildship.core.prefs delete mode 100644 .settings/org.eclipse.core.resources.prefs delete mode 100644 .settings/org.eclipse.jdt.core.prefs delete mode 100644 .settings/org.eclipse.jdt.ui.prefs delete mode 100644 .settings/org.eclipse.m2e.core.prefs delete mode 100644 amcc-api/.classpath delete mode 100644 amcc-api/.settings/org.eclipse.core.resources.prefs delete mode 100644 amcc-api/.settings/org.eclipse.jdt.core.prefs delete mode 100644 amcc-api/.settings/org.eclipse.m2e.core.prefs delete mode 100644 amcc-app/.classpath delete mode 100644 amcc-app/.settings/org.eclipse.core.resources.prefs delete mode 100644 amcc-app/.settings/org.eclipse.jdt.core.prefs delete mode 100644 amcc-app/.settings/org.eclipse.m2e.core.prefs delete mode 100644 amcc-protocol/.classpath delete mode 100644 amcc-protocol/.settings/org.eclipse.core.resources.prefs delete mode 100644 amcc-protocol/.settings/org.eclipse.jdt.core.prefs delete mode 100644 amcc-protocol/.settings/org.eclipse.m2e.core.prefs diff --git a/.classpath b/.classpath deleted file mode 100644 index 411e955..0000000 --- a/.classpath +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/.idea/intellij-javadocs-4.0.1.xml b/.idea/intellij-javadocs-4.0.1.xml new file mode 100644 index 0000000..ac4c4a3 --- /dev/null +++ b/.idea/intellij-javadocs-4.0.1.xml @@ -0,0 +1,204 @@ + + + + + UPDATE + false + true + + FIELD + TYPE + METHOD + + + PUBLIC + DEFAULT + PROTECTED + + + + + + ^.*(public|protected|private)*.+interface\s+\w+.* + /**\n + * The interface ${name}.\n +<#if element.typeParameters?has_content> * \n +</#if> +<#list element.typeParameters as typeParameter> + * @param <${typeParameter.name}> the type parameter\n +</#list> + */ + + + ^.*(public|protected|private)*.+enum\s+\w+.* + /**\n + * The enum ${name}.\n + */ + + + ^.*(public|protected|private)*.+class\s+\w+.* + /**\n + * The type ${name}.\n +<#if element.typeParameters?has_content> * \n +</#if> +<#list element.typeParameters as typeParameter> + * @param <${typeParameter.name}> the type parameter\n +</#list> + */ + + + .+ + /**\n + * The type ${name}.\n + */ + + + + + .+ + /**\n + * Instantiates a new ${name}.\n +<#if element.parameterList.parameters?has_content> + *\n +</#if> +<#list element.parameterList.parameters as parameter> + * @param ${parameter.name} the ${paramNames[parameter.name]}\n +</#list> +<#if element.throwsList.referenceElements?has_content> + *\n +</#if> +<#list element.throwsList.referenceElements as exception> + * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n +</#list> + */ + + + + + ^.*(public|protected|private)*\s*.*(\w(\s*<.+>)*)+\s+get\w+\s*\(.*\).+ + /**\n + * Gets ${partName}.\n +<#if element.typeParameters?has_content> * \n +</#if> +<#list element.typeParameters as typeParameter> + * @param <${typeParameter.name}> the type parameter\n +</#list> +<#if element.parameterList.parameters?has_content> + *\n +</#if> +<#list element.parameterList.parameters as parameter> + * @param ${parameter.name} the ${paramNames[parameter.name]}\n +</#list> +<#if isNotVoid> + *\n + * @return the ${partName}\n +</#if> +<#if element.throwsList.referenceElements?has_content> + *\n +</#if> +<#list element.throwsList.referenceElements as exception> + * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n +</#list> + */ + + + ^.*(public|protected|private)*\s*.*(void|\w(\s*<.+>)*)+\s+set\w+\s*\(.*\).+ + /**\n + * Sets ${partName}.\n +<#if element.typeParameters?has_content> * \n +</#if> +<#list element.typeParameters as typeParameter> + * @param <${typeParameter.name}> the type parameter\n +</#list> +<#if element.parameterList.parameters?has_content> + *\n +</#if> +<#list element.parameterList.parameters as parameter> + * @param ${parameter.name} the ${paramNames[parameter.name]}\n +</#list> +<#if isNotVoid> + *\n + * @return the ${partName}\n +</#if> +<#if element.throwsList.referenceElements?has_content> + *\n +</#if> +<#list element.throwsList.referenceElements as exception> + * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n +</#list> + */ + + + ^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+ + /**\n + * The entry point of application.\n + + <#if element.parameterList.parameters?has_content> + *\n +</#if> + * @param ${element.parameterList.parameters[0].name} the input arguments\n +<#if element.throwsList.referenceElements?has_content> + *\n +</#if> +<#list element.throwsList.referenceElements as exception> + * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n +</#list> + */ + + + .+ + /**\n + * ${name}<#if isNotVoid> ${return}</#if>.\n +<#if element.typeParameters?has_content> * \n +</#if> +<#list element.typeParameters as typeParameter> + * @param <${typeParameter.name}> the type parameter\n +</#list> +<#if element.parameterList.parameters?has_content> + *\n +</#if> +<#list element.parameterList.parameters as parameter> + * @param ${parameter.name} the ${paramNames[parameter.name]}\n +</#list> +<#if isNotVoid> + *\n + * @return the ${return}\n +</#if> +<#if element.throwsList.referenceElements?has_content> + *\n +</#if> +<#list element.throwsList.referenceElements as exception> + * @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n +</#list> + */ + + + + + ^.*(public|protected|private)*.+static.*(\w\s\w)+.+ + /**\n + * The constant ${element.getName()}.\n + */ + + + ^.*(public|protected|private)*.*(\w\s\w)+.+ + /**\n + <#if element.parent.isInterface()> + * The constant ${element.getName()}.\n +<#else> + * The ${name}.\n +</#if> */ + + + .+ + /**\n + <#if element.parent.isEnum()> + *${name} ${typeName}.\n +<#else> + * The ${name}.\n +</#if>*/ + + + + + \ No newline at end of file diff --git a/.project b/.project deleted file mode 100644 index 568b7f7..0000000 --- a/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - Another Minecraft Chat Client - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.jdt.core.javanature - - diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs deleted file mode 100644 index e479558..0000000 --- a/.settings/org.eclipse.buildship.core.prefs +++ /dev/null @@ -1,13 +0,0 @@ -arguments= -auto.sync=false -build.scans.enabled=false -connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) -connection.project.dir= -eclipse.preferences.version=1 -gradle.user.home= -java.home= -jvm.arguments= -offline.mode=false -override.workspace.settings=false -show.console.view=false -show.executions.view=false diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0..0000000 --- a/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index fe39b96..0000000 --- a/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,29 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.doc.comment.support=enabled -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=info -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=default -org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=info -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=default -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning -org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index fc517b0..0000000 --- a/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,119 +0,0 @@ -cleanup.add_all=true -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=false -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=true -cleanup.arrays_fill=true -cleanup.bitwise_conditional_expression=false -cleanup.boolean_literal=false -cleanup.break_loop=true -cleanup.collection_cloning=false -cleanup.comparing_on_criteria=false -cleanup.comparison_statement=false -cleanup.controlflow_merge=false -cleanup.convert_functional_interfaces=true -cleanup.convert_to_enhanced_for_loop=false -cleanup.convert_to_enhanced_for_loop_if_loop_var_used=false -cleanup.convert_to_switch_expressions=false -cleanup.correct_indentation=true -cleanup.double_negation=false -cleanup.else_if=true -cleanup.embedded_if=false -cleanup.evaluate_nullable=false -cleanup.extract_increment=true -cleanup.format_source_code=true -cleanup.format_source_code_changes_only=false -cleanup.hash=false -cleanup.if_condition=false -cleanup.insert_inferred_type_arguments=false -cleanup.instanceof=false -cleanup.invert_equals=false -cleanup.join=false -cleanup.lazy_logical_operator=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=true -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=true -cleanup.map_cloning=false -cleanup.merge_conditional_blocks=true -cleanup.multi_catch=true -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.no_string_creation=false -cleanup.no_super=false -cleanup.number_suffix=true -cleanup.objects_equals=false -cleanup.organize_imports=true -cleanup.overridden_assignment=false -cleanup.plain_replacement=false -cleanup.precompile_regex=false -cleanup.primitive_comparison=false -cleanup.primitive_parsing=true -cleanup.primitive_serialization=false -cleanup.pull_up_assignment=false -cleanup.push_down_negation=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.reduce_indentation=false -cleanup.redundant_falling_through_block_end=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_modifiers=false -cleanup.remove_redundant_semicolons=true -cleanup.remove_redundant_type_arguments=false -cleanup.remove_trailing_whitespaces=false -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_array_creation=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=true -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=true -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.simplify_lambda_expression_and_method_ref=true -cleanup.single_used_field=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.standard_comparison=false -cleanup.static_inner_class=true -cleanup.strictly_equal_or_different=true -cleanup.stringbuilder=true -cleanup.substring=false -cleanup.switch=false -cleanup.ternary_operator=true -cleanup.try_with_resource=true -cleanup.unlooped_while=false -cleanup.unreachable_block=false -cleanup.use_anonymous_class_creation=true -cleanup.use_autoboxing=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=true -cleanup.use_directly_map_method=false -cleanup.use_lambda=false -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=false -cleanup.use_unboxing=false -cleanup.use_var=false -cleanup.useless_continue=true -cleanup.useless_return=true -cleanup_profile=_Defekt -cleanup_settings_version=2 -eclipse.preferences.version=1 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f..0000000 --- a/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/amcc-api/.classpath b/amcc-api/.classpath deleted file mode 100644 index 3c5e7d1..0000000 --- a/amcc-api/.classpath +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/amcc-api/.settings/org.eclipse.core.resources.prefs b/amcc-api/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 14304ef..0000000 --- a/amcc-api/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -encoding//src/main/java=utf-8 -encoding//src/main/resources=UTF-8 -encoding/=UTF-8 diff --git a/amcc-api/.settings/org.eclipse.jdt.core.prefs b/amcc-api/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 8e703d4..0000000 --- a/amcc-api/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,22 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.doc.comment.support=enabled -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=info -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected -org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=info -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore -org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/amcc-api/.settings/org.eclipse.m2e.core.prefs b/amcc-api/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f..0000000 --- a/amcc-api/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/amcc-app/.classpath b/amcc-app/.classpath deleted file mode 100644 index a20af92..0000000 --- a/amcc-app/.classpath +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/amcc-app/.settings/org.eclipse.core.resources.prefs b/amcc-app/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 14304ef..0000000 --- a/amcc-app/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -encoding//src/main/java=utf-8 -encoding//src/main/resources=UTF-8 -encoding/=UTF-8 diff --git a/amcc-app/.settings/org.eclipse.jdt.core.prefs b/amcc-app/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 2f5cc74..0000000 --- a/amcc-app/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore -org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/amcc-app/.settings/org.eclipse.m2e.core.prefs b/amcc-app/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f..0000000 --- a/amcc-app/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/amcc-protocol/.classpath b/amcc-protocol/.classpath deleted file mode 100644 index cd04a79..0000000 --- a/amcc-protocol/.classpath +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/amcc-protocol/.settings/org.eclipse.core.resources.prefs b/amcc-protocol/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index e73adf7..0000000 --- a/amcc-protocol/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,5 +0,0 @@ -eclipse.preferences.version=1 -encoding//src/main/java=utf-8 -encoding//src/main/resources=UTF-8 -encoding//src/main/resources/resources/lang/CN.properties=UTF-8 -encoding/=UTF-8 diff --git a/amcc-protocol/.settings/org.eclipse.jdt.core.prefs b/amcc-protocol/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index c609eb6..0000000 --- a/amcc-protocol/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,25 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.doc.comment.support=enabled -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=info -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected -org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=info -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore -org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/amcc-protocol/.settings/org.eclipse.m2e.core.prefs b/amcc-protocol/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f..0000000 --- a/amcc-protocol/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 From 90ae404260b8b1bd65c67c8b47fec4bc0a2ffeb7 Mon Sep 17 00:00:00 2001 From: Defective4 Date: Wed, 12 Jul 2023 10:34:30 +0200 Subject: [PATCH 09/14] Changed custom messages loading method --- .idea/codeStyles/Project.xml | 25 +++++++++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 ++++ .../mc/chatclient/protocol/data/Messages.java | 22 +++++++++++----- .../resources/resources/lang/CN.properties | 1 - .../resources/resources/lang/EN.properties | 1 - .../resources/resources/lang/PL.properties | 1 - 6 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..0059eb9 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,25 @@ + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/amcc-protocol/src/main/java/net/defekt/mc/chatclient/protocol/data/Messages.java b/amcc-protocol/src/main/java/net/defekt/mc/chatclient/protocol/data/Messages.java index 3368a9e..578073b 100644 --- a/amcc-protocol/src/main/java/net/defekt/mc/chatclient/protocol/data/Messages.java +++ b/amcc-protocol/src/main/java/net/defekt/mc/chatclient/protocol/data/Messages.java @@ -1,28 +1,38 @@ package net.defekt.mc.chatclient.protocol.data; -import java.util.ResourceBundle; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; /** * Class used to access externalized strings keys - * */ public class Messages { - private static final String BUNDLE_NAME = "resources.lang." + UserPreferences.prefs().getAppLanguage().getCode(); + private static final Properties props = new Properties(); - private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); + static { + try (InputStream is = Messages.class.getResourceAsStream("/resources/lang/" + UserPreferences.prefs() + .getAppLanguage() + .getCode() + .toUpperCase() + ".properties")) { + props.load(is); + } catch (IOException e) { + e.printStackTrace(); + } + } private Messages() { } /** * Get string for this key - * + * * @param key string key * @return string's key */ public static String getString(final String key) { try { - return RESOURCE_BUNDLE.getString(key); + return props.getProperty(key, "!" + key + "!"); } catch (final Exception e) { return '!' + key + '!'; } diff --git a/amcc-protocol/src/main/resources/resources/lang/CN.properties b/amcc-protocol/src/main/resources/resources/lang/CN.properties index 9a99644..2833299 100644 --- a/amcc-protocol/src/main/resources/resources/lang/CN.properties +++ b/amcc-protocol/src/main/resources/resources/lang/CN.properties @@ -231,7 +231,6 @@ Main.autoResponseDefaultRuleName=\u89c4\u5219 Main.random=\u968f\u673a Main.ordered=\u6709\u5e8f Main.all=\u5168\u90e8 -Main.autoResponseAddTitle=\u6dfb\u52a0\u89c4\u5219 Main.autoResponseRuleName=\u89c4\u5219\u540d Main.triggers=\u89e6\u53d1\u5668 Main.except=\u4f8b\u5916 diff --git a/amcc-protocol/src/main/resources/resources/lang/EN.properties b/amcc-protocol/src/main/resources/resources/lang/EN.properties index c7633f8..d319f2c 100644 --- a/amcc-protocol/src/main/resources/resources/lang/EN.properties +++ b/amcc-protocol/src/main/resources/resources/lang/EN.properties @@ -236,7 +236,6 @@ Main.autoResponseDefaultRuleName=Rule Main.random=Random Main.ordered=Ordered Main.all=All -Main.autoResponseAddTitle=Adding a rule Main.autoResponseRuleName=Rule name Main.triggers=Triggers Main.except=Exceptions diff --git a/amcc-protocol/src/main/resources/resources/lang/PL.properties b/amcc-protocol/src/main/resources/resources/lang/PL.properties index 5b6d12b..ad6e26d 100644 --- a/amcc-protocol/src/main/resources/resources/lang/PL.properties +++ b/amcc-protocol/src/main/resources/resources/lang/PL.properties @@ -233,7 +233,6 @@ Main.autoResponseDefaultRuleName=Regu\u0142a Main.random=Losowo Main.ordered=Po kolei Main.all=Wszystkie -Main.autoResponseAddTitle=Dodawanie regu\u0142y Main.autoResponseRuleName=Nazwa regu\u0142y Main.triggers=Wyzwalacze Main.except=Wyj\u0105tki From 67f6b1bd9e305a4f3eae720adbf20387bd86e066 Mon Sep 17 00:00:00 2001 From: Defective4 Date: Wed, 12 Jul 2023 10:56:37 +0200 Subject: [PATCH 10/14] Fixed preferences file saving --- .idea/inspectionProfiles/Project_Default.xml | 11 ++ .../net/defekt/mc/chatclient/ui/Main.java | 8 +- .../protocol/data/UserPreferences.java | 100 +++++++----------- 3 files changed, 52 insertions(+), 67 deletions(-) diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 3c42847..8c28f30 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -3,6 +3,17 @@