2012-03-27 07:09:28 +02:00
|
|
|
package com.gmail.nossr50.events.skills;
|
2012-03-27 06:56:31 +02:00
|
|
|
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.event.Cancellable;
|
|
|
|
import org.bukkit.inventory.ItemStack;
|
|
|
|
|
|
|
|
import com.gmail.nossr50.datatypes.SkillType;
|
|
|
|
|
2012-04-01 04:20:35 +02:00
|
|
|
/**
|
|
|
|
* Called just before a player repairs an object with mcMMO.
|
|
|
|
*/
|
2012-03-27 06:56:31 +02:00
|
|
|
public class McMMOPlayerRepairCheckEvent extends McMMOPlayerSkillEvent implements Cancellable{
|
2012-03-29 07:41:43 +02:00
|
|
|
private short repairAmount;
|
2012-03-27 06:56:31 +02:00
|
|
|
private ItemStack repairMaterial;
|
|
|
|
private ItemStack repairedObject;
|
|
|
|
private boolean cancelled;
|
|
|
|
|
2012-03-29 07:41:43 +02:00
|
|
|
public McMMOPlayerRepairCheckEvent(Player player, short repairAmount, ItemStack repairMaterial, ItemStack repairedObject) {
|
2012-03-27 06:56:31 +02:00
|
|
|
super(player, SkillType.REPAIR);
|
|
|
|
this.repairAmount = repairAmount;
|
|
|
|
this.repairMaterial = repairMaterial;
|
|
|
|
this.repairedObject = repairedObject;
|
|
|
|
this.cancelled = false;
|
|
|
|
}
|
|
|
|
|
2012-04-01 04:20:35 +02:00
|
|
|
/**
|
|
|
|
* @return The amount this item will be repaired.
|
|
|
|
*/
|
2012-03-29 07:41:43 +02:00
|
|
|
public short getRepairAmount() {
|
2012-03-27 06:56:31 +02:00
|
|
|
return repairAmount;
|
|
|
|
}
|
|
|
|
|
2012-04-01 04:20:35 +02:00
|
|
|
/**
|
|
|
|
* @return The material used to repair this item
|
|
|
|
*/
|
2012-03-27 06:56:31 +02:00
|
|
|
public ItemStack getRepairMaterial() {
|
|
|
|
return repairMaterial;
|
|
|
|
}
|
|
|
|
|
2012-04-01 04:20:35 +02:00
|
|
|
/**
|
|
|
|
* @return The item that was repaired
|
|
|
|
*/
|
2012-03-27 06:56:31 +02:00
|
|
|
public ItemStack getRepairedObject() {
|
|
|
|
return repairedObject;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Following are required for Cancellable **/
|
|
|
|
@Override
|
|
|
|
public boolean isCancelled() {
|
|
|
|
return cancelled;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setCancelled(boolean cancelled) {
|
|
|
|
this.cancelled = cancelled;
|
|
|
|
}
|
|
|
|
}
|