From 9ee377044ac8278acda84fa0e85710e51d87e4bf Mon Sep 17 00:00:00 2001 From: AppleDash Date: Tue, 14 Jun 2016 05:38:21 -0400 Subject: [PATCH] Make it so that you can't pay yourself. --- build.gradle | 2 +- .../org/appledash/saneeconomy/command/type/PayCommand.java | 5 +++++ src/main/resources/plugin.yml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 8d54fac..22536cc 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ group 'org.appledash' -version '0.1.5-SNAPSHOT' +version '0.1.6-SNAPSHOT' apply plugin: 'java' diff --git a/src/main/java/org/appledash/saneeconomy/command/type/PayCommand.java b/src/main/java/org/appledash/saneeconomy/command/type/PayCommand.java index b150648..3f2c633 100644 --- a/src/main/java/org/appledash/saneeconomy/command/type/PayCommand.java +++ b/src/main/java/org/appledash/saneeconomy/command/type/PayCommand.java @@ -51,6 +51,11 @@ public class PayCommand extends SaneEconomyCommand { return; } + if (toPlayer.getUniqueId().equals(fromPlayer.getUniqueId())) { + MessageUtils.sendMessage(sender, "You cannot pay yourself."); + return; + } + String sAmount = args[1]; double amount = NumberUtils.parsePositiveDouble(sAmount); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index f3217c0..1ff2660 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: SaneEconomy main: org.appledash.saneeconomy.SaneEconomy -version: 0.1.5 +version: 0.1.6 commands: balance: aliases: [bal]