mirror of
https://github.com/songoda/EpicFarming.git
synced 2024-09-09 21:58:14 +02:00
Code cleanup.
This commit is contained in:
parent
fb3d6742f0
commit
82790e962c
@ -75,7 +75,6 @@ public class EpicFarmingPlugin extends JavaPlugin implements EpicFarming {
|
||||
private BoostManager boostManager;
|
||||
|
||||
private GrowthTask growthTask;
|
||||
private HopperTask hopperTask;
|
||||
private FarmTask farmTask;
|
||||
private EntityTask entityTask;
|
||||
|
||||
@ -122,12 +121,12 @@ public class EpicFarmingPlugin extends JavaPlugin implements EpicFarming {
|
||||
}
|
||||
|
||||
this.settingsManager = new SettingsManager(this);
|
||||
setupConfig();
|
||||
this.setupConfig();
|
||||
|
||||
dataFile.createNewFile("Loading Data File", "EpicFarming Data File");
|
||||
loadDataFile();
|
||||
this.loadDataFile();
|
||||
|
||||
loadLevelManager();
|
||||
this.loadLevelManager();
|
||||
|
||||
this.farmManager = new EFarmManager();
|
||||
this.playerActionManager = new PlayerActionManager();
|
||||
@ -193,7 +192,7 @@ public class EpicFarmingPlugin extends JavaPlugin implements EpicFarming {
|
||||
|
||||
// Start tasks
|
||||
this.growthTask = GrowthTask.startTask(this);
|
||||
this.hopperTask = HopperTask.startTask(this);
|
||||
HopperTask.startTask(this);
|
||||
this.farmTask = FarmTask.startTask(this);
|
||||
this.entityTask = entityTask.startTask(this);
|
||||
|
||||
|
@ -4,7 +4,7 @@ public class References {
|
||||
|
||||
private String prefix;
|
||||
|
||||
public References() {
|
||||
References() {
|
||||
prefix = EpicFarmingPlugin.getInstance().getLocale().getMessage("general.nametag.prefix") + " ";
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,6 @@ package com.songoda.epicfarming.command;
|
||||
|
||||
import com.songoda.arconix.api.methods.formatting.TextComponent;
|
||||
import com.songoda.epicfarming.EpicFarmingPlugin;
|
||||
import com.songoda.epicfarming.api.EpicFarming;
|
||||
import com.songoda.epicfarming.command.commands.*;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
|
@ -1,7 +1,5 @@
|
||||
package com.songoda.epicfarming.command.commands;
|
||||
|
||||
import com.sk89q.worldedit.internal.expression.runtime.Return;
|
||||
import com.songoda.arconix.api.methods.formatting.TextComponent;
|
||||
import com.songoda.arconix.plugin.Arconix;
|
||||
import com.songoda.epicfarming.EpicFarmingPlugin;
|
||||
import com.songoda.epicfarming.command.AbstractCommand;
|
||||
|
@ -4,6 +4,7 @@ import com.songoda.arconix.api.methods.formatting.TextComponent;
|
||||
import com.songoda.arconix.api.methods.formatting.TimeComponent;
|
||||
import com.songoda.arconix.plugin.Arconix;
|
||||
import com.songoda.epicfarming.EpicFarmingPlugin;
|
||||
import com.songoda.epicfarming.api.farming.Farm;
|
||||
import com.songoda.epicfarming.api.farming.Level;
|
||||
import com.songoda.epicfarming.api.farming.UpgradeType;
|
||||
import com.songoda.epicfarming.boost.BoostData;
|
||||
@ -12,7 +13,10 @@ import com.songoda.epicfarming.utils.Debugger;
|
||||
import com.songoda.epicfarming.utils.Methods;
|
||||
import com.songoda.epicfarming.api.farming.Farm;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -59,7 +63,7 @@ public class EFarm implements Farm {
|
||||
}
|
||||
}
|
||||
|
||||
private void setupOverview(Player player, String... arg) {
|
||||
private void setupOverview(Player player) {
|
||||
Inventory inventory = Bukkit.createInventory(null, 54, Methods.formatName(level.getLevel(),false));
|
||||
inventory.setContents(this.inventory.getContents());
|
||||
this.inventory = inventory;
|
||||
|
@ -16,7 +16,7 @@ public class ELevel implements Level {
|
||||
|
||||
private List<String> description = new ArrayList<>();
|
||||
|
||||
public ELevel(int level, int costExperiance, int costEconomy, double speedMultiplier, int radius, boolean autoHarvest, boolean autoReplant, boolean autoBreeding) {
|
||||
ELevel(int level, int costExperiance, int costEconomy, double speedMultiplier, int radius, boolean autoHarvest, boolean autoReplant, boolean autoBreeding) {
|
||||
this.level = level;
|
||||
this.costExperiance = costExperiance;
|
||||
this.costEconomy = costEconomy;
|
||||
|
@ -28,7 +28,6 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by songoda on 3/14/2017.
|
||||
|
@ -11,7 +11,7 @@ public class PlayerData {
|
||||
private final UUID playerUUID;
|
||||
private EFarm farm = null;
|
||||
|
||||
public PlayerData(UUID playerUUID) {
|
||||
PlayerData(UUID playerUUID) {
|
||||
this.playerUUID = playerUUID;
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,6 @@ import com.songoda.epicfarming.boost.BoostData;
|
||||
import com.songoda.epicfarming.utils.Debugger;
|
||||
import com.songoda.epicfarming.utils.EntityInfo;
|
||||
import com.songoda.epicfarming.utils.Methods;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@ -22,7 +21,7 @@ import java.util.stream.Collectors;
|
||||
public class EntityTask extends BukkitRunnable {
|
||||
|
||||
private static final Random random = new Random();
|
||||
private Map<Entity, Integer> lastTicksLived = new HashMap<>();
|
||||
private static Map<Entity, Integer> lastTicksLived = new HashMap<>();
|
||||
private static final Map<Entity, Integer> ticksLived = new HashMap<>();
|
||||
private static EntityTask instance;
|
||||
private static EpicFarmingPlugin plugin;
|
||||
|
@ -1,31 +1,30 @@
|
||||
package com.songoda.epicfarming.tasks;
|
||||
|
||||
import com.songoda.epicfarming.EpicFarmingPlugin;
|
||||
import com.songoda.epicfarming.api.EpicFarming;
|
||||
import com.songoda.epicfarming.api.farming.Farm;
|
||||
import com.songoda.epicfarming.boost.BoostData;
|
||||
import com.songoda.epicfarming.farming.Crop;
|
||||
import com.songoda.epicfarming.utils.CropType;
|
||||
import com.songoda.epicfarming.utils.Debugger;
|
||||
import com.songoda.epicfarming.utils.Methods;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.CropState;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.Crops;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class FarmTask extends BukkitRunnable {
|
||||
|
||||
private static FarmTask instance;
|
||||
private static EpicFarmingPlugin plugin;
|
||||
|
||||
private static final Random random = new Random();
|
||||
|
||||
public static FarmTask startTask(EpicFarmingPlugin pl) {
|
||||
if (instance == null) {
|
||||
instance = new FarmTask();
|
||||
|
@ -5,11 +5,7 @@ import com.songoda.epicfarming.farming.Crop;
|
||||
import org.bukkit.CropState;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.Hopper;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.Crops;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
|
@ -3,22 +3,14 @@ package com.songoda.epicfarming.tasks;
|
||||
import com.songoda.epicfarming.EpicFarmingPlugin;
|
||||
import com.songoda.epicfarming.api.farming.Farm;
|
||||
import com.songoda.epicfarming.api.farming.FarmManager;
|
||||
import com.songoda.epicfarming.farming.Crop;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.CropState;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.Hopper;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.Crops;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class HopperTask extends BukkitRunnable {
|
||||
|
||||
private static HopperTask instance;
|
||||
|
@ -2,7 +2,6 @@ package com.songoda.epicfarming.utils;
|
||||
|
||||
import com.songoda.arconix.plugin.Arconix;
|
||||
import com.songoda.epicfarming.EpicFarmingPlugin;
|
||||
import com.songoda.epicfarming.api.EpicFarming;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
|
Loading…
Reference in New Issue
Block a user