From 935e8a444187ae8cca3d18d92d10de54f06c81ea Mon Sep 17 00:00:00 2001 From: montlikadani Date: Thu, 30 Aug 2018 10:44:20 +0200 Subject: [PATCH] OOppss.. PotionDrinkInfo has been left out :( --- .../jobs/actions/PotionDrinkInfo.java | 44 +++++++++++++++++++ .../jobs/listeners/JobsPaymentListener.java | 3 +- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/gamingmesh/jobs/actions/PotionDrinkInfo.java diff --git a/src/main/java/com/gamingmesh/jobs/actions/PotionDrinkInfo.java b/src/main/java/com/gamingmesh/jobs/actions/PotionDrinkInfo.java new file mode 100644 index 00000000..a399230d --- /dev/null +++ b/src/main/java/com/gamingmesh/jobs/actions/PotionDrinkInfo.java @@ -0,0 +1,44 @@ +/** + * Jobs Plugin for Bukkit + * Copyright (C) 2011 Zak Ford + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.gamingmesh.jobs.actions; + +import org.bukkit.potion.PotionType; + +import com.gamingmesh.jobs.container.ActionInfo; +import com.gamingmesh.jobs.container.ActionType; +import com.gamingmesh.jobs.container.BaseActionInfo; + +public class PotionDrinkInfo extends BaseActionInfo implements ActionInfo { + private String potion; + + public PotionDrinkInfo(String item, ActionType type) { + super(type); + this.potion = item; + } + + @Override + public String getName() { + return PotionType.valueOf(potion).name(); + } + + @Override + public String getNameWithSub() { + return getName(); + } +} diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index e8749afd..1569fd89 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -90,6 +90,7 @@ import com.gamingmesh.jobs.actions.EntityActionInfo; import com.gamingmesh.jobs.actions.ExploreActionInfo; import com.gamingmesh.jobs.actions.ItemActionInfo; import com.gamingmesh.jobs.actions.ItemNameActionInfo; +import com.gamingmesh.jobs.actions.PotionDrinkInfo; import com.gamingmesh.jobs.api.JobsChunkChangeEvent; import com.gamingmesh.jobs.container.ActionType; import com.gamingmesh.jobs.container.ExploreRespond; @@ -1523,7 +1524,7 @@ public class JobsPaymentListener implements Listener { // Player drinking a potion if (item.getType().equals(CMIMaterial.get(Material.POTION).isPotion())) - Jobs.action(jPlayer, new ItemActionInfo(item, ActionType.DRINK)); + Jobs.action(jPlayer, new PotionDrinkInfo(String.valueOf(CMIMaterial.get(Material.POTION).isPotion()), ActionType.DRINK)); } @EventHandler