Misc code fixes

This commit is contained in:
nossr50
2020-07-13 11:39:03 -07:00
parent 428c093ae4
commit 7eae59a0b3
153 changed files with 1139 additions and 1474 deletions

View File

@@ -12,35 +12,35 @@ public interface Repairable {
*
* @return the type of this repairable
*/
public Material getItemMaterial();
Material getItemMaterial();
/**
* Gets the id of the material used to repair this item
*
* @return the id of the repair material
*/
public Material getRepairMaterial();
Material getRepairMaterial();
/**
* Gets the pretty name of the material used to repair this item
*
* @return the pretty name of the repair material
*/
public String getRepairMaterialPrettyName();
String getRepairMaterialPrettyName();
/**
* Gets the RepairItemType value for this repairable item
*
* @return the RepairItemType for this repairable
*/
public ItemType getRepairItemType();
ItemType getRepairItemType();
/**
* Gets the RepairMaterialType value for this repairable item
*
* @return the RepairMaterialType for this repairable
*/
public MaterialType getRepairMaterialType();
MaterialType getRepairMaterialType();
/**
* Gets the minimum quantity of repair materials ignoring all other repair bonuses
@@ -49,14 +49,14 @@ public interface Repairable {
*
* @return the minimum number of items
*/
public int getMinimumQuantity();
int getMinimumQuantity();
/**
* Gets the maximum durability of this item before it breaks
*
* @return the maximum durability
*/
public short getMaximumDurability();
short getMaximumDurability();
/**
* Gets the base repair durability on which to calculate bonuses.
@@ -65,19 +65,19 @@ public interface Repairable {
*
* @return the base repair durability
*/
public short getBaseRepairDurability(ItemStack itemStack);
short getBaseRepairDurability(ItemStack itemStack);
/**
* Gets the minimum repair level needed to repair this item
*
* @return the minimum level to repair this item, or 0 for no minimum
*/
public int getMinimumLevel();
int getMinimumLevel();
/**
* Gets the xpMultiplier for this repairable
*
* @return the xpMultiplier of this repairable
*/
public double getXpMultiplier();
double getXpMultiplier();
}

View File

@@ -11,14 +11,14 @@ public interface RepairableManager {
*
* @param repairable Repairable to register
*/
public void registerRepairable(Repairable repairable);
void registerRepairable(Repairable repairable);
/**
* Register a list of repairables with the RepairManager
*
* @param repairables List<Repairable> to register
*/
public void registerRepairables(List<Repairable> repairables);
void registerRepairables(List<Repairable> repairables);
/**
* Checks if an item is repairable
@@ -27,7 +27,7 @@ public interface RepairableManager {
*
* @return true if repairable, false if not
*/
public boolean isRepairable(Material type);
boolean isRepairable(Material type);
/**
* Checks if an item is repairable
@@ -36,7 +36,7 @@ public interface RepairableManager {
*
* @return true if repairable, false if not
*/
public boolean isRepairable(ItemStack itemStack);
boolean isRepairable(ItemStack itemStack);
/**
* Gets the repairable with this type
@@ -45,5 +45,5 @@ public interface RepairableManager {
*
* @return the repairable, can be null
*/
public Repairable getRepairable(Material type);
Repairable getRepairable(Material type);
}

View File

@@ -11,7 +11,7 @@ public class SimpleRepairable implements Repairable {
private final Material itemMaterial, repairMaterial;
private final int minimumLevel;
private final short maximumDurability;
private String repairMaterialPrettyName;
private final String repairMaterialPrettyName;
private final ItemType repairItemType;
private final MaterialType repairMaterialType;
private final double xpMultiplier;

View File

@@ -7,7 +7,7 @@ import java.util.HashMap;
import java.util.List;
public class SimpleRepairableManager implements RepairableManager {
private HashMap<Material, Repairable> repairables;
private final HashMap<Material, Repairable> repairables;
public SimpleRepairableManager() {
this(55);