mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-26 06:43:01 +00:00
Fixed the wand charging station texture, moved the baubles API to package it, and using the @API annotation for it. Added the Config GUIs existing in MinecraftForge for EMT! Awesome!
This commit is contained in:
1 parent
bfdc4d5f9c
commit
f0ee38df32
44 files changed
+347
-289
No files matched your search
@@ -0,0 +1,7 @@
|
||||
package baubles.api;
|
||||
|
||||
public enum BaubleType {
|
||||
RING,
|
||||
AMULET,
|
||||
BELT
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package baubles.api;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author Azanor
|
||||
*/
|
||||
public class BaublesApi {
|
||||
|
||||
static Method getBaubles;
|
||||
/**
|
||||
* Retrieves the baubles inventory for the supplied player
|
||||
*/
|
||||
public static IInventory getBaubles(EntityPlayer player) {
|
||||
IInventory ot = null;
|
||||
try {
|
||||
if(getBaubles == null) {
|
||||
Class fake = Class.forName("baubles.common.lib.PlayerHandler");
|
||||
getBaubles = fake.getMethod("getPlayerBaubles", EntityPlayer.class);
|
||||
}
|
||||
ot = (IInventory) getBaubles.invoke(null, player);
|
||||
} catch(Exception ex) {
|
||||
FMLLog.warning("[Baubles API] Could not invoke baubles.common.lib.PlayerHandler method getPlayerBaubles");
|
||||
}
|
||||
return ot;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package baubles.api;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Azanor
|
||||
*
|
||||
* This interface should be extended by items that can be worn in bauble slots
|
||||
*
|
||||
*/
|
||||
|
||||
public interface IBauble {
|
||||
|
||||
/**
|
||||
* This method return the type of bauble this is.
|
||||
* Type is used to determine the slots it can go into.
|
||||
*/
|
||||
public BaubleType getBaubleType(ItemStack itemstack);
|
||||
|
||||
/**
|
||||
* This method is called once per tick if the bauble is being worn by a player
|
||||
*/
|
||||
public void onWornTick(ItemStack itemstack, EntityLivingBase player);
|
||||
|
||||
/**
|
||||
* This method is called when the bauble is equipped by a player
|
||||
*/
|
||||
public void onEquipped(ItemStack itemstack, EntityLivingBase player);
|
||||
|
||||
/**
|
||||
* This method is called when the bauble is unequipped by a player
|
||||
*/
|
||||
public void onUnequipped(ItemStack itemstack, EntityLivingBase player);
|
||||
|
||||
/**
|
||||
* can this bauble be placed in a bauble slot
|
||||
*/
|
||||
public boolean canEquip(ItemStack itemstack, EntityLivingBase player);
|
||||
|
||||
/**
|
||||
* Can this bauble be removed from a bauble slot
|
||||
*/
|
||||
public boolean canUnequip(ItemStack itemstack, EntityLivingBase player);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
@API(apiVersion = "1.0.0.16", owner = "Baubles", provides = "Baubles|API")
|
||||
package baubles.api;
|
||||
import cpw.mods.fml.common.API;
|
||||
Reference in new issue
Block a user