mirror of
https://github.com/songoda/EpicFarming.git
synced 2024-11-15 07:05:17 +01:00
Merge branch 'development'
This commit is contained in:
commit
ac618bca64
@ -19,7 +19,7 @@
|
||||
<img alt="Patreon" src="https://img.shields.io/badge/-Support_on_Patreon-F96854.svg?logo=patreon&style=flat&logoColor=white">
|
||||
</a>
|
||||
<br>
|
||||
<img alt="Latest" src="https://img.shields.io/badge/-ver_3.1.1-4078C0.svg?logo=github&style=flat&logoColor=white&color=blue&label=Latest&labelColor=black">
|
||||
<img alt="Latest" src="https://img.shields.io/badge/dynamic/xml?label=version&query=string%28%2F%2F%2A%5Blocal-name%28.%29%3D%27version%27%20and%20namespace-uri%28.%29%3D%27http%3A%2F%2Fmaven.apache.org%2FPOM%2F4.0.0%27%5D%5B1%5D%29&url=https%3A%2F%2Fraw.githubusercontent.com%2Fsongoda%2FEpicFarming%2Fmaster%2Fpom.xml&logo=github&style=flat&logoColor=white&color=blue&labelColor=black">
|
||||
<a href="https://app.codacy.com/gh/songoda/EpicFarming/dashboard">
|
||||
<img alt="quality" src="https://img.shields.io/codacy/grade/88eb57700298485482781b1bff439fec">
|
||||
</a>
|
||||
|
2
pom.xml
2
pom.xml
@ -2,7 +2,7 @@
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>EpicFarming</artifactId>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<version>3.1.1b</version>
|
||||
<version>3.1.2</version>
|
||||
<build>
|
||||
<defaultGoal>clean install</defaultGoal>
|
||||
<finalName>EpicFarming-${project.version}</finalName>
|
||||
|
@ -11,6 +11,7 @@ import com.songoda.core.database.SQLiteConnector;
|
||||
import com.songoda.core.gui.GuiManager;
|
||||
import com.songoda.core.hooks.EconomyManager;
|
||||
import com.songoda.core.hooks.EntityStackerManager;
|
||||
import com.songoda.core.hooks.ProtectionManager;
|
||||
import com.songoda.core.nms.NmsManager;
|
||||
import com.songoda.core.nms.nbt.NBTItem;
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
@ -111,6 +112,9 @@ public class EpicFarming extends SongodaPlugin {
|
||||
// Load Economy
|
||||
EconomyManager.load();
|
||||
|
||||
// Load protection manager.
|
||||
ProtectionManager.load(this);
|
||||
|
||||
// Setup Config
|
||||
Settings.setupConfig();
|
||||
this.setLocale(Settings.LANGUGE_MODE.getString(), false);
|
||||
|
@ -4,6 +4,7 @@ import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.compatibility.CompatibleParticleHandler;
|
||||
import com.songoda.core.compatibility.CompatibleSound;
|
||||
import com.songoda.core.hooks.EconomyManager;
|
||||
import com.songoda.core.hooks.ProtectionManager;
|
||||
import com.songoda.epicfarming.EpicFarming;
|
||||
import com.songoda.epicfarming.farming.levels.Level;
|
||||
import com.songoda.epicfarming.gui.OverviewGui;
|
||||
@ -60,11 +61,24 @@ public class Farm {
|
||||
|
||||
if (opened != null && !force) return;
|
||||
|
||||
if (Settings.USE_PROTECTION_PLUGINS.getBoolean() && !ProtectionManager.canInteract(player, location)) {
|
||||
player.sendMessage(EpicFarming.getInstance().getLocale().getMessage("event.general.protected").getPrefixedMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
opened = new OverviewGui(this, player);
|
||||
|
||||
EpicFarming.getInstance().getGuiManager().showGUI(player, opened);
|
||||
}
|
||||
|
||||
public void forceMenuClose() {
|
||||
if (opened == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
opened.close();
|
||||
}
|
||||
|
||||
public void upgrade(UpgradeType type, Player player) {
|
||||
EpicFarming instance = EpicFarming.getInstance();
|
||||
if (instance.getLevelManager().getLevels().containsKey(this.level.getLevel() + 1)) {
|
||||
|
@ -112,6 +112,7 @@ public class BlockListeners implements Listener {
|
||||
if (farm == null) return;
|
||||
|
||||
plugin.getDataManager().deleteFarm(farm);
|
||||
farm.forceMenuClose();
|
||||
|
||||
FarmTask.getCrops(farm, false);
|
||||
|
||||
@ -140,6 +141,7 @@ public class BlockListeners implements Listener {
|
||||
FarmTask.getCrops(farm, false);
|
||||
|
||||
plugin.getDataManager().deleteFarm(farm);
|
||||
farm.forceMenuClose();
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
|
@ -110,6 +110,7 @@ public class EntityListeners implements Listener {
|
||||
|
||||
Farm farm = plugin.getFarmManager().removeFarm(block.getLocation());
|
||||
plugin.getDataManager().deleteFarm(farm);
|
||||
farm.forceMenuClose();
|
||||
|
||||
FarmTask.getCrops(farm, false);
|
||||
|
||||
|
@ -40,6 +40,9 @@ public class Settings {
|
||||
public static final ConfigSetting DISABLE_AUTO_TIL_LAND = new ConfigSetting(config, "Main.Disable Auto Til Land", false,
|
||||
"Should farms not auto til land around them?");
|
||||
|
||||
public static final ConfigSetting USE_PROTECTION_PLUGINS = new ConfigSetting(config, "Main.Use Protection Plugins", true,
|
||||
"Should we use protection plugins?");
|
||||
|
||||
public static final ConfigSetting ECONOMY_PLUGIN = new ConfigSetting(config, "Main.Economy", EconomyManager.getEconomy() == null ? "Vault" : EconomyManager.getEconomy().getName(),
|
||||
"Which economy plugin should be used?",
|
||||
"Supported plugins you have installed: \"" + EconomyManager.getManager().getRegisteredPlugins().stream().collect(Collectors.joining("\", \"")) + "\".");
|
||||
|
@ -50,6 +50,7 @@ command:
|
||||
event:
|
||||
general:
|
||||
nopermission: '&cYou do not have permission to do that.'
|
||||
protected: '&cThis farm is protected and you cannot access it.'
|
||||
upgrade:
|
||||
cannotafford: '&cYou cannot afford this upgrade.'
|
||||
success: '&7You successfully upgraded this farm to &6level %level%&7!'
|
||||
|
Loading…
Reference in New Issue
Block a user