Package de.sprax2013.betterchairs
Class ChairUtils
java.lang.Object
de.sprax2013.betterchairs.ChairUtils
This class provides utility methods intended to be used by BetterChairs's nms-classes
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyChairProtections
(Entity entity) Examples for protections that could be applied:ArmorStand.hasGravity()
=false
ArmorStand.isVisible()
=false
LivingEntity.getRemoveWhenFarAway()
=true
Projectile.doesBounce()
=false
Invulnerable =true
NoGravity =true
Silent =1
DisabledSlots =0b11111
(all)static void
applyRegeneration
(HumanEntity p, int regenerationAmplifier) static boolean
didChairEntityMove
(Location expected, double actualX, double actualY, double actualZ) static BlockFace
This method checksDirectional.getFacing()
(legacy API in the current Bukkit api) and inverts it to show the Block's rotation.static double
getSitOffset
(Block block, boolean sitsOnArmorStand, ChairNMS chairNMS)
-
Method Details
-
applyChairProtections
Examples for protections that could be applied:ArmorStand.hasGravity()
=false
ArmorStand.isVisible()
=false
LivingEntity.getRemoveWhenFarAway()
=true
Projectile.doesBounce()
=false
- Invulnerable =
true
- NoGravity =
true
- Silent =
1
- DisabledSlots =
0b11111
(all)
- Parameters:
entity
- The Entity to apply the protection to
-
getBlockRotationLegacy
This method checksDirectional.getFacing()
(legacy API in the current Bukkit api) and inverts it to show the Block's rotation. If the block is not facing toNORTH
,SOUTH
,EAST
orWEST
, the value is returned without inverting it- Parameters:
b
- The block to check- Returns:
- The inverted BlockFace as described above, or
BlockFace.SELF
if the Bukkit-api is too old
-
didChairEntityMove
public static boolean didChairEntityMove(Location expected, double actualX, double actualY, double actualZ) -
applyRegeneration
-
getSitOffset
-