Package fr.skytasul.guardianbeam
Class Laser.GuardianLaser
java.lang.Object
fr.skytasul.guardianbeam.Laser
fr.skytasul.guardianbeam.Laser.GuardianLaser
- Enclosing class:
- Laser
-
Nested Class Summary
Nested classes/interfaces inherited from class fr.skytasul.guardianbeam.Laser
Laser.CrystalLaser, Laser.GuardianLaser, Laser.LaserType, Laser.Packets, Laser.ReflectiveConsumer<T> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGuardianLaser(org.bukkit.Location start, org.bukkit.entity.LivingEntity endEntity, int duration, int distance) Creates a new Guardian Laser instanceGuardianLaser(org.bukkit.Location start, org.bukkit.Location end, int duration, int distance) Creates a new Guardian Laser instance -
Method Summary
Modifier and TypeMethodDescriptionvoidattachEndEntity(org.bukkit.entity.LivingEntity entity) Makes the laser follow an entity (moving end location).voidAsks viewers' clients to change the color of this laserprotected org.bukkit.Locationprotected org.bukkit.Locationorg.bukkit.LocationgetEnd()Gets the end location of the laser.org.bukkit.entity.EntityGets laser type.protected booleanisCloseEnough(org.bukkit.entity.Player player) voidmoveEnd(org.bukkit.Location location) Instantly moves the end of the laser to the location provided.voidmoveStart(org.bukkit.Location location) Instantly moves the start of the laser to the location provided.protected voidsendDestroyPackets(org.bukkit.entity.Player p) protected voidsendStartPackets(org.bukkit.entity.Player p, boolean hasSeen) Methods inherited from class fr.skytasul.guardianbeam.Laser
durationInTicks, executeEnd, getStart, isStarted, moveEnd, moveFakeEntity, moveStart, start, stop
-
Field Details
-
endEntity
protected org.bukkit.entity.LivingEntity endEntity
-
-
Constructor Details
-
GuardianLaser
public GuardianLaser(org.bukkit.Location start, org.bukkit.Location end, int duration, int distance) throws ReflectiveOperationException Creates a new Guardian Laser instance- Parameters:
start- Location where laser will startsend- Location where laser will endsduration- Duration of laser in seconds (-1 if infinite)distance- Distance where laser will be visible (-1 if infinite)- Throws:
ReflectiveOperationException- if a reflection exception occurred during Laser creation- See Also:
-
GuardianLaser
public GuardianLaser(org.bukkit.Location start, org.bukkit.entity.LivingEntity endEntity, int duration, int distance) throws ReflectiveOperationException Creates a new Guardian Laser instance- Parameters:
start- Location where laser will startsendEntity- Entity who the laser will followduration- Duration of laser in seconds (-1 if infinite)distance- Distance where laser will be visible (-1 if infinite)- Throws:
ReflectiveOperationException- if a reflection exception occurred during Laser creation- See Also:
-
-
Method Details
-
getLaserType
Description copied from class:LaserGets laser type.- Specified by:
getLaserTypein classLaser- Returns:
- LaserType enum constant of this laser
-
attachEndEntity
public void attachEndEntity(org.bukkit.entity.LivingEntity entity) throws ReflectiveOperationException Makes the laser follow an entity (moving end location). This is done client-side by making the fake guardian follow the existing entity. Hence, there is no consuming of server resources.- Parameters:
entity- living entity the laser will follow- Throws:
ReflectiveOperationException- if a reflection operation fails
-
getEndEntity
public org.bukkit.entity.Entity getEndEntity() -
getEnd
public org.bukkit.Location getEnd()Description copied from class:LaserGets the end location of the laser. -
getCorrectStart
protected org.bukkit.Location getCorrectStart() -
getCorrectEnd
protected org.bukkit.Location getCorrectEnd() -
isCloseEnough
protected boolean isCloseEnough(org.bukkit.entity.Player player) - Overrides:
isCloseEnoughin classLaser
-
sendStartPackets
protected void sendStartPackets(org.bukkit.entity.Player p, boolean hasSeen) throws ReflectiveOperationException - Specified by:
sendStartPacketsin classLaser- Throws:
ReflectiveOperationException
-
sendDestroyPackets
- Specified by:
sendDestroyPacketsin classLaser- Throws:
ReflectiveOperationException
-
moveStart
Description copied from class:LaserInstantly moves the start of the laser to the location provided.- Specified by:
moveStartin classLaser- Parameters:
location- New start location- Throws:
ReflectiveOperationException- if a reflection exception occurred during laser moving
-
moveEnd
Description copied from class:LaserInstantly moves the end of the laser to the location provided.- Specified by:
moveEndin classLaser- Parameters:
location- New end location- Throws:
ReflectiveOperationException- if a reflection exception occurred during laser moving
-
callColorChange
Asks viewers' clients to change the color of this laser- Throws:
ReflectiveOperationException
-