Fixed an NPE with iConomy handling
This commit is contained in:
parent
9a296c282e
commit
4c6c829348
2
README
2
README
@ -126,6 +126,8 @@ toowner - Whether the money from gate-use goes to the owner or nobody
|
|||||||
=============
|
=============
|
||||||
Changes
|
Changes
|
||||||
=============
|
=============
|
||||||
|
[Version 0.4.6]
|
||||||
|
- Fixed a bug in iConomy handling.
|
||||||
[Version 0.4.5]
|
[Version 0.4.5]
|
||||||
- Owner of gate now isn't charged for use if target is owner
|
- Owner of gate now isn't charged for use if target is owner
|
||||||
- Updated for iConomy 5.x
|
- Updated for iConomy 5.x
|
||||||
|
@ -313,7 +313,9 @@ public class Stargate extends JavaPlugin {
|
|||||||
|
|
||||||
boolean iConCharge = (iConomyHandler.useiConomy() && !portal.isFree() && !hasPerm(player, "stargate.free.use", player.isOp()));
|
boolean iConCharge = (iConomyHandler.useiConomy() && !portal.isFree() && !hasPerm(player, "stargate.free.use", player.isOp()));
|
||||||
String target = (portal.getGate().getToOwner() ? portal.getOwner() : null);
|
String target = (portal.getGate().getToOwner() ? portal.getOwner() : null);
|
||||||
|
if (target != null)
|
||||||
iConCharge = iConCharge && !target.equals(player.getName());
|
iConCharge = iConCharge && !target.equals(player.getName());
|
||||||
|
|
||||||
if (!iConCharge || iConomyHandler.chargePlayer(player.getName(), target, portal.getGate().getUseCost())) {
|
if (!iConCharge || iConomyHandler.chargePlayer(player.getName(), target, portal.getGate().getUseCost())) {
|
||||||
if (iConCharge && portal.getGate().getUseCost() > 0) {
|
if (iConCharge && portal.getGate().getUseCost() > 0) {
|
||||||
player.sendMessage(ChatColor.GREEN + "Deducted " + iConomyHandler.format(portal.getGate().getUseCost()));
|
player.sendMessage(ChatColor.GREEN + "Deducted " + iConomyHandler.format(portal.getGate().getUseCost()));
|
||||||
@ -372,6 +374,7 @@ public class Stargate extends JavaPlugin {
|
|||||||
|
|
||||||
boolean iConCharge = (iConomyHandler.useiConomy() && !portal.isFree() && !hasPerm(player, "stargate.free.use", player.isOp()));
|
boolean iConCharge = (iConomyHandler.useiConomy() && !portal.isFree() && !hasPerm(player, "stargate.free.use", player.isOp()));
|
||||||
String target = (portal.getGate().getToOwner() ? portal.getOwner() : null);
|
String target = (portal.getGate().getToOwner() ? portal.getOwner() : null);
|
||||||
|
if (target != null)
|
||||||
iConCharge = iConCharge && !target.equals(player.getName());
|
iConCharge = iConCharge && !target.equals(player.getName());
|
||||||
|
|
||||||
if (!iConCharge || iConomyHandler.chargePlayer(player.getName(), target, portal.getGate().getUseCost())) {
|
if (!iConCharge || iConomyHandler.chargePlayer(player.getName(), target, portal.getGate().getUseCost())) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: Stargate
|
name: Stargate
|
||||||
main: net.TheDgtl.Stargate.Stargate
|
main: net.TheDgtl.Stargate.Stargate
|
||||||
version: 0.4.5
|
version: 0.4.6
|
||||||
description: Stargate mod for Bukkit
|
description: Stargate mod for Bukkit
|
||||||
author: Drakia
|
author: Drakia
|
||||||
website: http://www.thedgtl.net
|
website: http://www.thedgtl.net
|
||||||
|
Loading…
Reference in New Issue
Block a user