2015-11-02 20:39:44 +00:00
|
|
|
package WayofTime.bloodmagic.api.orb;
|
2015-10-30 03:22:14 +00:00
|
|
|
|
2017-08-15 03:53:42 +00:00
|
|
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
|
|
|
import net.minecraftforge.registries.IForgeRegistryEntry;
|
|
|
|
|
|
|
|
import javax.annotation.Nonnull;
|
|
|
|
import javax.annotation.Nullable;
|
2015-10-30 03:22:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Base object for all Blood Orbs. Makes Orb creation quite a bit easier.
|
2017-08-16 04:30:48 +00:00
|
|
|
* <p>
|
2017-08-15 03:53:42 +00:00
|
|
|
* Just create a new BloodOrb instance then register it in {@link net.minecraftforge.event.RegistryEvent.Register<BloodOrb>}
|
2015-10-30 03:22:14 +00:00
|
|
|
*/
|
2017-08-16 04:30:48 +00:00
|
|
|
public class BloodOrb extends IForgeRegistryEntry.Impl<BloodOrb> {
|
2017-08-15 03:53:42 +00:00
|
|
|
private final String name;
|
|
|
|
private final int tier;
|
|
|
|
private final int capacity;
|
|
|
|
@Nullable
|
|
|
|
private ModelResourceLocation modelLocation;
|
2015-10-30 03:22:14 +00:00
|
|
|
|
|
|
|
/**
|
2015-12-30 20:34:40 +00:00
|
|
|
* A base object for BloodOrbs. A bit cleaner than the old way through
|
|
|
|
* EnergyItems.
|
2017-08-16 04:30:48 +00:00
|
|
|
*
|
|
|
|
* @param name - A name for the Orb. Gets put into an unlocalized name.
|
|
|
|
* @param tier - The tier of the Orb.
|
|
|
|
* @param capacity - The max amount of LP the Orb can store.
|
2015-10-30 03:22:14 +00:00
|
|
|
*/
|
2017-08-16 04:30:48 +00:00
|
|
|
public BloodOrb(String name, int tier, int capacity) {
|
2015-10-30 03:22:14 +00:00
|
|
|
this.name = name;
|
|
|
|
this.tier = tier;
|
|
|
|
this.capacity = capacity;
|
|
|
|
}
|
|
|
|
|
2017-08-16 04:30:48 +00:00
|
|
|
public String getName() {
|
2015-10-30 03:22:14 +00:00
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
2017-08-16 04:30:48 +00:00
|
|
|
public int getTier() {
|
2015-10-30 03:22:14 +00:00
|
|
|
return tier;
|
|
|
|
}
|
|
|
|
|
2017-08-16 04:30:48 +00:00
|
|
|
public int getCapacity() {
|
2015-10-30 03:22:14 +00:00
|
|
|
return capacity;
|
|
|
|
}
|
|
|
|
|
2017-08-15 03:53:42 +00:00
|
|
|
@Nullable
|
|
|
|
public ModelResourceLocation getModelLocation() {
|
|
|
|
return modelLocation;
|
2015-10-30 03:22:14 +00:00
|
|
|
}
|
|
|
|
|
2017-08-15 03:53:42 +00:00
|
|
|
public BloodOrb withModel(@Nonnull ModelResourceLocation modelLocation) {
|
|
|
|
this.modelLocation = modelLocation;
|
2015-10-30 03:22:14 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public String toString() {
|
2017-08-15 03:53:42 +00:00
|
|
|
return "BloodOrb{" + "name='" + name + '\'' + ", tier=" + tier + ", capacity=" + capacity + ", owner=" + getRegistryName() + '}';
|
2015-10-30 03:22:14 +00:00
|
|
|
}
|
|
|
|
}
|