mirror of
https://github.com/songoda/EpicAnchors.git
synced 2025-02-19 21:11:46 +01:00
Better material management.
This commit is contained in:
parent
0681a5052d
commit
f5e96bd357
@ -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