mirror of
https://github.com/songoda/EpicAnchors.git
synced 2024-10-31 23:59:35 +01:00
Merge branch 'development'
This commit is contained in:
commit
cbb7828fb8
2
pom.xml
2
pom.xml
@ -2,7 +2,7 @@
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>EpicAnchors</artifactId>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<version>1.4.7</version>
|
||||
<version>1.4.8</version>
|
||||
<build>
|
||||
<defaultGoal>clean install</defaultGoal>
|
||||
<finalName>EpicAnchors-${project.version}</finalName>
|
||||
|
@ -3,6 +3,7 @@ package com.songoda.epicanchors.anchor;
|
||||
import com.songoda.core.compatibility.ServerVersion;
|
||||
import com.songoda.core.hooks.EconomyManager;
|
||||
import com.songoda.epicanchors.EpicAnchors;
|
||||
import com.songoda.epicanchors.settings.Settings;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -59,7 +60,7 @@ public class Anchor {
|
||||
public void bust() {
|
||||
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());
|
||||
getLocation().getWorld().dropItemNaturally(getLocation(), item);
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import com.songoda.core.utils.ItemUtils;
|
||||
import com.songoda.epicanchors.EpicAnchors;
|
||||
import com.songoda.epicanchors.anchor.Anchor;
|
||||
import com.songoda.epicanchors.gui.GUIOverview;
|
||||
import com.songoda.epicanchors.settings.Settings;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -50,7 +51,7 @@ public class InteractListeners implements Listener {
|
||||
|
||||
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;
|
||||
|
||||
anchor.setTicksLeft(anchor.getTicksLeft() + instance.getTicksFromItem(item));
|
||||
|
@ -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.",
|
||||
"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?");
|
||||
|
||||
public static final ConfigSetting ADD_TIME_WITH_ECONOMY = new ConfigSetting(config, "Main.Add Time With Economy", true,
|
||||
|
@ -1,9 +1,11 @@
|
||||
package com.songoda.epicanchors.tasks;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.compatibility.CompatibleParticleHandler;
|
||||
import com.songoda.core.compatibility.ServerVersion;
|
||||
import com.songoda.epicanchors.EpicAnchors;
|
||||
import com.songoda.epicanchors.anchor.Anchor;
|
||||
import com.songoda.epicanchors.settings.Settings;
|
||||
import com.songoda.epicspawners.EpicSpawners;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.Block;
|
||||
@ -83,8 +85,7 @@ public class AnchorTask extends BukkitRunnable {
|
||||
plugin.updateHologram(anchor);
|
||||
|
||||
Location location = anchor.getLocation();
|
||||
|
||||
if (anchor.getLocation().getBlock().getType() != Material.valueOf(plugin.getConfig().getString("Main.Anchor Block Material")))
|
||||
if (CompatibleMaterial.getMaterial(location.getBlock()) != Settings.MATERIAL.getMaterial())
|
||||
continue;
|
||||
|
||||
Chunk chunk = location.getChunk();
|
||||
|
Loading…
Reference in New Issue
Block a user