/
IBauble.java
61 lines (51 loc) · 1.57 KB
/
IBauble.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package baubles.api;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
/**
*
* This interface should be extended by items that can be worn in bauble slots
*
* @author Azanor
*/
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 default void onWornTick(ItemStack itemstack, EntityLivingBase player) {
}
/**
* This method is called when the bauble is equipped by a player
*/
public default void onEquipped(ItemStack itemstack, EntityLivingBase player) {
}
/**
* This method is called when the bauble is unequipped by a player
*/
public default void onUnequipped(ItemStack itemstack, EntityLivingBase player) {
}
/**
* can this bauble be placed in a bauble slot
*/
public default boolean canEquip(ItemStack itemstack, EntityLivingBase player) {
return true;
}
/**
* Can this bauble be removed from a bauble slot
*/
public default boolean canUnequip(ItemStack itemstack, EntityLivingBase player) {
return true;
}
/**
* Will bauble automatically sync to client if a change is detected in its NBT or damage values?
* Default is off, so override and set to true if you want to auto sync.
* This sync is not instant, but occurs every 10 ticks (.5 seconds).
*/
public default boolean willAutoSync(ItemStack itemstack, EntityLivingBase player) {
return false;
}
}