mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Add metadata value for repair material
This commit is contained in:
parent
e1ca2c0b98
commit
87cf5cb932
@ -15,6 +15,13 @@ public interface Repairable {
|
||||
*/
|
||||
public int getRepairMaterialId();
|
||||
|
||||
/**
|
||||
* Gets the metadata byte value of the material used to repair this item
|
||||
*
|
||||
* @return the byte metadata of the repair material
|
||||
*/
|
||||
public byte getRepairMaterialMetadata();
|
||||
|
||||
/**
|
||||
* Gets the minimum quantity of repair materials ignoring all other repair bonuses
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.gmail.nossr50.skills.repair;
|
||||
|
||||
public class RepairableFactory {
|
||||
public static Repairable getRepairable(int itemId, int repairMaterialId, int minimumLevel, int minimumQuantity, short maximumDurability) {
|
||||
public static Repairable getRepairable(int itemId, int repairMaterialId, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability) {
|
||||
// TODO: Add in loading from config what type of manager we want.
|
||||
return new SimpleRepairable(itemId, repairMaterialId, minimumLevel, minimumQuantity, maximumDurability);
|
||||
return new SimpleRepairable(itemId, repairMaterialId, repairMetadata, minimumLevel, minimumQuantity, maximumDurability);
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,12 @@ package com.gmail.nossr50.skills.repair;
|
||||
public class SimpleRepairable implements Repairable {
|
||||
private final int itemId, repairMaterialId, minimumQuantity, minimumLevel;
|
||||
private final short maximumDurability, baseRepairDurability;
|
||||
private final byte repairMetadata;
|
||||
|
||||
protected SimpleRepairable(int itemId, int repairMaterialId, int minimumLevel, int minimumQuantity, short maximumDurability) {
|
||||
protected SimpleRepairable(int itemId, int repairMaterialId, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability) {
|
||||
this.itemId = itemId;
|
||||
this.repairMaterialId = repairMaterialId;
|
||||
this.repairMetadata = repairMetadata;
|
||||
this.minimumLevel = minimumLevel;
|
||||
this.minimumQuantity = minimumQuantity;
|
||||
this.maximumDurability = maximumDurability;
|
||||
@ -23,6 +25,11 @@ public class SimpleRepairable implements Repairable {
|
||||
return repairMaterialId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte getRepairMaterialMetadata() {
|
||||
return repairMetadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinimumQuantity() {
|
||||
return minimumQuantity;
|
||||
|
Loading…
Reference in New Issue
Block a user