From 525ead6d5af54ea3a4499bf87b178ac7e890a81e Mon Sep 17 00:00:00 2001 From: Emma Waffle Date: Wed, 4 Aug 2021 23:03:57 -0400 Subject: [PATCH] [release] v2.2.0: New config option for bad connections; temporary command/world fix; buildscript improvement; license headers --- .github/workflows/build.yml | 37 +++++------- LICENSE | 22 +++++-- build.gradle | 57 +++++++++++++------ gradle.properties | 16 +----- .../emcutils/EmpireMinecraftUtilities.java | 39 +++++++++++-- .../emcutils/containers/EmpireResidence.java | 24 ++++++++ .../emcutils/containers/EmpireServer.java | 43 +++++++++----- .../emcutils/features/ChatChannels.java | 28 ++++++++- .../emcutils/features/TabListOrganizer.java | 26 ++++++++- .../frydae/emcutils/features/UsableItems.java | 26 ++++++++- .../emcutils/features/VaultButtons.java | 26 ++++++++- .../features/VisitResidenceHandler.java | 24 ++++++++ .../features/VoxelMapIntegration.java | 24 ++++++++ .../features/vaultButtons/VaultScreen.java | 24 ++++++++ .../vaultButtons/VaultScreenHandler.java | 24 ++++++++ .../emcutils/interfaces/ChatCallback.java | 24 ++++++++ .../emcutils/interfaces/CommandCallback.java | 24 ++++++++ .../emcutils/interfaces/ScreenAccessor.java | 24 ++++++++ .../dev/frydae/emcutils/interfaces/Task.java | 24 ++++++++ .../emcutils/listeners/ChatListener.java | 24 ++++++++ .../emcutils/listeners/CommandListener.java | 24 ++++++++ .../emcutils/listeners/ServerListener.java | 24 ++++++++ .../emcutils/mixins/ChatScreenMixin.java | 24 ++++++++ .../mixins/ClientEntityPlayerMixin.java | 24 ++++++++ .../mixins/ClientPlayNetworkHandlerMixin.java | 26 ++++++++- .../emcutils/mixins/ConnectScreenMixin.java | 26 ++++++++- .../emcutils/mixins/IdentifierMixin.java | 24 ++++++++ .../emcutils/mixins/MinecraftClientMixin.java | 24 ++++++++ .../mixins/PlayerListHudAccessor.java | 24 ++++++++ .../emcutils/mixins/PlayerListHudMixin.java | 24 ++++++++ .../frydae/emcutils/mixins/ScreenMixin.java | 24 ++++++++ .../voxelMap/GuiPersistentMapMixin.java | 26 ++++++++- .../mixins/voxelMap/GuiWaypointsMixin.java | 26 ++++++++- .../mixins/voxelMap/VoxelMapMixin.java | 26 ++++++++- .../emcutils/tasks/GetChatAlertPitchTask.java | 24 ++++++++ .../emcutils/tasks/GetChatAlertSoundTask.java | 24 ++++++++ .../emcutils/tasks/GetLocationTask.java | 24 ++++++++ .../java/dev/frydae/emcutils/tasks/Tasks.java | 24 ++++++++ .../dev/frydae/emcutils/utils/Config.java | 25 ++++++++ .../frydae/emcutils/utils/MidnightConfig.java | 6 +- .../emcutils/utils/ModMenuIntegration.java | 24 ++++++++ .../java/dev/frydae/emcutils/utils/Util.java | 33 ++++++++++- .../resources/assets/emcutils/lang/en_us.json | 4 +- 43 files changed, 1002 insertions(+), 92 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f3dd331..ec5a27a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,28 +1,21 @@ -name: Build EMC Utilities -on: [ pull_request, push ] +name: Build and/or Release EMC Utilities +on: [ push ] jobs: build: - strategy: - matrix: - java: [ 16 ] - os: [ ubuntu-latest, windows-latest, macos-latest ] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-20.04 + container: + image: adoptopenjdk:16-jdk + options: --user root steps: - - name: 1 - Checkout repository - uses: actions/checkout@v2 - - name: 2 - Validate Gradle wrapper - uses: gradle/wrapper-validation-action@v1 - - name: 3 - Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v2 + - run: apt update && apt install git -y && git --version + - uses: actions/checkout@v2 + - uses: gradle/wrapper-validation-action@v1 + - uses: actions/setup-java@v2 with: distribution: adopt - java-version: ${{ matrix.java }} - - name: 4 - Build - run: ./gradlew build - - name: 5 - Capture & upload build artifacts - if: ${{ runner.os == 'Linux' }} - uses: actions/upload-artifact@v2 - with: - name: Artifacts - path: build/libs/ + java-version: 16 + - run: ./gradlew build modrinth + if: "contains(github.event.head_commit.message, '[release]')" + env: + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} diff --git a/LICENSE b/LICENSE index a9ad012..62dd669 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,21 @@ -Copyright 2021 MrFrydae +Copyright (c) 2021 MrFrydae +Copyright (c) 2021 wafflecoffee +Copyright (c) 2021 djlawler -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/build.gradle b/build.gradle index d2e41a2..be53948 100644 --- a/build.gradle +++ b/build.gradle @@ -1,17 +1,28 @@ +// Inspired in part by the buildscripts of FabricMC/fabric + plugins { - id "fabric-loom" version "0.9-SNAPSHOT" - id 'io.github.juuxel.loom-quiltflower' version '1.1.3' + id "fabric-loom" version "0.9.+" + id "com.modrinth.minotaur" version "1.2.+" + id "org.cadixdev.licenser" version "0.6.+" + id "io.github.juuxel.loom-quiltflower" version "1.2.+" } -sourceCompatibility = JavaVersion.VERSION_16 -targetCompatibility = JavaVersion.VERSION_16 +String mod_version = "2.2.0" +String release_title = "Important bug fix & new config option for slow connections" +String changelog = "- update deps, add quiltflower (wafflecoffee)\n- [release] v2.2.0: New config option for bad connections; temporary command/world fix; buildscript improvement; license headers (wafflecoffee)" + +String minecraft_version = "1.17.1" // https://fabricmc.net/versions.html +String yarn_mappings = "32" // https://fabricmc.net/versions.html +String loader_version = "0.11.6" // https://fabricmc.net/versions.html +String fabric_version = "0.37.1+1.17" // https://fabricmc.net/versions.html +String modmenu_version = "2.0.4" // https://modrinth.com/mod/modmenu/versions +String lombok_version = "1.18.20" // https://mvnrepository.com/artifact/org.projectlombok/lombok -archivesBaseName = "emcutils-${project.minecraft_version}" -version = project.mod_version +archivesBaseName = "emcutils-${minecraft_version}" +version = mod_version repositories { - maven { url "https://api.modrinth.com/maven" } - maven { url "https://maven.shedaniel.me" } + maven { url "https://maven.terraformersmc.com" } maven { url "https://www.cursemaven.com" } } @@ -24,24 +35,23 @@ Set apiModules = [ ] dependencies { - minecraft "com.mojang:minecraft:${project.minecraft_version}" - mappings "net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_mappings}:v2" - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" + minecraft "com.mojang:minecraft:${minecraft_version}" + mappings "net.fabricmc:yarn:${minecraft_version}+build.${yarn_mappings}:v2" + modImplementation "net.fabricmc:fabric-loader:${loader_version}" apiModules.forEach { include(modImplementation(fabricApi.module(it, fabric_version))) } - modImplementation "maven.modrinth:modmenu:${project.modmenu_version}" + modImplementation "com.terraformersmc:modmenu:${modmenu_version}" - implementation "org.projectlombok:lombok:${project.lombok_version}" - annotationProcessor "org.projectlombok:lombok:${project.lombok_version}" - testImplementation "org.projectlombok:lombok:${project.lombok_version}" - testAnnotationProcessor "org.projectlombok:lombok:${project.lombok_version}" + implementation "org.projectlombok:lombok:${lombok_version}" + annotationProcessor "org.projectlombok:lombok:${lombok_version}" + testImplementation "org.projectlombok:lombok:${lombok_version}" + testAnnotationProcessor "org.projectlombok:lombok:${lombok_version}" modImplementation "curse.maven:voxelmap-225179:3345206" } processResources { inputs.property "version", project.version - filesMatching("fabric.mod.json") { expand "version": project.version } @@ -50,3 +60,16 @@ processResources { tasks.withType(JavaCompile) { it.options.encoding = "UTF-8" } jar { from("LICENSE") } + +import com.modrinth.minotaur.TaskModrinthUpload + +task modrinth(type: TaskModrinthUpload) { + onlyIf { System.getenv().MODRINTH_TOKEN } + token = System.getenv().MODRINTH_TOKEN + projectId = "QYTT62S0" + versionNumber = version + versionName = release_title + changelog = changelog as String + uploadFile = file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar") + addGameVersion(minecraft_version) +} diff --git a/gradle.properties b/gradle.properties index 1b857c8..ca8ba48 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,13 +1,3 @@ -# Done to increase the memory available to gradle. -# suppress inspection "UnusedProperty" -org.gradle.jvmargs=-Xmx1G -# Fabric Properties - check these on -minecraft_version=1.17.1 -yarn_mappings=30 -loader_version=0.11.6 -fabric_version=0.37.1+1.17 -# Mod Properties -mod_version=2.1.4 -# Dependencies -modmenu_version=2.0.2 -lombok_version=1.18.20 +# file suppress inspection "UnusedProperty" +org.gradle.jvmargs=-Xmx2G +org.gradle.parallel=true \ No newline at end of file diff --git a/src/main/java/dev/frydae/emcutils/EmpireMinecraftUtilities.java b/src/main/java/dev/frydae/emcutils/EmpireMinecraftUtilities.java index b6de286..2e57d4c 100644 --- a/src/main/java/dev/frydae/emcutils/EmpireMinecraftUtilities.java +++ b/src/main/java/dev/frydae/emcutils/EmpireMinecraftUtilities.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils; import dev.frydae.emcutils.containers.EmpireServer; @@ -49,7 +73,7 @@ public static void onPostJoinEmpireMinecraft() { () -> Util.getInstance().setShouldRunTasks(false)); } - if (Util.HAS_VOXELMAP) { + if (Util.hasVoxelMap) { Tasks.runTasks( new GetLocationTask(), new VoxelMapIntegration() @@ -61,17 +85,20 @@ public static void onPostJoinEmpireMinecraft() { public void onInitializeClient() { instance = this; - ExecutorService executor = Executors.newCachedThreadPool(); - IntStream.rangeClosed(1, 10).forEach(i -> executor.submit(() -> EmpireServer.getById(i).collectResidences())); - executor.shutdown(); + MidnightConfig.init(MODID, Config.class); + + if (!Config.isDontRunResidenceCollector()) { + ExecutorService executor = Executors.newCachedThreadPool(); + IntStream.rangeClosed(1, 10).forEach(i -> executor.submit(() -> EmpireServer.getById(i).collectResidences())); + executor.shutdown(); + } + else LogManager.getLogger(MODID).info(MODID + " is not going to run the residence collector - some features will not work as intended. Disable 'Don't run residence collector' to get rid of this message."); HandledScreens.register(VaultButtons.GENERIC_9X7, VaultScreen::new); Util.getOnJoinCommandQueue(); Util.hasVoxelMap(); - MidnightConfig.init(MODID, Config.class); - LogManager.getLogger(MODID).info("Initialized " + MODID); } } diff --git a/src/main/java/dev/frydae/emcutils/containers/EmpireResidence.java b/src/main/java/dev/frydae/emcutils/containers/EmpireResidence.java index 9ac737d..a9fc1d6 100644 --- a/src/main/java/dev/frydae/emcutils/containers/EmpireResidence.java +++ b/src/main/java/dev/frydae/emcutils/containers/EmpireResidence.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.containers; import com.google.gson.JsonObject; diff --git a/src/main/java/dev/frydae/emcutils/containers/EmpireServer.java b/src/main/java/dev/frydae/emcutils/containers/EmpireServer.java index 9f16c88..3817e48 100644 --- a/src/main/java/dev/frydae/emcutils/containers/EmpireServer.java +++ b/src/main/java/dev/frydae/emcutils/containers/EmpireServer.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.containers; import com.google.common.collect.Lists; @@ -38,6 +62,7 @@ public enum EmpireServer { @Getter private final char tabListDisplay; @Getter private final String command; @Getter private final List residences; + private static boolean didConnectionFail = false; EmpireServer(int id, String name, int tabListRank, char tabListDisplay) { this.id = id; @@ -135,20 +160,12 @@ public void collectResidences() { .getAsJsonObject("empire.residences") .getAsJsonObject("areas"); - object.entrySet().forEach(e -> { - if (e.getValue().getAsJsonObject().get("desc").getAsString().contains("EmpireMinecraft") || - e.getValue().getAsJsonObject().get("desc").getAsString().contains("Aikar") || - e.getValue().getAsJsonObject().get("desc").getAsString().contains("Krysyy") || - e.getValue().getAsJsonObject().get("desc").getAsString().contains("Maxarias")) { - return; - } - - residences.add(new EmpireResidence(this, e.getValue().getAsJsonObject())); - }); - } catch (IOException e) { - e.printStackTrace(); + object.entrySet().forEach(e -> residences.add(new EmpireResidence(this, e.getValue().getAsJsonObject()))); + } catch (IOException ioException) { + didConnectionFail = true; } - LogManager.getLogger(EmpireMinecraftUtilities.MODID).info("Loaded Residences for: " + name.toLowerCase()); + if (!didConnectionFail) LogManager.getLogger(EmpireMinecraftUtilities.MODID).info("Loaded Residences for: " + name.toLowerCase()); + else LogManager.getLogger(EmpireMinecraftUtilities.MODID).info("Residence collector for " + name.toLowerCase() + " failed; you may find the 'Don't run residence collector' option to be useful. This option will prevent the residence collector from running at all, which, on very slow connections, will help prevent requests which will fail anyway."); } } diff --git a/src/main/java/dev/frydae/emcutils/features/ChatChannels.java b/src/main/java/dev/frydae/emcutils/features/ChatChannels.java index 9a65d3e..638c209 100644 --- a/src/main/java/dev/frydae/emcutils/features/ChatChannels.java +++ b/src/main/java/dev/frydae/emcutils/features/ChatChannels.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.features; import dev.frydae.emcutils.utils.Config; @@ -26,7 +50,7 @@ public class ChatChannels { private static long lastClickedButtonTime = 0L; public static void handleChatScreenRender(Screen screen, MatrixStack matrices, CallbackInfo info) { - if (Util.IS_ON_EMC) { + if (Util.isOnEMC) { for (ChatChannel channel : ChatChannel.values()) { if (channel == ChatChannel.SUPPORTER && Util.getPlayerGroupId() < 2) break; if (channel == ChatChannel.MODERATOR && Util.getPlayerGroupId() < 5) break; @@ -40,7 +64,7 @@ public static void handleChatScreenRender(Screen screen, MatrixStack matrices, C } public static void handleChatScreenMouseClicked(Screen screen, double mouseX, double mouseY, int button, CallbackInfoReturnable cir) { - if (Util.IS_ON_EMC) { + if (Util.isOnEMC) { for (ChatChannel channel : ChatChannel.values()) { if (channel == ChatChannel.SUPPORTER && Util.getPlayerGroupId() < 2) break; if (channel == ChatChannel.MODERATOR && Util.getPlayerGroupId() < 5) break; diff --git a/src/main/java/dev/frydae/emcutils/features/TabListOrganizer.java b/src/main/java/dev/frydae/emcutils/features/TabListOrganizer.java index 293aac3..12a4f38 100644 --- a/src/main/java/dev/frydae/emcutils/features/TabListOrganizer.java +++ b/src/main/java/dev/frydae/emcutils/features/TabListOrganizer.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.features; import com.google.common.collect.Lists; @@ -17,7 +41,7 @@ public static List sortPlayers(List original) List enhanced = Lists.newArrayList(); List currentServer = Lists.newArrayList(); - if (!Util.IS_ON_EMC) { + if (!Util.isOnEMC) { return original; } diff --git a/src/main/java/dev/frydae/emcutils/features/UsableItems.java b/src/main/java/dev/frydae/emcutils/features/UsableItems.java index ba39671..4df1915 100644 --- a/src/main/java/dev/frydae/emcutils/features/UsableItems.java +++ b/src/main/java/dev/frydae/emcutils/features/UsableItems.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.features; import com.google.gson.JsonArray; @@ -17,7 +41,7 @@ public class UsableItems { public UsableItems() { ItemTooltipCallback.EVENT.register(((itemStack, tooltipContext, list) -> { - if (Util.IS_ON_EMC) { + if (Util.isOnEMC) { if (isUsableItemWithCooldown(itemStack)) { for (Text text : list) { diff --git a/src/main/java/dev/frydae/emcutils/features/VaultButtons.java b/src/main/java/dev/frydae/emcutils/features/VaultButtons.java index bf6e38b..1e2e837 100644 --- a/src/main/java/dev/frydae/emcutils/features/VaultButtons.java +++ b/src/main/java/dev/frydae/emcutils/features/VaultButtons.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.features; import dev.frydae.emcutils.features.vaultButtons.VaultScreenHandler; @@ -12,7 +36,7 @@ public class VaultButtons { public static final ScreenHandlerType GENERIC_9X7 = ScreenHandlerType.register("generic_9x7", VaultScreenHandler::createGeneric9x7); public static void handleScreenOpen(OpenScreenS2CPacket packet, CallbackInfo ci) { - if (Util.IS_ON_EMC) { + if (Util.isOnEMC) { if (!packet.getName().getString().startsWith("Page: ")) { return; } diff --git a/src/main/java/dev/frydae/emcutils/features/VisitResidenceHandler.java b/src/main/java/dev/frydae/emcutils/features/VisitResidenceHandler.java index f59e9d0..1043a35 100644 --- a/src/main/java/dev/frydae/emcutils/features/VisitResidenceHandler.java +++ b/src/main/java/dev/frydae/emcutils/features/VisitResidenceHandler.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.features; import dev.frydae.emcutils.containers.EmpireResidence; diff --git a/src/main/java/dev/frydae/emcutils/features/VoxelMapIntegration.java b/src/main/java/dev/frydae/emcutils/features/VoxelMapIntegration.java index 525f70f..8b0c639 100644 --- a/src/main/java/dev/frydae/emcutils/features/VoxelMapIntegration.java +++ b/src/main/java/dev/frydae/emcutils/features/VoxelMapIntegration.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.features; import com.mamiyaotaru.voxelmap.VoxelMap; diff --git a/src/main/java/dev/frydae/emcutils/features/vaultButtons/VaultScreen.java b/src/main/java/dev/frydae/emcutils/features/vaultButtons/VaultScreen.java index 945c5ba..0dc84fa 100644 --- a/src/main/java/dev/frydae/emcutils/features/vaultButtons/VaultScreen.java +++ b/src/main/java/dev/frydae/emcutils/features/vaultButtons/VaultScreen.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.features.vaultButtons; import com.mojang.authlib.GameProfile; diff --git a/src/main/java/dev/frydae/emcutils/features/vaultButtons/VaultScreenHandler.java b/src/main/java/dev/frydae/emcutils/features/vaultButtons/VaultScreenHandler.java index e3a95cc..c55898c 100644 --- a/src/main/java/dev/frydae/emcutils/features/vaultButtons/VaultScreenHandler.java +++ b/src/main/java/dev/frydae/emcutils/features/vaultButtons/VaultScreenHandler.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.features.vaultButtons; import dev.frydae.emcutils.features.VaultButtons; diff --git a/src/main/java/dev/frydae/emcutils/interfaces/ChatCallback.java b/src/main/java/dev/frydae/emcutils/interfaces/ChatCallback.java index 1abdf6f..e12d38b 100644 --- a/src/main/java/dev/frydae/emcutils/interfaces/ChatCallback.java +++ b/src/main/java/dev/frydae/emcutils/interfaces/ChatCallback.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.interfaces; import net.fabricmc.fabric.api.event.Event; diff --git a/src/main/java/dev/frydae/emcutils/interfaces/CommandCallback.java b/src/main/java/dev/frydae/emcutils/interfaces/CommandCallback.java index 9c204af..e628490 100644 --- a/src/main/java/dev/frydae/emcutils/interfaces/CommandCallback.java +++ b/src/main/java/dev/frydae/emcutils/interfaces/CommandCallback.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.interfaces; import net.fabricmc.fabric.api.event.Event; diff --git a/src/main/java/dev/frydae/emcutils/interfaces/ScreenAccessor.java b/src/main/java/dev/frydae/emcutils/interfaces/ScreenAccessor.java index 390c5b9..9446dbd 100644 --- a/src/main/java/dev/frydae/emcutils/interfaces/ScreenAccessor.java +++ b/src/main/java/dev/frydae/emcutils/interfaces/ScreenAccessor.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.interfaces; import net.minecraft.text.Text; diff --git a/src/main/java/dev/frydae/emcutils/interfaces/Task.java b/src/main/java/dev/frydae/emcutils/interfaces/Task.java index ebd2c7e..f2d46b6 100644 --- a/src/main/java/dev/frydae/emcutils/interfaces/Task.java +++ b/src/main/java/dev/frydae/emcutils/interfaces/Task.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.interfaces; public interface Task { diff --git a/src/main/java/dev/frydae/emcutils/listeners/ChatListener.java b/src/main/java/dev/frydae/emcutils/listeners/ChatListener.java index 8d0e1b4..7cb5f11 100644 --- a/src/main/java/dev/frydae/emcutils/listeners/ChatListener.java +++ b/src/main/java/dev/frydae/emcutils/listeners/ChatListener.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.listeners; import com.google.common.collect.Lists; diff --git a/src/main/java/dev/frydae/emcutils/listeners/CommandListener.java b/src/main/java/dev/frydae/emcutils/listeners/CommandListener.java index 76467dd..3d1a73f 100644 --- a/src/main/java/dev/frydae/emcutils/listeners/CommandListener.java +++ b/src/main/java/dev/frydae/emcutils/listeners/CommandListener.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.listeners; import dev.frydae.emcutils.interfaces.CommandCallback; diff --git a/src/main/java/dev/frydae/emcutils/listeners/ServerListener.java b/src/main/java/dev/frydae/emcutils/listeners/ServerListener.java index aaed61d..4d551a4 100644 --- a/src/main/java/dev/frydae/emcutils/listeners/ServerListener.java +++ b/src/main/java/dev/frydae/emcutils/listeners/ServerListener.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.listeners; import dev.frydae.emcutils.EmpireMinecraftUtilities; diff --git a/src/main/java/dev/frydae/emcutils/mixins/ChatScreenMixin.java b/src/main/java/dev/frydae/emcutils/mixins/ChatScreenMixin.java index e9692ed..f09c9f4 100644 --- a/src/main/java/dev/frydae/emcutils/mixins/ChatScreenMixin.java +++ b/src/main/java/dev/frydae/emcutils/mixins/ChatScreenMixin.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.mixins; import dev.frydae.emcutils.features.ChatChannels; diff --git a/src/main/java/dev/frydae/emcutils/mixins/ClientEntityPlayerMixin.java b/src/main/java/dev/frydae/emcutils/mixins/ClientEntityPlayerMixin.java index 70cd72a..39003e6 100644 --- a/src/main/java/dev/frydae/emcutils/mixins/ClientEntityPlayerMixin.java +++ b/src/main/java/dev/frydae/emcutils/mixins/ClientEntityPlayerMixin.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.mixins; import com.google.common.collect.Lists; diff --git a/src/main/java/dev/frydae/emcutils/mixins/ClientPlayNetworkHandlerMixin.java b/src/main/java/dev/frydae/emcutils/mixins/ClientPlayNetworkHandlerMixin.java index 8080824..b68de4c 100644 --- a/src/main/java/dev/frydae/emcutils/mixins/ClientPlayNetworkHandlerMixin.java +++ b/src/main/java/dev/frydae/emcutils/mixins/ClientPlayNetworkHandlerMixin.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.mixins; import dev.frydae.emcutils.EmpireMinecraftUtilities; @@ -35,7 +59,7 @@ public void onPostReceiveMessage(GameMessageS2CPacket packet, CallbackInfo info) @Inject(at = @At("TAIL"), method = "onGameJoin") public void onGameJoin(GameJoinS2CPacket packet, CallbackInfo info) { - if (Util.IS_ON_EMC) { + if (Util.isOnEMC) { EmpireMinecraftUtilities.onJoinEmpireMinecraft(); ChatChannels.processGameJoin(packet, info); diff --git a/src/main/java/dev/frydae/emcutils/mixins/ConnectScreenMixin.java b/src/main/java/dev/frydae/emcutils/mixins/ConnectScreenMixin.java index db42ab5..fa5b673 100644 --- a/src/main/java/dev/frydae/emcutils/mixins/ConnectScreenMixin.java +++ b/src/main/java/dev/frydae/emcutils/mixins/ConnectScreenMixin.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.mixins; import dev.frydae.emcutils.utils.Util; @@ -14,6 +38,6 @@ public class ConnectScreenMixin { @Inject(method = "connect(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/network/ServerAddress;)V", at = @At(value = "HEAD")) public void onConnect(MinecraftClient client, ServerAddress address, CallbackInfo ci) { Util.setServerAddress(String.valueOf(address)); - Util.IS_ON_EMC = address.getAddress().matches(".*.emc.gs?."); + Util.isOnEMC = address.getAddress().matches(".*.emc.gs?."); } } diff --git a/src/main/java/dev/frydae/emcutils/mixins/IdentifierMixin.java b/src/main/java/dev/frydae/emcutils/mixins/IdentifierMixin.java index c46ee45..cd34240 100644 --- a/src/main/java/dev/frydae/emcutils/mixins/IdentifierMixin.java +++ b/src/main/java/dev/frydae/emcutils/mixins/IdentifierMixin.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.mixins; import net.minecraft.util.Identifier; diff --git a/src/main/java/dev/frydae/emcutils/mixins/MinecraftClientMixin.java b/src/main/java/dev/frydae/emcutils/mixins/MinecraftClientMixin.java index 8378c67..ea6277b 100644 --- a/src/main/java/dev/frydae/emcutils/mixins/MinecraftClientMixin.java +++ b/src/main/java/dev/frydae/emcutils/mixins/MinecraftClientMixin.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.mixins; import dev.frydae.emcutils.features.vaultButtons.VaultScreen; diff --git a/src/main/java/dev/frydae/emcutils/mixins/PlayerListHudAccessor.java b/src/main/java/dev/frydae/emcutils/mixins/PlayerListHudAccessor.java index 28287ea..dae7eb6 100644 --- a/src/main/java/dev/frydae/emcutils/mixins/PlayerListHudAccessor.java +++ b/src/main/java/dev/frydae/emcutils/mixins/PlayerListHudAccessor.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.mixins; import com.google.common.collect.Ordering; diff --git a/src/main/java/dev/frydae/emcutils/mixins/PlayerListHudMixin.java b/src/main/java/dev/frydae/emcutils/mixins/PlayerListHudMixin.java index 370f2f5..4868dac 100644 --- a/src/main/java/dev/frydae/emcutils/mixins/PlayerListHudMixin.java +++ b/src/main/java/dev/frydae/emcutils/mixins/PlayerListHudMixin.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.mixins; import dev.frydae.emcutils.features.TabListOrganizer; diff --git a/src/main/java/dev/frydae/emcutils/mixins/ScreenMixin.java b/src/main/java/dev/frydae/emcutils/mixins/ScreenMixin.java index 12009c9..1eb6c9c 100644 --- a/src/main/java/dev/frydae/emcutils/mixins/ScreenMixin.java +++ b/src/main/java/dev/frydae/emcutils/mixins/ScreenMixin.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.mixins; import dev.frydae.emcutils.interfaces.ScreenAccessor; diff --git a/src/main/java/dev/frydae/emcutils/mixins/voxelMap/GuiPersistentMapMixin.java b/src/main/java/dev/frydae/emcutils/mixins/voxelMap/GuiPersistentMapMixin.java index 3305c13..e704f8a 100644 --- a/src/main/java/dev/frydae/emcutils/mixins/voxelMap/GuiPersistentMapMixin.java +++ b/src/main/java/dev/frydae/emcutils/mixins/voxelMap/GuiPersistentMapMixin.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.mixins.voxelMap; import com.mamiyaotaru.voxelmap.gui.overridden.Popup; @@ -25,7 +49,7 @@ public void redirectTeleport(Popup popup, int action, CallbackInfo ci, float cursorX, float cursorY, float cursorCoordX, float cursorCoordZ) { if (action == 3) { - if (Util.IS_ON_EMC) { + if (Util.isOnEMC) { int x = selectedWaypoint != null ? selectedWaypoint.getX() : (int) Math.floor(cursorCoordX); int z = selectedWaypoint != null ? selectedWaypoint.getZ() : (int) Math.floor(cursorCoordZ); diff --git a/src/main/java/dev/frydae/emcutils/mixins/voxelMap/GuiWaypointsMixin.java b/src/main/java/dev/frydae/emcutils/mixins/voxelMap/GuiWaypointsMixin.java index 35f0429..d4e24af 100644 --- a/src/main/java/dev/frydae/emcutils/mixins/voxelMap/GuiWaypointsMixin.java +++ b/src/main/java/dev/frydae/emcutils/mixins/voxelMap/GuiWaypointsMixin.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.mixins.voxelMap; import com.mamiyaotaru.voxelmap.gui.GuiWaypoints; @@ -19,7 +43,7 @@ public class GuiWaypointsMixin { @Inject(method = "teleportClicked", at = @At("INVOKE"), remap = false, cancellable = true) public void handleTeleport(CallbackInfo ci) { - if (Util.IS_ON_EMC) { + if (Util.isOnEMC) { Vec3d pos = new Vec3d(selectedWaypoint.getX(), selectedWaypoint.getY(), selectedWaypoint.getZ()); EmpireResidence res = Util.getCurrentServer().getResidenceByLoc(pos); diff --git a/src/main/java/dev/frydae/emcutils/mixins/voxelMap/VoxelMapMixin.java b/src/main/java/dev/frydae/emcutils/mixins/voxelMap/VoxelMapMixin.java index d69cebf..a3e686f 100644 --- a/src/main/java/dev/frydae/emcutils/mixins/voxelMap/VoxelMapMixin.java +++ b/src/main/java/dev/frydae/emcutils/mixins/voxelMap/VoxelMapMixin.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.mixins.voxelMap; import com.mamiyaotaru.voxelmap.MapSettingsManager; @@ -21,7 +45,7 @@ public class VoxelMapMixin { @Inject(method = "checkPermissionMessages", remap = false, at = @At(value = "TAIL")) public void disableFeatures(MinecraftClient mc, CallbackInfo ci) { - if (Util.IS_ON_EMC) { + if (Util.isOnEMC) { radarOptions.radarAllowed = false; mapOptions.cavesAllowed = false; } diff --git a/src/main/java/dev/frydae/emcutils/tasks/GetChatAlertPitchTask.java b/src/main/java/dev/frydae/emcutils/tasks/GetChatAlertPitchTask.java index 12d506d..f02bac9 100644 --- a/src/main/java/dev/frydae/emcutils/tasks/GetChatAlertPitchTask.java +++ b/src/main/java/dev/frydae/emcutils/tasks/GetChatAlertPitchTask.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.tasks; import dev.frydae.emcutils.interfaces.Task; diff --git a/src/main/java/dev/frydae/emcutils/tasks/GetChatAlertSoundTask.java b/src/main/java/dev/frydae/emcutils/tasks/GetChatAlertSoundTask.java index bb9f9f5..18ff40a 100644 --- a/src/main/java/dev/frydae/emcutils/tasks/GetChatAlertSoundTask.java +++ b/src/main/java/dev/frydae/emcutils/tasks/GetChatAlertSoundTask.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.tasks; import dev.frydae.emcutils.interfaces.Task; diff --git a/src/main/java/dev/frydae/emcutils/tasks/GetLocationTask.java b/src/main/java/dev/frydae/emcutils/tasks/GetLocationTask.java index 128f317..0eaf768 100644 --- a/src/main/java/dev/frydae/emcutils/tasks/GetLocationTask.java +++ b/src/main/java/dev/frydae/emcutils/tasks/GetLocationTask.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.tasks; import dev.frydae.emcutils.interfaces.Task; diff --git a/src/main/java/dev/frydae/emcutils/tasks/Tasks.java b/src/main/java/dev/frydae/emcutils/tasks/Tasks.java index 6e9fa50..a3f7d2e 100644 --- a/src/main/java/dev/frydae/emcutils/tasks/Tasks.java +++ b/src/main/java/dev/frydae/emcutils/tasks/Tasks.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.tasks; import dev.frydae.emcutils.EmpireMinecraftUtilities; diff --git a/src/main/java/dev/frydae/emcutils/utils/Config.java b/src/main/java/dev/frydae/emcutils/utils/Config.java index 79b334c..d86235b 100644 --- a/src/main/java/dev/frydae/emcutils/utils/Config.java +++ b/src/main/java/dev/frydae/emcutils/utils/Config.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.utils; import dev.frydae.emcutils.features.TabListOrganizer; @@ -14,6 +38,7 @@ public class Config extends MidnightConfig { @Getter @Entry public static TabListCurrentServerPlacement tabListCurrentServerPlacement = TabListCurrentServerPlacement.TOP; @Getter @Entry(min=-15,max=30) public static int chatAlertPitch = 0; @Getter @Entry public static ChatAlertSound chatAlertSound = ChatAlertSound.LEVEL_UP; + @Getter @Entry public static boolean dontRunResidenceCollector = false; public static String returnVaultScreenOption() { return darkVaultScreen ? "textures/gui/container/generic_63_dark.png" : "textures/gui/container/generic_63.png"; diff --git a/src/main/java/dev/frydae/emcutils/utils/MidnightConfig.java b/src/main/java/dev/frydae/emcutils/utils/MidnightConfig.java index af8b889..7f08fd5 100644 --- a/src/main/java/dev/frydae/emcutils/utils/MidnightConfig.java +++ b/src/main/java/dev/frydae/emcutils/utils/MidnightConfig.java @@ -1,7 +1,7 @@ /* - * MIT License - * - * Copyright (c) 2020 MidnightDust + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/dev/frydae/emcutils/utils/ModMenuIntegration.java b/src/main/java/dev/frydae/emcutils/utils/ModMenuIntegration.java index 51de42b..af7453c 100644 --- a/src/main/java/dev/frydae/emcutils/utils/ModMenuIntegration.java +++ b/src/main/java/dev/frydae/emcutils/utils/ModMenuIntegration.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.utils; import com.terraformersmc.modmenu.api.ConfigScreenFactory; diff --git a/src/main/java/dev/frydae/emcutils/utils/Util.java b/src/main/java/dev/frydae/emcutils/utils/Util.java index 7d1b08a..7eaaaed 100644 --- a/src/main/java/dev/frydae/emcutils/utils/Util.java +++ b/src/main/java/dev/frydae/emcutils/utils/Util.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2021 MrFrydae + * Copyright (c) 2021 wafflecoffee + * Copyright (c) 2021 djlawler + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package dev.frydae.emcutils.utils; import com.google.common.collect.Lists; @@ -23,7 +47,7 @@ @SuppressWarnings({"unused", "Convert2Lambda", "BusyWait"}) public class Util { - public static boolean IS_ON_EMC = false; + public static boolean isOnEMC = false; @Getter public static String world; public static boolean hideFeatureMessages; @Getter @Setter private static String serverAddress; @@ -32,7 +56,8 @@ public class Util { @Getter private static int playerGroupId = 0; private static volatile Util singleton; @Getter @Setter private boolean shouldRunTasks = false; - public static boolean HAS_VOXELMAP = false; + public static boolean hasVoxelMap = false; + public static boolean worldLoaded = false; public static ClientPlayerEntity getPlayer() { return MinecraftClient.getInstance().player; @@ -113,6 +138,8 @@ public void run() { command = command.substring(1); } + Thread.sleep(1500); // FIXME: Replace with a more permanent solution to prevent it from sending commands before the world is loaded + Util.getPlayer().sendChatMessage("/" + command); Thread.sleep(100); @@ -186,7 +213,7 @@ public static void hasVoxelMap() { try { Class.forName("com.mamiyaotaru.voxelmap.VoxelMap"); LogManager.getLogger(MODID).info(MODID + " found VoxelMap - enabling integrations"); - HAS_VOXELMAP = true; + hasVoxelMap = true; } catch (ClassNotFoundException ex) { LogManager.getLogger(MODID).info(MODID + " did not find VoxelMap - you might get some weird errors in console, which you can ignore"); } diff --git a/src/main/resources/assets/emcutils/lang/en_us.json b/src/main/resources/assets/emcutils/lang/en_us.json index e4a9e49..e5d4f78 100644 --- a/src/main/resources/assets/emcutils/lang/en_us.json +++ b/src/main/resources/assets/emcutils/lang/en_us.json @@ -16,5 +16,7 @@ "emcutils.midnightconfig.enum.ChatAlertSound.LEVEL_UP": "Level up", "emcutils.midnightconfig.enum.ChatAlertSound.ORB_PICKUP": "Orb pickup", "emcutils.midnightconfig.enum.ChatAlertSound.NOTE_PLING": "Note pling", - "emcutils.midnightconfig.enum.ChatAlertSound.ITEM_PICKUP": "Level up" + "emcutils.midnightconfig.enum.ChatAlertSound.ITEM_PICKUP": "Level up", + "emcutils.midnightconfig.dontRunResidenceCollector": "Don't run residence collector", + "emcutils.midnightconfig.dontRunResidenceCollector.tooltip": "The following config option can be enabled if you're running \n on a very slow connection to prevent spam in the console.\n Note, though, that this will disable cross-server visit \n command integration and VoxelMap integration." } \ No newline at end of file