Added v1_17_R1 support

This commit is contained in:
Zeshan Aslam 2021-06-12 18:42:20 -04:00
parent 3278a39d5d
commit 64ad990db8
5 changed files with 17 additions and 4 deletions

View File

@ -7,10 +7,10 @@ import com.zeshanaslam.actionhealth.commands.HealthCommand;
import com.zeshanaslam.actionhealth.config.ConfigStore;
import com.zeshanaslam.actionhealth.events.HealthListeners;
import com.zeshanaslam.actionhealth.utils.HealthUtil;
import com.zeshanaslam.actionhealth.utils.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;
import org.bstats.bukkit.Metrics;
import java.io.File;
import java.util.ArrayList;

View File

@ -3,10 +3,10 @@ package com.zeshanaslam.actionhealth.config;
import com.zeshanaslam.actionhealth.LookThread;
import com.zeshanaslam.actionhealth.Main;
import com.zeshanaslam.actionhealth.action.ActionStore;
import com.zeshanaslam.actionhealth.utils.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.scheduler.BukkitTask;
import org.bstats.bukkit.Metrics;
import java.util.ArrayList;
import java.util.HashMap;

View File

@ -0,0 +1,11 @@
package com.zeshanaslam.actionhealth.support;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
public class NewAction {
public NewAction(Player player, String message) throws ClassNotFoundException {
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(message));
}
}

View File

@ -268,7 +268,9 @@ public class HealthUtil {
message = ChatColor.translateAlternateColorCodes('&', message);
try {
if (plugin.configStore.mcVersion.equals("v1_16_R1") || plugin.configStore.mcVersion.equals("v1_16_R2") || plugin.configStore.mcVersion.equals("v1_16_R3")) {
if (plugin.configStore.mcVersion.equals("v1_17_R1")) {
new NewAction(player, message);
} else if (plugin.configStore.mcVersion.equals("v1_16_R1") || plugin.configStore.mcVersion.equals("v1_16_R2") || plugin.configStore.mcVersion.equals("v1_16_R3")) {
new PreAction(player, message);
} else if (plugin.configStore.mcVersion.equals("v1_12_R1") || plugin.configStore.mcVersion.startsWith("v1_13") || plugin.configStore.mcVersion.startsWith("v1_14_") || plugin.configStore.mcVersion.startsWith("v1_15_")) {
new LegacyPreAction(player, message);

View File

@ -1,4 +1,4 @@
package org.bstats.bukkit;
package com.zeshanaslam.actionhealth.utils;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;