Merge branch 'development'

This commit is contained in:
Brianna 2019-11-25 14:44:26 -05:00
commit db395ecc31
3 changed files with 12 additions and 4 deletions

View File

@ -4,7 +4,7 @@ stages:
variables:
name: "EpicAnchors"
path: "/builds/$CI_PROJECT_PATH"
version: "1.4.5"
version: "1.4.6"
build:
stage: build

View File

@ -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) {

View File

@ -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));