finished default repairables, diamond armor gives less xp by default

This commit is contained in:
nossr50
2019-03-22 16:04:31 -07:00
parent 968636b8d4
commit e232bb3699
20 changed files with 122 additions and 252 deletions

View File

@@ -73,7 +73,7 @@ public class RepairManager extends SkillManager {
}
// Permissions checks on material and item types
if (!Permissions.repairMaterialType(player, repairable.getRepairMaterialType())) {
if (!Permissions.repairMaterialType(player, repairable.getRepairItemMaterialCategory())) {
NotificationManager.sendPlayerInformation(player, NotificationType.NO_PERMISSION, "mcMMO.NoPermission");
return;
}
@@ -160,7 +160,7 @@ public class RepairManager extends SkillManager {
inventory.removeItem(toRemove);
// Give out XP like candy
applyXpGain((float) ((getPercentageRepaired(startDurability, newDurability, repairable.getMaximumDurability()) * repairable.getXpMultiplier()) * ExperienceConfig.getInstance().getRepairXPBase() * ExperienceConfig.getInstance().getRepairXP(repairable.getRepairMaterialType())), XPGainReason.PVE);
applyXpGain((float) ((getPercentageRepaired(startDurability, newDurability, repairable.getMaximumDurability()) * repairable.getXpMultiplier()) * ExperienceConfig.getInstance().getRepairXPBase() * ExperienceConfig.getInstance().getRepairXP(repairable.getRepairItemMaterialCategory())), XPGainReason.PVE);
// BWONG BWONG BWONG
if (mcMMO.getConfigManager().getConfigRepair().getRepairGeneral().isAnvilUseSounds()) {

View File

@@ -2,7 +2,7 @@
package com.gmail.nossr50.skills.repair.repairables;
import com.gmail.nossr50.datatypes.skills.ItemType;
import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.datatypes.skills.ItemMaterialCategory;
import org.bukkit.Material;
@@ -41,7 +41,7 @@ public interface Repairable {
* @return the RepairMaterialType for this repairable
*//*
public MaterialType getRepairMaterialType();
public ItemMaterialCategory getRepairItemMaterialCategory();
*/
/**

View File

@@ -1,7 +1,7 @@
package com.gmail.nossr50.skills.repair.repairables;
import com.gmail.nossr50.datatypes.skills.ItemMaterialCategory;
import com.gmail.nossr50.datatypes.skills.ItemType;
import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.util.ItemUtils;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
@@ -16,7 +16,7 @@ public class SimpleRepairable {
private final int minimumQuantity, minimumLevel;
private final short maximumDurability, baseRepairDurability;
private final ItemType repairItemType;
private final MaterialType repairMaterialType;
private final ItemMaterialCategory repairItemMaterialCategory;
private final double xpMultiplier;
public SimpleRepairable(Material itemMaterial, Material repairMaterial, int minimumQuantity, int minimumLevel, double xpMultiplier) {
@@ -38,16 +38,16 @@ public class SimpleRepairable {
this.baseRepairDurability = (short) (maximumDurability / minimumQuantity);
this.repairItemType = determineItemType(this.itemMaterial);
this.repairMaterialType = determineMaterialType(this.repairMaterials.get(0));
this.repairItemMaterialCategory = determineMaterialType(this.repairMaterials.get(0));
}
public MaterialType determineMaterialType(Material material) {
public ItemMaterialCategory determineMaterialType(Material material) {
switch (material) {
case STRING:
return MaterialType.STRING;
return ItemMaterialCategory.STRING;
case LEATHER:
return MaterialType.LEATHER;
return ItemMaterialCategory.LEATHER;
case ACACIA_PLANKS:
case BIRCH_PLANKS:
@@ -55,22 +55,22 @@ public class SimpleRepairable {
case JUNGLE_PLANKS:
case OAK_PLANKS:
case SPRUCE_PLANKS:
return MaterialType.WOOD;
return ItemMaterialCategory.WOOD;
case STONE:
return MaterialType.STONE;
return ItemMaterialCategory.STONE;
case IRON_INGOT:
return MaterialType.IRON;
return ItemMaterialCategory.IRON;
case GOLD_INGOT:
return MaterialType.GOLD;
return ItemMaterialCategory.GOLD;
case DIAMOND:
return MaterialType.DIAMOND;
return ItemMaterialCategory.DIAMOND;
default:
return MaterialType.OTHER;
return ItemMaterialCategory.OTHER;
}
}
@@ -103,8 +103,8 @@ public class SimpleRepairable {
return repairItemType;
}
public MaterialType getRepairMaterialType() {
return repairMaterialType;
public ItemMaterialCategory getRepairItemMaterialCategory() {
return repairItemMaterialCategory;
}
public int getMinimumQuantity() {