-
Notifications
You must be signed in to change notification settings - Fork 755
/
IBattlegearWeapon.java
70 lines (59 loc) · 2.97 KB
/
IBattlegearWeapon.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
62
63
64
65
66
67
68
69
70
package mods.battlegear2.api;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
public interface IBattlegearWeapon {
/**
* Returns true if the weapon will allow other weapons to be placed in the partner offhand slot
*/
public boolean willAllowOffhandWeapon();
/**
* Will allow shield
*/
public boolean willAllowShield();
/**
* Returns true if the weapon be dual wielded in the offhand slot
*/
public boolean isOffhandHandDualWeapon();
/**
* Returns true if the weapon should always be sheathed on the back, false if it should be sheathed on the hip
*/
public boolean sheatheOnBack();
/**
* Perform any function when the item is held in the offhand and the user right clicks an entity.
* This is generally used to attack an entity with the offhand item. If this is the case the event should
* be canceled to prevent any default right clicking events (Eg Villager Trading)
*
* @param event the OffhandAttackEvent that was generated
* @param mainhandItem the ItemStack currently being held in the right hand
* @param offhandItem the ItemStack currently being held in the left hand
* @return true if the off hand swing animation should be performed
*/
public boolean offhandAttackEntity(OffhandAttackEvent event, ItemStack mainhandItem, ItemStack offhandItem);
/**
* Perform any function when the item is held in the offhand and the user right clicks "Air".
*
* @param event the PlayerInteractEvent that was generated
* @param mainhandItem the ItemStack currently being held in the right hand
* @param offhandItem the ItemStack currently being held in the left hand
* @return true if the off hand swing animation should be performed
*/
public boolean offhandClickAir(PlayerInteractEvent event, ItemStack mainhandItem, ItemStack offhandItem);
/**
* Perform any function when the item is held in the offhand and the user right clicks a block.
* Note that this will happen prior to the activation of any activation functions of blocks
*
* @param event the PlayerInteractEvent that was generated
* @param mainhandItem the ItemStack currently being held in the right hand
* @param offhandItem the ItemStack currently being held in the left hand
*/
public boolean offhandClickBlock(PlayerInteractEvent event, ItemStack mainhandItem, ItemStack offhandItem);
/**
* Perform any passive effects on each game tick when the item is held in the offhand
*
* @param effectiveSide the effective side the method was called from
* @param mainhandItem the ItemStack currently being held in the right hand
* @param offhandItem the ItemStack currently being held in the left hand
*/
public void performPassiveEffects(Side effectiveSide, ItemStack mainhandItem, ItemStack offhandItem);
}