Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
update error message
  • Loading branch information
OliverSchlueter committed Aug 19, 2024
1 parent 55fd80a commit d344e1e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
minecraftVersion=1.21.1
fancyLibVersion=1.0.31
fancyAnalyticsVersion=0.0.7
fancyAnalyticsVersion=0.0.8
plotsquaredVersion=7.2.0
chatcolorhandlerVersion=v2.5.3
cloudCoreVersion=2.0.0-rc.2
Expand Down
17 changes: 13 additions & 4 deletions src/main/java/de/oliver/fancynpcs/FancyNpcs.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.oliver.fancynpcs;

import de.oliver.fancyanalytics.api.Event;
import de.oliver.fancyanalytics.api.FancyAnalyticsAPI;
import de.oliver.fancyanalytics.api.MetricSupplier;
import de.oliver.fancylib.FancyLib;
Expand Down Expand Up @@ -56,6 +57,7 @@ public class FancyNpcs extends JavaPlugin implements FancyNpcsPlugin {
private final VersionConfig versionConfig;
private final FeatureFlagConfig featureFlagConfig;
private final VersionFetcher versionFetcher;
private final FancyAnalyticsAPI fancyAnalytics;
private CloudCommandManager commandManager;
private TextConfig textConfig;
private Translator translator;
Expand All @@ -73,6 +75,10 @@ public FancyNpcs() {
this.config = new FancyNpcsConfigImpl();
this.versionFetcher = new MasterVersionFetcher(getName());
this.versionConfig = new VersionConfig(this, versionFetcher);

fancyAnalytics = new FancyAnalyticsAPI("34c5a33d-0ff0-48b1-8b1c-53620a690c6e", "ca2baf32-1fd2-4baa-a38a-f12ed8ab24a4", "Y7EP2jJjYWExZjdmMDkwNTQ5ZmRbIGUI");
FancyAnalyticsAPI.setDisableLogging(true);

this.featureFlagConfig = new FeatureFlagConfig(this);
}

Expand Down Expand Up @@ -104,9 +110,14 @@ public void onLoad() {
PluginManager pluginManager = Bukkit.getPluginManager();

if (npcAdapter == null) {
fancyAnalytics.sendEvent(new Event("pluginLoadingWithUnsupportedVersion")
.withProperty("version", mcVersion)
.withProperty("pluginVersion", getPluginMeta().getVersion())
);

getLogger().warning("--------------------------------------------------");
getLogger().warning("Unsupported minecraft server version.");
getLogger().warning("Please update the server to " + String.join(" / ", SUPPORTED_VERSIONS) + ".");
getLogger().warning("Please update the server to " + String.join(" / ", SUPPORTED_VERSIONS));
getLogger().warning("Disabling the FancyNpcs plugin.");
getLogger().warning("--------------------------------------------------");
pluginManager.disablePlugin(this);
Expand Down Expand Up @@ -149,7 +160,7 @@ public void onEnable() {
getLogger().warning("""
-------------------------------------------------------
You are not using the latest version the FancyNpcs plugin.
You are not using the latest version of the FancyNpcs plugin.
Please update to the newest version (%s).
%s
-------------------------------------------------------
Expand All @@ -174,8 +185,6 @@ Please update to the newest version (%s).

int randomRes = new Random(System.currentTimeMillis()).nextInt(100);
if (USE_FANCYANALYTICS_FEATURE_FLAG.isEnabled() || isDevelopmentBuild || randomRes < 15) {
FancyAnalyticsAPI.setDisableLogging(true);
FancyAnalyticsAPI fancyAnalytics = new FancyAnalyticsAPI("34c5a33d-0ff0-48b1-8b1c-53620a690c6e", "ca2baf32-1fd2-4baa-a38a-f12ed8ab24a4", "Y7EP2jJjYWExZjdmMDkwNTQ5ZmRbIGUI");
fancyAnalytics.registerDefaultPluginMetrics(instance);
fancyAnalytics.registerLogger(getLogger());
fancyAnalytics.registerLogger(Bukkit.getLogger());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/oliver/fancynpcs/NpcManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public NpcManagerImpl(JavaPlugin plugin, Function<NpcData, Npc> npcAdapter) {

public void registerNpc(Npc npc) {
if (!FancyNpcs.PLAYER_NPCS_FEATURE_FLAG.isEnabled() && npcs.values().stream().anyMatch(npc1 -> npc1.getData().getName().equals(npc.getData().getName()))) {
throw new IllegalStateException("An NPC with the name " + npc.getData().getName() + " already exists!");
throw new IllegalStateException("An NPC with this name already exists");
} else {
npcs.put(npc.getData().getId(), npc);
}
Expand Down

0 comments on commit d344e1e

Please sign in to comment.