Removing unecessary interfaces

This commit is contained in:
nossr50 2019-03-22 13:29:51 -07:00
parent 7aea4e1d92
commit bf8e3d5a08
4 changed files with 33 additions and 27 deletions

View File

@ -154,7 +154,7 @@
<repositories> <repositories>
<repository> <repository>
<id>sponge</id> <id>sponge</id>
<url>https://repo.spongepowered.org/maven</url> <url>https://repo.spongepowered.org/maven/</url>
</repository> </repository>
<repository> <repository>
<id>flow</id> <id>flow</id>
@ -188,12 +188,12 @@
<groupId>org.spongepowered</groupId> <groupId>org.spongepowered</groupId>
<!-- Modify this line to target the loader you wish to use. --> <!-- Modify this line to target the loader you wish to use. -->
<artifactId>configurate-yaml</artifactId> <artifactId>configurate-yaml</artifactId>
<version>3.6</version> <version>3.7-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.spongepowered</groupId> <groupId>org.spongepowered</groupId>
<artifactId>configurate-hocon</artifactId> <artifactId>configurate-hocon</artifactId>
<version>3.6</version> <version>3.7-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.maven.scm</groupId> <groupId>org.apache.maven.scm</groupId>

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.config; package com.gmail.nossr50.config;
import com.gmail.nossr50.config.collectionconfigs.RepairConfig;
import com.gmail.nossr50.config.collectionconfigs.SalvageConfig; import com.gmail.nossr50.config.collectionconfigs.SalvageConfig;
import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.config.hocon.CustomEnumValueSerializer; import com.gmail.nossr50.config.hocon.CustomEnumValueSerializer;
@ -47,7 +46,6 @@ import com.gmail.nossr50.config.treasure.HerbalismTreasureConfig;
import com.gmail.nossr50.datatypes.party.PartyFeature; import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.repair.repairables.Repairable;
import com.gmail.nossr50.skills.repair.repairables.SimpleRepairable; import com.gmail.nossr50.skills.repair.repairables.SimpleRepairable;
import com.gmail.nossr50.skills.repair.repairables.SimpleRepairableManager; import com.gmail.nossr50.skills.repair.repairables.SimpleRepairableManager;
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;

View File

@ -1,3 +1,4 @@
/*
package com.gmail.nossr50.skills.repair.repairables; package com.gmail.nossr50.skills.repair.repairables;
import com.gmail.nossr50.config.Unload; import com.gmail.nossr50.config.Unload;
@ -7,44 +8,55 @@ import org.bukkit.inventory.ItemStack;
import java.util.List; import java.util.List;
public interface RepairableManager extends Unload { public interface RepairableManager extends Unload {
/** */
/**
* Register a repairable with the RepairManager * Register a repairable with the RepairManager
* *
* @param repairable Repairable to register * @param repairable Repairable to register
*/ *//*
public void registerRepairable(Repairable repairable); public void registerRepairable(Repairable repairable);
/** */
/**
* Register a list of repairables with the RepairManager * Register a list of repairables with the RepairManager
* *
* @param repairables List<Repairable> to register * @param repairables List<Repairable> to register
*/ *//*
public void registerRepairables(List<Repairable> repairables); public void registerRepairables(List<Repairable> repairables);
/** */
/**
* Checks if an item is repairable * Checks if an item is repairable
* *
* @param type Material to check if repairable * @param type Material to check if repairable
* *
* @return true if repairable, false if not * @return true if repairable, false if not
*/ *//*
public boolean isRepairable(Material type); public boolean isRepairable(Material type);
/** */
/**
* Checks if an item is repairable * Checks if an item is repairable
* *
* @param itemStack Item to check if repairable * @param itemStack Item to check if repairable
* *
* @return true if repairable, false if not * @return true if repairable, false if not
*/ *//*
public boolean isRepairable(ItemStack itemStack); public boolean isRepairable(ItemStack itemStack);
/** */
/**
* Gets the repairable with this type * Gets the repairable with this type
* *
* @param type Material of the repairable to look for * @param type Material of the repairable to look for
* *
* @return the repairable, can be null * @return the repairable, can be null
*/ *//*
public Repairable getRepairable(Material type); public Repairable getRepairable(Material type);
} }
*/

View File

@ -1,48 +1,44 @@
package com.gmail.nossr50.skills.repair.repairables; package com.gmail.nossr50.skills.repair.repairables;
import com.gmail.nossr50.config.Unload;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
public class SimpleRepairableManager implements RepairableManager { public class SimpleRepairableManager implements Unload {
private HashMap<Material, Repairable> repairables; private HashMap<Material, SimpleRepairable> repairables;
@Override @Override
public void unload() { public void unload() {
repairables.clear(); repairables.clear();
} }
public SimpleRepairableManager(List<Repairable> repairablesCollection) { public SimpleRepairableManager(List<SimpleRepairable> repairablesCollection) {
this.repairables = new HashMap<Material, Repairable>(repairablesCollection.size()); this.repairables = new HashMap<Material, SimpleRepairable>(repairablesCollection.size());
registerRepairables(repairablesCollection); registerRepairables(repairablesCollection);
} }
@Override public void registerRepairable(SimpleRepairable repairable) {
public void registerRepairable(Repairable repairable) {
Material item = repairable.getItemMaterial(); Material item = repairable.getItemMaterial();
repairables.put(item, repairable); repairables.put(item, repairable);
} }
@Override public void registerRepairables(List<SimpleRepairable> repairables) {
public void registerRepairables(List<Repairable> repairables) { for (SimpleRepairable repairable : repairables) {
for (Repairable repairable : repairables) {
registerRepairable(repairable); registerRepairable(repairable);
} }
} }
@Override
public boolean isRepairable(Material type) { public boolean isRepairable(Material type) {
return repairables.containsKey(type); return repairables.containsKey(type);
} }
@Override
public boolean isRepairable(ItemStack itemStack) { public boolean isRepairable(ItemStack itemStack) {
return isRepairable(itemStack.getType()); return isRepairable(itemStack.getType());
} }
@Override
public Repairable getRepairable(Material type) { public Repairable getRepairable(Material type) {
return repairables.get(type); return repairables.get(type);
} }