Class PlayerWrapper
java.lang.Object
me.deecaad.weaponmechanics.wrappers.EntityWrapper
me.deecaad.weaponmechanics.wrappers.PlayerWrapper
Wraps a
Player object to simplify per-player data/methods that are used by
WeaponMechanics. Also contains useful API functionality for plugins who want to check if an
entity is scoped, reloading, etc.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanvoidlonglonglongorg.bukkit.entity.PlayerThis method might not be safe to use nor should be used.voidbooleanReturnstrueif the player is 'crawling'.booleanisPlayer()booleanReturnstrueif the entity is a player, and the player has right-clicked in the past 4 ticks (+- 25 milliseconds).booleanReturnstrueif the entity is a player, and the player is in sneak mode.booleanReturnstrueif the entity is a player, and the player is sprinting.voidMethods inherited from class me.deecaad.weaponmechanics.wrappers.EntityWrapper
getEntity, getHandData, getMainHandData, getMoveTask, getOffHandData, isAmmoEmpty, isDualWielding, isDualWieldingWeapons, isGliding, isInMidair, isReloading, isRiding, isStanding, isSwimming, isWalking, isZooming
-
Constructor Details
-
PlayerWrapper
public PlayerWrapper(org.bukkit.entity.Player player)
-
-
Method Details
-
getPlayer
public org.bukkit.entity.Player getPlayer() -
rightClicked
public void rightClicked() -
didDoubleSneak
public boolean didDoubleSneak() -
droppedWeapon
public void droppedWeapon() -
getLastDropWeaponTime
public long getLastDropWeaponTime() -
inventoryDrop
public void inventoryDrop() -
getLastInventoryDropTime
public long getLastInventoryDropTime() -
getMessageHelper
-
getRecoilController
-
convertedAmmo
public void convertedAmmo() -
getLastAmmoConvert
public long getLastAmmoConvert() -
isRightClicking
public boolean isRightClicking()Description copied from class:EntityWrapperReturnstrueif the entity is a player, and the player has right-clicked in the past 4 ticks (+- 25 milliseconds). This method also considers the player's ping (Player.getPing()) to determine if they are still right-clicking.While this method is usually quite inaccurate (can be up to 4 ticks late!), it is 100% accurate when the player is blocking (swords in 1.8, shields in 1.9+).
- Overrides:
isRightClickingin classEntityWrapper- Returns:
truewhen the player is right-clicking.- See Also:
-
isSneaking
public boolean isSneaking()Description copied from class:EntityWrapperReturnstrueif the entity is a player, and the player is in sneak mode.- Overrides:
isSneakingin classEntityWrapper- Returns:
truewhen the player is sneaking.- See Also:
-
isCrawling
public boolean isCrawling()Returnstrueif the player is 'crawling'.- Returns:
truewhen the player is 'crawling'.
-
isSprinting
public boolean isSprinting()Description copied from class:EntityWrapperReturnstrueif the entity is a player, and the player is sprinting.- Overrides:
isSprintingin classEntityWrapper- Returns:
truewhen the player is sprinting.- See Also:
-
isPlayer
public boolean isPlayer()- Overrides:
isPlayerin classEntityWrapper
-
getStatsData
- Returns:
- the stats data or null if disabled or not yet synced
-
getStatsDataUnsafe
This method might not be safe to use nor should be used. UsegetStatsData()instead. By unsafe I mean that this object might not have been synced yet.- Returns:
- the unsafe stats data object
-