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
db395ecc31
@ -4,7 +4,7 @@ stages:
|
||||
variables:
|
||||
name: "EpicAnchors"
|
||||
path: "/builds/$CI_PROJECT_PATH"
|
||||
version: "1.4.5"
|
||||
version: "1.4.6"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
@ -24,12 +24,21 @@ public class CommandGive extends AbstractCommand {
|
||||
protected ReturnType runCommand(CommandSender sender, String... args) {
|
||||
if (args.length != 2) return ReturnType.SYNTAX_ERROR;
|
||||
|
||||
|
||||
Player target = Bukkit.getPlayer(args[0]);
|
||||
if (target == null && !args[0].trim().toLowerCase().equals("all")) {
|
||||
instance.getLocale().newMessage("&cThat is not a player...").sendMessage(sender);
|
||||
instance.getLocale().newMessage("&cThat is not a player...").sendPrefixedMessage(sender);
|
||||
return ReturnType.SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
try {
|
||||
Integer.parseInt(args[1]);
|
||||
} catch (Exception e) {
|
||||
instance.getLocale().newMessage("&cYou can only use whole numbers...").sendPrefixedMessage(sender);
|
||||
return ReturnType.FAILURE;
|
||||
}
|
||||
|
||||
|
||||
ItemStack itemStack = instance.makeAnchorItem(Integer.parseInt(args[1]) * 20 * 60 * 60);
|
||||
|
||||
if (target != null) {
|
||||
|
@ -3,7 +3,6 @@ package com.songoda.epicanchors.listeners;
|
||||
import com.songoda.epicanchors.EpicAnchors;
|
||||
import com.songoda.epicanchors.anchor.Anchor;
|
||||
import com.songoda.epicanchors.settings.Settings;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
@ -26,7 +25,7 @@ public class BlockListeners implements Listener {
|
||||
|
||||
if (!item.hasItemMeta()
|
||||
|| !item.getItemMeta().hasDisplayName()
|
||||
|| Material.valueOf(Settings.MATERIAL.getString()) != event.getBlock().getType()
|
||||
|| Settings.MATERIAL.getMaterial().getMaterial() != event.getBlock().getType()
|
||||
|| plugin.getTicksFromItem(item) == 0) return;
|
||||
|
||||
Anchor anchor = new Anchor(event.getBlock().getLocation(), plugin.getTicksFromItem(item));
|
||||
|
Loading…
Reference in New Issue
Block a user