mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Add in xpMultiplier
This commit is contained in:
parent
1185ea4f96
commit
7f0803c3f6
@ -67,4 +67,11 @@ public interface Repairable {
|
|||||||
* @return the minimum level to repair this item, or 0 for no minimum
|
* @return the minimum level to repair this item, or 0 for no minimum
|
||||||
*/
|
*/
|
||||||
public int getMinimumLevel();
|
public int getMinimumLevel();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the xpMultiplier for this repairable
|
||||||
|
*
|
||||||
|
* @return the xpMultiplier of this repairable
|
||||||
|
*/
|
||||||
|
public double getXpMultiplier();
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package com.gmail.nossr50.skills.repair;
|
package com.gmail.nossr50.skills.repair;
|
||||||
|
|
||||||
public class RepairableFactory {
|
public class RepairableFactory {
|
||||||
public static Repairable getRepairable(int itemId, int repairMaterialId, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability, RepairItemType repairItemType, RepairMaterialType repairMaterialType) {
|
public static Repairable getRepairable(int itemId, int repairMaterialId, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability, RepairItemType repairItemType, RepairMaterialType repairMaterialType, double xpMultiplier) {
|
||||||
// TODO: Add in loading from config what type of manager we want.
|
// TODO: Add in loading from config what type of manager we want.
|
||||||
return new SimpleRepairable(itemId, repairMaterialId, repairMetadata, minimumLevel, minimumQuantity, maximumDurability, repairItemType, repairMaterialType);
|
return new SimpleRepairable(itemId, repairMaterialId, repairMetadata, minimumLevel, minimumQuantity, maximumDurability, repairItemType, repairMaterialType, xpMultiplier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,9 @@ public class SimpleRepairable implements Repairable {
|
|||||||
private final byte repairMetadata;
|
private final byte repairMetadata;
|
||||||
private final RepairItemType repairItemType;
|
private final RepairItemType repairItemType;
|
||||||
private final RepairMaterialType repairMaterialType;
|
private final RepairMaterialType repairMaterialType;
|
||||||
|
private final double xpMultiplier;
|
||||||
|
|
||||||
protected SimpleRepairable(int itemId, int repairMaterialId, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability, RepairItemType repairItemType, RepairMaterialType repairMaterialType) {
|
protected SimpleRepairable(int itemId, int repairMaterialId, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability, RepairItemType repairItemType, RepairMaterialType repairMaterialType, double xpMultiplier) {
|
||||||
this.itemId = itemId;
|
this.itemId = itemId;
|
||||||
this.repairMaterialId = repairMaterialId;
|
this.repairMaterialId = repairMaterialId;
|
||||||
this.repairMetadata = repairMetadata;
|
this.repairMetadata = repairMetadata;
|
||||||
@ -17,6 +18,7 @@ public class SimpleRepairable implements Repairable {
|
|||||||
this.minimumQuantity = minimumQuantity;
|
this.minimumQuantity = minimumQuantity;
|
||||||
this.maximumDurability = maximumDurability;
|
this.maximumDurability = maximumDurability;
|
||||||
this.baseRepairDurability = (short) (maximumDurability / minimumQuantity);
|
this.baseRepairDurability = (short) (maximumDurability / minimumQuantity);
|
||||||
|
this.xpMultiplier = xpMultiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -63,4 +65,9 @@ public class SimpleRepairable implements Repairable {
|
|||||||
public int getMinimumLevel() {
|
public int getMinimumLevel() {
|
||||||
return minimumLevel;
|
return minimumLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getXpMultiplier() {
|
||||||
|
return xpMultiplier;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user