mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Allow /acr report for offline players & small multiversion improvements
This commit is contained in:
1 parent
9211003d6d
commit
a84b573fa8
3 files changed
+172
-175
No files matched your search
+144
-140
@@ -16,7 +16,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.rammelkast.anticheatreloaded.command.executors;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -25,8 +24,8 @@ import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.rammelkast.anticheatreloaded.AntiCheatReloaded;
|
||||
import com.rammelkast.anticheatreloaded.check.CheckType;
|
||||
@@ -38,153 +37,158 @@ import com.rammelkast.anticheatreloaded.util.Utilities;
|
||||
|
||||
public class CommandReport extends CommandBase {
|
||||
|
||||
private static final String NAME = "AntiCheatReloaded Reports";
|
||||
private static final String COMMAND = "report";
|
||||
private static final String USAGE = "anticheat report [group/user]";
|
||||
private static final Permission PERMISSION = Permission.SYSTEM_REPORT;
|
||||
private static final String[] HELP = {
|
||||
GRAY + "Use: " + GOLD + "/anticheat report [group]" + GRAY + " to see all users in a given group",
|
||||
GRAY + "Use: " + GOLD + "/anticheat report [user]" + GRAY + " to see a single user's report",
|
||||
GRAY + "Use: " + GOLD + "/anticheat report [user/group] [num]" + GRAY + " to see pages of a report",
|
||||
};
|
||||
private static final String NAME = "AntiCheatReloaded Reports";
|
||||
private static final String COMMAND = "report";
|
||||
private static final String USAGE = "anticheat report [group/user]";
|
||||
private static final Permission PERMISSION = Permission.SYSTEM_REPORT;
|
||||
private static final String[] HELP = {
|
||||
GRAY + "Use: " + GOLD + "/anticheat report [group]" + GRAY + " to see all users in a given group",
|
||||
GRAY + "Use: " + GOLD + "/anticheat report [user]" + GRAY + " to see a single user's report",
|
||||
GRAY + "Use: " + GOLD + "/anticheat report [user/group] [num]" + GRAY + " to see pages of a report", };
|
||||
|
||||
public CommandReport() {
|
||||
super(NAME, COMMAND, USAGE, HELP, PERMISSION);
|
||||
}
|
||||
public CommandReport() {
|
||||
super(NAME, COMMAND, USAGE, HELP, PERMISSION);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void execute(CommandSender cs, String[] args) {
|
||||
if (args.length >= 1) {
|
||||
int page = 1;
|
||||
if (args.length == 2) {
|
||||
if (Utilities.isInt(args[1])) {
|
||||
page = Integer.parseInt(args[1]);
|
||||
} else {
|
||||
cs.sendMessage(RED + "Not a valid page number: " + WHITE + args[1]);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void execute(CommandSender cs, String[] args) {
|
||||
if (args.length >= 1) {
|
||||
int page = 1;
|
||||
if (args.length == 2) {
|
||||
if (Utilities.isInt(args[1])) {
|
||||
page = Integer.parseInt(args[1]);
|
||||
} else {
|
||||
cs.sendMessage(RED + "Not a valid page number: " + WHITE + args[1]);
|
||||
}
|
||||
}
|
||||
|
||||
if ("low".equalsIgnoreCase(args[0])) {
|
||||
groupReport(cs, null, page);
|
||||
}
|
||||
else if ("all".equalsIgnoreCase(args[0])) {
|
||||
cs.sendMessage(GREEN + "Low: " + WHITE + USER_MANAGER.getUsersInGroup(null).size() + " players");
|
||||
for (Group g : CONFIG.getGroups().getGroups()) {
|
||||
int numPlayers = USER_MANAGER.getUsersInGroup(g).size();
|
||||
cs.sendMessage(g.getColor() + g.getName() + WHITE + ": " + numPlayers + " players");
|
||||
}
|
||||
cs.sendMessage(GRAY + "Use " + GOLD + "/anticheat report [group]" + GRAY + " for a list of players in each group.");
|
||||
} else {
|
||||
// Test groups
|
||||
for (Group group : CONFIG.getGroups().getGroups()) {
|
||||
if (group.getName().equalsIgnoreCase(args[0]) || "low".equalsIgnoreCase(args[0]) || "all".equalsIgnoreCase(args[0])) {
|
||||
groupReport(cs, group, page);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Player targetPlayer = Bukkit.getPlayer(args[0]);
|
||||
if (targetPlayer == null) {
|
||||
cs.sendMessage(RED + "Not a valid group or user: " + WHITE + args[0]);
|
||||
return;
|
||||
}
|
||||
if ("low".equalsIgnoreCase(args[0])) {
|
||||
groupReport(cs, null, page);
|
||||
} else if ("all".equalsIgnoreCase(args[0])) {
|
||||
cs.sendMessage(GREEN + "Low: " + WHITE + USER_MANAGER.getUsersInGroup(null).size() + " players");
|
||||
for (Group g : CONFIG.getGroups().getGroups()) {
|
||||
int numPlayers = USER_MANAGER.getUsersInGroup(g).size();
|
||||
cs.sendMessage(g.getColor() + g.getName() + WHITE + ": " + numPlayers + " players");
|
||||
}
|
||||
cs.sendMessage(GRAY + "Use " + GOLD + "/anticheat report [group]" + GRAY
|
||||
+ " for a list of players in each group.");
|
||||
} else {
|
||||
// Test groups
|
||||
for (Group group : CONFIG.getGroups().getGroups()) {
|
||||
if (group.getName().equalsIgnoreCase(args[0]) || "low".equalsIgnoreCase(args[0])
|
||||
|| "all".equalsIgnoreCase(args[0])) {
|
||||
groupReport(cs, group, page);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Test users
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
if (player.getUniqueId().equals(Bukkit.getPlayer(args[0]).getUniqueId())) {
|
||||
User user = AntiCheatReloaded.getManager().getUserManager().getUser(player.getUniqueId());
|
||||
playerReport(cs, user, page);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
OfflinePlayer targetPlayer = Bukkit.getOfflinePlayer(args[0]);
|
||||
if (targetPlayer == null) {
|
||||
cs.sendMessage(RED + "Not a valid group or user: " + WHITE + args[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
// Neither of these
|
||||
cs.sendMessage(RED + "Not a valid group or user: " + WHITE + args[0]);
|
||||
}
|
||||
} else {
|
||||
sendHelp(cs);
|
||||
}
|
||||
}
|
||||
User user = AntiCheatReloaded.getManager().getUserManager().getUser(targetPlayer.getUniqueId());
|
||||
if (user != null) {
|
||||
playerReport(cs, user, page);
|
||||
return;
|
||||
}
|
||||
|
||||
private void groupReport(CommandSender cs, Group group, int page) {
|
||||
List<User> users = USER_MANAGER.getUsersInGroup(group);
|
||||
ChatColor color = group == null ? GREEN : group.getColor();
|
||||
String groupName = group == null ? "Low" : group.getName();
|
||||
int pages = (int) Math.ceil(((float) users.size()) / 7);
|
||||
if (page <= pages && page > 0) {
|
||||
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page " + page + "/" + pages + "" + GOLD + "]----------------------");
|
||||
cs.sendMessage(GRAY + "Group: " + color + groupName);
|
||||
for (int x = 0; x < 7; x++) {
|
||||
int index = ((page - 1) * 6) + (x + ((page - 1) * 1));
|
||||
if (index < users.size()) {
|
||||
String player = users.get(index).getName();
|
||||
cs.sendMessage(GRAY + player);
|
||||
}
|
||||
}
|
||||
cs.sendMessage(MENU_END);
|
||||
} else {
|
||||
if (pages == 0) {
|
||||
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page 1/1" + GOLD + "]----------------------");
|
||||
cs.sendMessage(GRAY + "Group: " + color + groupName);
|
||||
cs.sendMessage(GRAY + "There are no users in this group.");
|
||||
cs.sendMessage(MENU_END);
|
||||
} else {
|
||||
cs.sendMessage(RED + "Page not found. Requested " + WHITE + page + RED + ", Max " + WHITE + pages);
|
||||
}
|
||||
}
|
||||
}
|
||||
cs.sendMessage(RED + "Not a valid group or user: " + WHITE + args[0]);
|
||||
}
|
||||
} else {
|
||||
sendHelp(cs);
|
||||
}
|
||||
}
|
||||
|
||||
private void playerReport(CommandSender cs, User user, int page) {
|
||||
List<CheckType> types = new ArrayList<CheckType>();
|
||||
for (CheckType type : CheckType.values()) {
|
||||
if (type.getUses(user.getUUID()) > 0) {
|
||||
types.add(type);
|
||||
}
|
||||
}
|
||||
private void groupReport(CommandSender cs, Group group, int page) {
|
||||
List<User> users = USER_MANAGER.getUsersInGroup(group);
|
||||
ChatColor color = group == null ? GREEN : group.getColor();
|
||||
String groupName = group == null ? "Low" : group.getName();
|
||||
int pages = (int) Math.ceil(((float) users.size()) / 7);
|
||||
if (page <= pages && page > 0) {
|
||||
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page " + page + "/" + pages + "" + GOLD
|
||||
+ "]----------------------");
|
||||
cs.sendMessage(GRAY + "Group: " + color + groupName);
|
||||
for (int x = 0; x < 7; x++) {
|
||||
int index = ((page - 1) * 6) + (x + ((page - 1) * 1));
|
||||
if (index < users.size()) {
|
||||
String player = users.get(index).getName();
|
||||
cs.sendMessage(GRAY + player);
|
||||
}
|
||||
}
|
||||
cs.sendMessage(MENU_END);
|
||||
} else {
|
||||
if (pages == 0) {
|
||||
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page 1/1" + GOLD + "]----------------------");
|
||||
cs.sendMessage(GRAY + "Group: " + color + groupName);
|
||||
cs.sendMessage(GRAY + "There are no users in this group.");
|
||||
cs.sendMessage(MENU_END);
|
||||
} else {
|
||||
cs.sendMessage(RED + "Page not found. Requested " + WHITE + page + RED + ", Max " + WHITE + pages);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UUID uuid = user.getUUID();
|
||||
String name = user.getName();
|
||||
int pages = (int) Math.ceil(((float) types.size()) / 6);
|
||||
private void playerReport(CommandSender cs, User user, int page) {
|
||||
List<CheckType> types = new ArrayList<CheckType>();
|
||||
for (CheckType type : CheckType.values()) {
|
||||
if (type.getUses(user.getUUID()) > 0) {
|
||||
types.add(type);
|
||||
}
|
||||
}
|
||||
|
||||
Group group = user.getGroup();
|
||||
String groupString = GREEN + "Low";
|
||||
UUID uuid = user.getUUID();
|
||||
String name = user.getName();
|
||||
int pages = (int) Math.ceil(((float) types.size()) / 6);
|
||||
|
||||
if (group != null) {
|
||||
groupString = group.getColor() + group.getName();
|
||||
}
|
||||
groupString += " (" + user.getLevel() + ")";
|
||||
Group group = user.getGroup();
|
||||
String groupString = GREEN + "Low";
|
||||
|
||||
if (page <= pages && page > 0) {
|
||||
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page " + page + "/" + pages + "" + GOLD + "]----------------------");
|
||||
cs.sendMessage(GRAY + "Player: " + WHITE + name);
|
||||
cs.sendMessage(GRAY + "Ping: " + WHITE + user.getPing() + "ms " + (user.isLagging() ? ChatColor.RED + "(lagging)" : ChatColor.GREEN + "(not lagging)"));
|
||||
cs.sendMessage(GRAY + "Group: " + groupString);
|
||||
for (int x = 0; x < 6; x++) {
|
||||
int index = ((page - 1) * 5) + (x + ((page - 1)));
|
||||
if (index < types.size()) {
|
||||
CheckType type = types.get(index);
|
||||
int use = type.getUses(uuid);
|
||||
ChatColor color = WHITE;
|
||||
if (use >= 20) {
|
||||
color = YELLOW;
|
||||
} else if (use > 50) {
|
||||
color = RED;
|
||||
}
|
||||
cs.sendMessage(GRAY + type.getName() + ": " + color + use);
|
||||
}
|
||||
}
|
||||
cs.sendMessage(MENU_END);
|
||||
} else {
|
||||
if (pages == 0 && page == 1) {
|
||||
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page 1/1" + GOLD + "]----------------------");
|
||||
cs.sendMessage(GRAY + "Player: " + WHITE + name);
|
||||
cs.sendMessage(GRAY + "Ping: " + WHITE + user.getPing() + "ms " + (user.isLagging() ? ChatColor.RED + "(lagging)" : ChatColor.GREEN + "(not lagging)"));
|
||||
cs.sendMessage(GRAY + "Group: " + groupString);
|
||||
cs.sendMessage(GRAY + "This user has not failed any checks.");
|
||||
cs.sendMessage(MENU_END);
|
||||
} else {
|
||||
cs.sendMessage(RED + "Page not found. Requested " + WHITE + page + RED + ", Max " + WHITE + pages + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (group != null) {
|
||||
groupString = group.getColor() + group.getName();
|
||||
}
|
||||
groupString += " (" + user.getLevel() + ")";
|
||||
|
||||
if (page <= pages && page > 0) {
|
||||
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page " + page + "/" + pages + "" + GOLD
|
||||
+ "]----------------------");
|
||||
cs.sendMessage(GRAY + "Player: " + WHITE + name);
|
||||
int ping = user.getPing();
|
||||
cs.sendMessage(GRAY + "Ping: " + ((ping == -1) ? (RED + "Offline")
|
||||
: (WHITE + "" + ping + "ms "
|
||||
+ (user.isLagging() ? ChatColor.RED + "(lagging)" : ChatColor.GREEN + "(not lagging)"))));
|
||||
cs.sendMessage(GRAY + "Group: " + groupString);
|
||||
for (int x = 0; x < 6; x++) {
|
||||
int index = ((page - 1) * 5) + (x + ((page - 1)));
|
||||
if (index < types.size()) {
|
||||
CheckType type = types.get(index);
|
||||
int use = type.getUses(uuid);
|
||||
ChatColor color = WHITE;
|
||||
if (use >= 20) {
|
||||
color = YELLOW;
|
||||
} else if (use > 50) {
|
||||
color = RED;
|
||||
}
|
||||
cs.sendMessage(GRAY + type.getName() + ": " + color + use);
|
||||
}
|
||||
}
|
||||
cs.sendMessage(MENU_END);
|
||||
} else {
|
||||
if (pages == 0 && page == 1) {
|
||||
cs.sendMessage(GOLD + "----------------------[" + GRAY + "Page 1/1" + GOLD + "]----------------------");
|
||||
cs.sendMessage(GRAY + "Player: " + WHITE + name);
|
||||
int ping = user.getPing();
|
||||
cs.sendMessage(GRAY + "Ping: " + ((ping == -1) ? (RED + "Offline")
|
||||
: (WHITE + "" + ping + "ms "
|
||||
+ (user.isLagging() ? ChatColor.RED + "(lagging)" : ChatColor.GREEN + "(not lagging)"))));
|
||||
cs.sendMessage(GRAY + "Group: " + groupString);
|
||||
cs.sendMessage(GRAY + "This user has not failed any checks.");
|
||||
cs.sendMessage(MENU_END);
|
||||
} else {
|
||||
cs.sendMessage(RED + "Page not found. Requested " + WHITE + page + RED + ", Max " + WHITE + pages + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,14 +40,13 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.BoundingBox;
|
||||
import org.bukkit.util.NumberConversions;
|
||||
|
||||
import com.comphenix.protocol.utility.MinecraftVersion;
|
||||
|
||||
public final class Utilities {
|
||||
private static final List<Material> INSTANT_BREAK = new ArrayList<Material>();
|
||||
private static final List<Material> FOOD = new ArrayList<Material>();
|
||||
private static final List<Material> CLIMBABLE = new ArrayList<Material>();
|
||||
private static final Map<Material, Material> COMBO = new HashMap<Material, Material>();
|
||||
|
||||
public static final Material LILY_PAD;
|
||||
public static final Material COB_WEB;
|
||||
|
||||
public static final double JUMP_MOTION_Y = 0.41999998688697815;
|
||||
|
||||
@@ -431,10 +430,11 @@ public final class Utilities {
|
||||
*/
|
||||
public static boolean isOnLilyPad(Player player) {
|
||||
Block block = player.getLocation().getBlock();
|
||||
return block.getType() == LILY_PAD || block.getRelative(BlockFace.NORTH).getType() == LILY_PAD
|
||||
|| block.getRelative(BlockFace.SOUTH).getType() == LILY_PAD
|
||||
|| block.getRelative(BlockFace.EAST).getType() == LILY_PAD
|
||||
|| block.getRelative(BlockFace.WEST).getType() == LILY_PAD;
|
||||
return block.getType() == XMaterial.LILY_PAD.parseMaterial()
|
||||
|| block.getRelative(BlockFace.NORTH).getType() == XMaterial.LILY_PAD.parseMaterial()
|
||||
|| block.getRelative(BlockFace.SOUTH).getType() == XMaterial.LILY_PAD.parseMaterial()
|
||||
|| block.getRelative(BlockFace.EAST).getType() == XMaterial.LILY_PAD.parseMaterial()
|
||||
|| block.getRelative(BlockFace.WEST).getType() == XMaterial.LILY_PAD.parseMaterial();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -504,7 +504,7 @@ public final class Utilities {
|
||||
&& location.getBlock().getRelative(BlockFace.SOUTH_EAST).isLiquid()
|
||||
&& location.getBlock().getRelative(BlockFace.SOUTH_WEST).isLiquid();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine whether a player is near a web
|
||||
*
|
||||
@@ -520,7 +520,6 @@ public final class Utilities {
|
||||
|| isWeb(player.getLocation().getBlock().getRelative(BlockFace.EAST))
|
||||
|| isWeb(player.getLocation().getBlock().getRelative(BlockFace.WEST));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine whether a block is a web
|
||||
@@ -529,7 +528,7 @@ public final class Utilities {
|
||||
* @return true if web
|
||||
*/
|
||||
public static boolean isWeb(Block block) {
|
||||
return block.getType() == COB_WEB;
|
||||
return block.getType() == XMaterial.COBWEB.parseMaterial();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -539,9 +538,11 @@ public final class Utilities {
|
||||
* @return true if in web
|
||||
*/
|
||||
public static boolean isInWeb(Player player) {
|
||||
return player.getLocation().getBlock().getType() == COB_WEB
|
||||
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == COB_WEB
|
||||
|| player.getLocation().getBlock().getRelative(BlockFace.UP).getType() == COB_WEB;
|
||||
return player.getLocation().getBlock().getType() == XMaterial.COBWEB.parseMaterial()
|
||||
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == XMaterial.COBWEB
|
||||
.parseMaterial()
|
||||
|| player.getLocation().getBlock().getRelative(BlockFace.UP).getType() == XMaterial.COBWEB
|
||||
.parseMaterial();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -779,7 +780,7 @@ public final class Utilities {
|
||||
}
|
||||
|
||||
public static boolean isHoneyBlock(Block block) {
|
||||
if (!VersionUtil.isOfVersion("v1_15")) {
|
||||
if (MinecraftVersion.getCurrentVersion().isAtLeast(MinecraftVersion.BEE_UPDATE)) {
|
||||
return false;
|
||||
}
|
||||
return block.getType() == XMaterial.HONEY_BLOCK.parseMaterial();
|
||||
@@ -788,9 +789,6 @@ public final class Utilities {
|
||||
static {
|
||||
// Start 1.8.8
|
||||
if (VersionUtil.isBountifulUpdate()) {
|
||||
LILY_PAD = XMaterial.LILY_PAD.parseMaterial();
|
||||
COB_WEB = XMaterial.COBWEB.parseMaterial();
|
||||
|
||||
// Start instant break materials
|
||||
INSTANT_BREAK.add(XMaterial.COMPARATOR.parseMaterial());
|
||||
INSTANT_BREAK.add(XMaterial.REPEATER.parseMaterial());
|
||||
@@ -807,7 +805,7 @@ public final class Utilities {
|
||||
INSTANT_BREAK.add(Material.DEAD_BUSH);
|
||||
INSTANT_BREAK.add(Material.GRASS);
|
||||
INSTANT_BREAK.add(XMaterial.TALL_GRASS.parseMaterial());
|
||||
INSTANT_BREAK.add(LILY_PAD);
|
||||
INSTANT_BREAK.add(XMaterial.LILY_PAD.parseMaterial());
|
||||
INSTANT_BREAK.add(Material.MELON_STEM);
|
||||
INSTANT_BREAK.add(Material.MELON_STEM);
|
||||
INSTANT_BREAK.add(Material.BROWN_MUSHROOM);
|
||||
@@ -856,10 +854,10 @@ public final class Utilities {
|
||||
// Start combos
|
||||
COMBO.put(Material.SHEARS, XMaterial.WHITE_WOOL.parseMaterial());
|
||||
|
||||
COMBO.put(Material.IRON_SWORD, COB_WEB);
|
||||
COMBO.put(Material.DIAMOND_SWORD, COB_WEB);
|
||||
COMBO.put(Material.STONE_SWORD, COB_WEB);
|
||||
COMBO.put(XMaterial.WOODEN_SWORD.parseMaterial(), COB_WEB);
|
||||
COMBO.put(Material.IRON_SWORD, XMaterial.COBWEB.parseMaterial());
|
||||
COMBO.put(Material.DIAMOND_SWORD, XMaterial.COBWEB.parseMaterial());
|
||||
COMBO.put(Material.STONE_SWORD, XMaterial.COBWEB.parseMaterial());
|
||||
COMBO.put(XMaterial.WOODEN_SWORD.parseMaterial(), XMaterial.COBWEB.parseMaterial());
|
||||
// End combos
|
||||
|
||||
// Start climbable
|
||||
@@ -871,8 +869,7 @@ public final class Utilities {
|
||||
// End 1.8.8
|
||||
// Start other version
|
||||
else {
|
||||
LILY_PAD = Material.LILY_PAD;
|
||||
COB_WEB = Material.COBWEB;
|
||||
MinecraftVersion currentVersion = MinecraftVersion.getCurrentVersion();
|
||||
|
||||
// Start instant break materials
|
||||
INSTANT_BREAK.add(Material.COMPARATOR);
|
||||
@@ -918,14 +915,13 @@ public final class Utilities {
|
||||
INSTANT_BREAK.add(Material.TALL_SEAGRASS);
|
||||
INSTANT_BREAK.add(Material.WHEAT);
|
||||
// Start 1.14 objects
|
||||
if (VersionUtil.isOfVersion("v1_14") || VersionUtil.isOfVersion("v1_15")
|
||||
|| VersionUtil.isOfVersion("v1_16")) {
|
||||
if (currentVersion.isAtLeast(MinecraftVersion.VILLAGE_UPDATE)) {
|
||||
INSTANT_BREAK.add(Material.BAMBOO_SAPLING);
|
||||
INSTANT_BREAK.add(Material.CORNFLOWER);
|
||||
}
|
||||
// End 1.14 objects
|
||||
// Start 1.15 objects
|
||||
if (VersionUtil.isOfVersion("v1_15") || VersionUtil.isOfVersion("v1_16")) {
|
||||
if (currentVersion.isAtLeast(MinecraftVersion.BEE_UPDATE)) {
|
||||
INSTANT_BREAK.add(Material.HONEY_BLOCK);
|
||||
}
|
||||
// End 1.15 objects
|
||||
@@ -970,14 +966,13 @@ public final class Utilities {
|
||||
FOOD.add(Material.SPIDER_EYE);
|
||||
FOOD.add(Material.TROPICAL_FISH);
|
||||
// Start 1.14 objects
|
||||
if (VersionUtil.isOfVersion("v1_14") || VersionUtil.isOfVersion("v1_15")
|
||||
|| VersionUtil.isOfVersion("v1_16")) {
|
||||
if (currentVersion.isAtLeast(MinecraftVersion.VILLAGE_UPDATE)) {
|
||||
FOOD.add(Material.SUSPICIOUS_STEW);
|
||||
FOOD.add(Material.SWEET_BERRIES);
|
||||
}
|
||||
// End 1.14 objects
|
||||
// Start 1.15 objects
|
||||
if (VersionUtil.isOfVersion("v1_15") || VersionUtil.isOfVersion("v1_16")) {
|
||||
if (currentVersion.isAtLeast(MinecraftVersion.BEE_UPDATE)) {
|
||||
FOOD.add(Material.HONEY_BOTTLE);
|
||||
}
|
||||
// End 1.15 objects
|
||||
@@ -1013,15 +1008,14 @@ public final class Utilities {
|
||||
CLIMBABLE.add(Material.LADDER);
|
||||
CLIMBABLE.add(Material.WATER);
|
||||
// Start 1.14 objects
|
||||
if (VersionUtil.isOfVersion("v1_14") || VersionUtil.isOfVersion("v1_15")
|
||||
|| VersionUtil.isOfVersion("v1_16")) {
|
||||
if (currentVersion.isAtLeast(MinecraftVersion.VILLAGE_UPDATE)) {
|
||||
CLIMBABLE.add(Material.SCAFFOLDING);
|
||||
CLIMBABLE.add(Material.SWEET_BERRY_BUSH);
|
||||
}
|
||||
// End 1.14 objects
|
||||
|
||||
// Start 1.16 objects
|
||||
if (VersionUtil.isOfVersion("v1_16")) {
|
||||
if (currentVersion.isAtLeast(MinecraftVersion.NETHER_UPDATE)) {
|
||||
CLIMBABLE.add(XMaterial.TWISTING_VINES.parseMaterial());
|
||||
CLIMBABLE.add(XMaterial.TWISTING_VINES_PLANT.parseMaterial());
|
||||
CLIMBABLE.add(XMaterial.WEEPING_VINES.parseMaterial());
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.rammelkast.anticheatreloaded.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -142,7 +141,7 @@ public class VersionUtil {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (player.hasPotionEffect(type))
|
||||
return player.getPotionEffect(type).getAmplifier() + 1;
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user