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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
/**
*
*/
package darkknight.jewelrycraft.api;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
/**
* @author Sorin
*
*/
public interface IJewelryItem {
/**
* @return Returns the id of the type, 0 is for ring, 1 is for bracelet, 2 is
* for necklace and 3 is for earrings
*/
public int type();
/**
* This is the action performed each player tick
*
* @param item
* The item stack of the item (allows for fine item search, like
* metadata and nbt)
* @param player
* The player wearing the jewelry
*/
public void onWearAction(ItemStack item, EntityPlayer player);
/**
* This performs an action whenever a player gets attacked by an entity besides
* another Player
*
* @param item
* The item stack of the item (allows for fine item search, like
* metadata and nbt)
* @param player
* The player that was attacked
* @param source
* Source of the damage
* @param amount
* The amount of damage taken
*/
public void onPlayerAttackedAction(ItemStack item, EntityPlayer player, DamageSource source, float amount);
/**
* This does an action whenever an Entity gets attacked by a player, this
* includes other Players
*
* @param item
* The item stack of the item (allows for fine item search, like
* metadata and nbt)
* @param player
* The attacking player
* @param entity
* The target entity
* @param event
* The amount of damage dealt
*/
public void onEntityAttackedByPlayer(ItemStack item, EntityPlayer player, EntityLivingBase entity,
LivingAttackEvent event);
/**
* This runs whenever a player dies
*
* @param item
* The item stack of the item (allows for fine item search, like
* metadata and nbt)
* @param player
* The player that died
* @param source
* The damage source that caused the death
*/
public void onPlayerDeadAction(ItemStack item, EntityPlayer player, DamageSource source);
/**
* Runs whenever a player respawns (switches dimensions or actually respawns)
*
* @param item
* The item stack of the item (allows for fine item search, like
* metadata and nbt)
* @param event
* The clone event that runs whenever a player respawns, either
* because he died or switched dimensions
*/
public void onPlayerRespawnAction(ItemStack item, PlayerEvent.Clone event);
/**
* This runs when the item is equipped
*
* @param item
* The item stack of the item (allows for fine item search, like
* metadata and nbt)
*/
public void onJewelryEquipped(ItemStack item);
/**
* This runs when the item is unequipped
*
* @param item
* The item stack of the item (allows for fine item search, like
* metadata and nbt)
*/
public void onJewelryUnequipped(ItemStack item);
public void onLivingDropItems(ItemStack item, EntityPlayer player, LivingDropsEvent event);
public void onPlayerHurt(ItemStack jewelryItems, EntityPlayer player, LivingHurtEvent event);
public void onEntityHurt(ItemStack jewelryItems, EntityPlayer player, LivingHurtEvent event);
}
|