Simpler way of obtaining items via API
This commit is contained in:
parent
61b2b293ba
commit
cce3d6b79a
3 changed files with 15 additions and 8 deletions
|
@ -6,9 +6,13 @@ import lombok.Setter;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BloodMagicAPI {
|
||||
|
||||
public static final String ORB = "ItemBloodOrb";
|
||||
public static final String SCRIBE = "ItemInscriptionTool";
|
||||
|
||||
@Getter @Setter
|
||||
private static boolean loggingEnabled;
|
||||
|
||||
|
@ -18,11 +22,16 @@ public class BloodMagicAPI {
|
|||
@Getter
|
||||
private static DamageSource damageSource = new DamageSourceBloodMagic();
|
||||
|
||||
@Getter @Setter
|
||||
private static Item orbItem;
|
||||
@Getter @Setter
|
||||
private static Item scribeItem;
|
||||
|
||||
/**
|
||||
* Used to obtain Items from BloodMagic. Use the constants above for common items in case internal names
|
||||
* change.
|
||||
*
|
||||
* @param name - The registered name of the item. Usually the same as the class name.
|
||||
* @return - The requested Item
|
||||
*/
|
||||
public static Item getItem(String name) {
|
||||
return GameRegistry.findItem(Constants.Mod.MODID, name);
|
||||
}
|
||||
|
||||
@Getter @Setter
|
||||
private static Fluid lifeEssence;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue