Merge branch 'development'

This commit is contained in:
Brianna 2020-04-16 03:52:00 -04:00
commit cbb7828fb8
5 changed files with 9 additions and 6 deletions

View File

@ -2,7 +2,7 @@
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>EpicAnchors</artifactId> <artifactId>EpicAnchors</artifactId>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>1.4.7</version> <version>1.4.8</version>
<build> <build>
<defaultGoal>clean install</defaultGoal> <defaultGoal>clean install</defaultGoal>
<finalName>EpicAnchors-${project.version}</finalName> <finalName>EpicAnchors-${project.version}</finalName>

View File

@ -3,6 +3,7 @@ package com.songoda.epicanchors.anchor;
import com.songoda.core.compatibility.ServerVersion; import com.songoda.core.compatibility.ServerVersion;
import com.songoda.core.hooks.EconomyManager; import com.songoda.core.hooks.EconomyManager;
import com.songoda.epicanchors.EpicAnchors; import com.songoda.epicanchors.EpicAnchors;
import com.songoda.epicanchors.settings.Settings;
import org.bukkit.*; import org.bukkit.*;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -59,7 +60,7 @@ public class Anchor {
public void bust() { public void bust() {
EpicAnchors plugin = EpicAnchors.getInstance(); EpicAnchors plugin = EpicAnchors.getInstance();
if (plugin.getConfig().getBoolean("Main.Allow Anchor Breaking")) { if (Settings.ALLOW_ANCHOR_BREAKING.getBoolean() && getTicksLeft() > 0) {
ItemStack item = plugin.makeAnchorItem(getTicksLeft()); ItemStack item = plugin.makeAnchorItem(getTicksLeft());
getLocation().getWorld().dropItemNaturally(getLocation(), item); getLocation().getWorld().dropItemNaturally(getLocation(), item);
} }

View File

@ -8,6 +8,7 @@ import com.songoda.core.utils.ItemUtils;
import com.songoda.epicanchors.EpicAnchors; import com.songoda.epicanchors.EpicAnchors;
import com.songoda.epicanchors.anchor.Anchor; import com.songoda.epicanchors.anchor.Anchor;
import com.songoda.epicanchors.gui.GUIOverview; import com.songoda.epicanchors.gui.GUIOverview;
import com.songoda.epicanchors.settings.Settings;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -50,7 +51,7 @@ public class InteractListeners implements Listener {
ItemStack item = player.getItemInHand(); ItemStack item = player.getItemInHand();
if (instance.getCoreConfig().getMaterial("Main.Anchor Block Material", CompatibleMaterial.AIR).matches(item)) { if (Settings.MATERIAL.getMaterial().matches(item)) {
if (instance.getTicksFromItem(item) == 0) return; if (instance.getTicksFromItem(item) == 0) return;
anchor.setTicksLeft(anchor.getTicksLeft() + instance.getTicksFromItem(item)); anchor.setTicksLeft(anchor.getTicksLeft() + instance.getTicksFromItem(item));

View File

@ -19,7 +19,7 @@ public class Settings {
public static final ConfigSetting LORE = new ConfigSetting(config, "Main.Anchor Lore", "&7Place down to keep that chunk|&7loaded until the time runs out.", public static final ConfigSetting LORE = new ConfigSetting(config, "Main.Anchor Lore", "&7Place down to keep that chunk|&7loaded until the time runs out.",
"The lore on the anchor item."); "The lore on the anchor item.");
public static final ConfigSetting MATERIAL = new ConfigSetting(config, "Main.Anchor Block Material", "END_PORTAL_FRAME", public static final ConfigSetting MATERIAL = new ConfigSetting(config, "Main.Anchor Block Material", CompatibleMaterial.END_PORTAL_FRAME.getMaterial().name(),
"The material an anchor is represented with?"); "The material an anchor is represented with?");
public static final ConfigSetting ADD_TIME_WITH_ECONOMY = new ConfigSetting(config, "Main.Add Time With Economy", true, public static final ConfigSetting ADD_TIME_WITH_ECONOMY = new ConfigSetting(config, "Main.Add Time With Economy", true,

View File

@ -1,9 +1,11 @@
package com.songoda.epicanchors.tasks; package com.songoda.epicanchors.tasks;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.compatibility.CompatibleParticleHandler; import com.songoda.core.compatibility.CompatibleParticleHandler;
import com.songoda.core.compatibility.ServerVersion; import com.songoda.core.compatibility.ServerVersion;
import com.songoda.epicanchors.EpicAnchors; import com.songoda.epicanchors.EpicAnchors;
import com.songoda.epicanchors.anchor.Anchor; import com.songoda.epicanchors.anchor.Anchor;
import com.songoda.epicanchors.settings.Settings;
import com.songoda.epicspawners.EpicSpawners; import com.songoda.epicspawners.EpicSpawners;
import org.bukkit.*; import org.bukkit.*;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -83,8 +85,7 @@ public class AnchorTask extends BukkitRunnable {
plugin.updateHologram(anchor); plugin.updateHologram(anchor);
Location location = anchor.getLocation(); Location location = anchor.getLocation();
if (CompatibleMaterial.getMaterial(location.getBlock()) != Settings.MATERIAL.getMaterial())
if (anchor.getLocation().getBlock().getType() != Material.valueOf(plugin.getConfig().getString("Main.Anchor Block Material")))
continue; continue;
Chunk chunk = location.getChunk(); Chunk chunk = location.getChunk();