1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-01 15:03:36 +01:00

Removed unused imports

This commit is contained in:
montlikadani 2021-06-20 18:09:20 +02:00
parent b2df8fd76b
commit cbc22cb491
9 changed files with 26 additions and 21 deletions

View File

@ -22,7 +22,6 @@ import com.gamingmesh.jobs.container.JobItems;
import net.Zrips.CMILib.Colors.CMIChatColor;
import net.Zrips.CMILib.FileHandler.ConfigReader;
import net.Zrips.CMILib.Items.CMIMaterial;
import net.Zrips.CMILib.Logs.CMIDebug;
public class ItemBoostManager {
@ -228,8 +227,8 @@ public class ItemBoostManager {
ITEMS.put(node, item);
}
Jobs.consoleMsg("&e[Jobs] Loaded " + ITEMS.size() + " boosted items!");
cfg.save();
Jobs.consoleMsg("&e[Jobs] Loaded " + ITEMS.size() + " boosted items!");
}
/**

View File

@ -61,10 +61,8 @@ import com.gamingmesh.jobs.hooks.HookManager;
import com.gamingmesh.jobs.stuff.PerformCommands;
import com.gamingmesh.jobs.stuff.Util;
import net.Zrips.CMILib.CMILib;
import net.Zrips.CMILib.ActionBar.CMIActionBar;
import net.Zrips.CMILib.Items.CMIItemStack;
import net.Zrips.CMILib.Logs.CMIDebug;
import net.Zrips.CMILib.NBT.CMINBT;
import net.Zrips.CMILib.Version.Version;

View File

@ -16,7 +16,6 @@ import com.gamingmesh.jobs.container.Job;
import com.gamingmesh.jobs.container.JobItems;
import com.gamingmesh.jobs.container.JobProgression;
import com.gamingmesh.jobs.container.JobsPlayer;
import com.gamingmesh.jobs.stuff.Util;
import net.Zrips.CMILib.Colors.CMIChatColor;
import net.Zrips.CMILib.Items.CMIItemStack;

View File

@ -8,7 +8,6 @@ import org.bukkit.inventory.ItemStack;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.commands.Cmd;
import com.gamingmesh.jobs.stuff.Util;
import net.Zrips.CMILib.Items.CMIItemStack;
import net.Zrips.CMILib.Version.Version;

View File

@ -63,6 +63,8 @@ import net.Zrips.CMILib.Version.Version;
public class ConfigManager {
private final Jobs plugin = org.bukkit.plugin.java.JavaPlugin.getPlugin(Jobs.class);
@Deprecated
private File jobFile;
private File jobsPathFolder;
@ -847,7 +849,6 @@ public class ConfigManager {
if (jobsPathFolder.isDirectory() && jobsPathFolder.listFiles().length == 0) {
try {
Jobs plugin = org.bukkit.plugin.java.JavaPlugin.getPlugin(Jobs.class);
for (String f : Util.getFilesFromPackage("jobs", "", "yml")) {
plugin.saveResource("jobs" + File.separator + f + ".yml", false);
}
@ -900,7 +901,7 @@ public class ConfigManager {
ConfigReader cfg = null;
try {
cfg = new ConfigReader(Jobs.getInstance(), "jobConfig.yml");
cfg = new ConfigReader(plugin, "jobConfig.yml");
} catch (Exception e) {
e.printStackTrace();
return false;

View File

@ -34,7 +34,6 @@ import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.potion.PotionEffectType;
import net.Zrips.CMILib.CMILib;
import net.Zrips.CMILib.Colors.CMIChatColor;
import net.Zrips.CMILib.Items.CMIMaterial;
import net.Zrips.CMILib.NBT.CMINBT;

View File

@ -122,7 +122,6 @@ import net.Zrips.CMILib.Colors.CMIChatColor;
import net.Zrips.CMILib.Entities.CMIEntityType;
import net.Zrips.CMILib.Items.CMIItemStack;
import net.Zrips.CMILib.Items.CMIMaterial;
import net.Zrips.CMILib.Items.ItemManager;
import net.Zrips.CMILib.Version.Version;
public final class JobsPaymentListener implements Listener {
@ -1580,14 +1579,15 @@ public final class JobsPaymentListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerInteract(PlayerInteractEvent event) {
Player p = event.getPlayer();
if (!Jobs.getGCManager().canPerformActionInWorld(p.getWorld()))
return;
final Block block = event.getClickedBlock();
if (block == null)
return;
Player p = event.getPlayer();
if (!Jobs.getGCManager().canPerformActionInWorld(p.getWorld()))
return;
CMIMaterial cmat = CMIMaterial.get(block);
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(p);
Material hand = CMIItemStack.getItemInMainHand(p).getType();

View File

@ -51,49 +51,58 @@ public class Util {
if (Version.isCurrentEqualOrHigher(Version.v1_8_R1)) {
return new ArrayList<>(event.getBlocks());
}
List<Block> blocks = new ArrayList<>();
blocks.add(event.getBlock());
return blocks;
}
public static String getRealType(Entity entity) {
if (Version.isCurrentEqualOrHigher(Version.v1_11_R1)) {
return entity.getType().name();
}
String name = entity.getType().name();
switch (entity.getType().toString()) {
case "GUARDIAN":
org.bukkit.entity.Guardian g = (org.bukkit.entity.Guardian) entity;
if (g.isElder())
if (((org.bukkit.entity.Guardian) entity).isElder())
name = "GuardianElder";
break;
case "HORSE":
Horse horse = (Horse) entity;
if (horse.getVariant().toString().equals("UNDEAD_HORSE"))
name = "HorseZombie";
if (horse.getVariant().toString().equals("SKELETON_HORSE"))
name = "HorseSkeleton";
break;
case "SKELETON":
Skeleton skeleton = (Skeleton) entity;
if (skeleton.getSkeletonType().toString().equals("WITHER"))
name = "SkeletonWither";
if (Version.isCurrentEqualOrHigher(Version.v1_10_R1) && skeleton.getSkeletonType().toString().equals("STRAY"))
name = "SkeletonStray";
break;
case "ZOMBIE":
Zombie zombie = (Zombie) entity;
if (Version.isCurrentEqualOrHigher(Version.v1_10_R1)) {
if (zombie.isVillager() && zombie.getVillagerProfession().toString().equals("HUSK"))
return "ZombieVillager";
if (zombie.getVillagerProfession().toString().equals("HUSK"))
return "ZombieHusk";
} else {
if (zombie.isVillager())
} else if (zombie.isVillager()) {
return "ZombieVillager";
}
break;
default:
break;
@ -104,7 +113,8 @@ public class Util {
public static double getMaxHealth(LivingEntity entity) {
if (Version.isCurrentEqualOrHigher(Version.v1_12_R1)) {
return entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue();
org.bukkit.attribute.AttributeInstance attr = entity.getAttribute(Attribute.GENERIC_MAX_HEALTH);
return attr == null ? 0d : attr.getBaseValue();
}
return entity.getMaxHealth();
}