Class ShootLocationChooser
java.lang.Object
me.deecaad.weaponmechanics.weapon.shoot.ShootLocationChooser
- All Implemented Interfaces:
me.deecaad.core.file.Serializer<ShootLocationChooser>
public class ShootLocationChooser
extends Object
implements me.deecaad.core.file.Serializer<ShootLocationChooser>
People can choose where the bullet is offset from depending on VR/Scope.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordKeeps track of the left and right shoot locations, since the position should probably be different for each arm. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for serializerShootLocationChooser(@NotNull ShootLocationChooser.ShootLocation def, @Nullable ShootLocationChooser.ShootLocation vr, @Nullable ShootLocationChooser.ShootLocation scope) -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable org.bukkit.LocationgetControllerPos(@NotNull org.bukkit.entity.LivingEntity entity, boolean isMainHand) Gets the controller position of the given entity.@NotNull ShootLocationChooser.ShootLocation@Nullable String@Nullable ShootLocationChooser.ShootLocationgetScope()@Nullable ShootLocationChooser.ShootLocationgetVR()@NotNull org.bukkit.Locationoffset(@NotNull EntityWrapper wrapper, boolean isMainHand) @NotNull ShootLocationChooserserialize(@NotNull me.deecaad.core.file.SerializeData data) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.deecaad.core.file.Serializer
canUsePathTo, getName, getWikiLink, letPassThrough, shouldSerialize, tryPathTo, useLater
-
Constructor Details
-
ShootLocationChooser
public ShootLocationChooser()Default constructor for serializer -
ShootLocationChooser
public ShootLocationChooser(@NotNull @NotNull ShootLocationChooser.ShootLocation def, @Nullable @Nullable ShootLocationChooser.ShootLocation vr, @Nullable @Nullable ShootLocationChooser.ShootLocation scope)
-
-
Method Details
-
getDefault
-
getVR
-
getScope
-
offset
@NotNull public @NotNull org.bukkit.Location offset(@NotNull @NotNull EntityWrapper wrapper, boolean isMainHand) -
getKeyword
- Specified by:
getKeywordin interfaceme.deecaad.core.file.Serializer<ShootLocationChooser>
-
getParentKeywords
- Specified by:
getParentKeywordsin interfaceme.deecaad.core.file.Serializer<ShootLocationChooser>
-
serialize
@NotNull public @NotNull ShootLocationChooser serialize(@NotNull @NotNull me.deecaad.core.file.SerializeData data) throws me.deecaad.core.file.SerializerException - Specified by:
serializein interfaceme.deecaad.core.file.Serializer<ShootLocationChooser>- Throws:
me.deecaad.core.file.SerializerException
-
getControllerPos
@Nullable public static @Nullable org.bukkit.Location getControllerPos(@NotNull @NotNull org.bukkit.entity.LivingEntity entity, boolean isMainHand) Gets the controller position of the given entity. If the entity is not a Vivecraft player, or the Vivecraft plugin is not installed, this will returnnull.- Parameters:
entity- The entity to get the controller position from.isMainHand-trueif the main hand is being used.- Returns:
- The controller position, or
null
-