Class ChangingSpread

java.lang.Object
me.deecaad.weaponmechanics.weapon.shoot.spread.ChangingSpread
All Implemented Interfaces:
me.deecaad.core.file.Serializer<ChangingSpread>

public class ChangingSpread extends Object implements me.deecaad.core.file.Serializer<ChangingSpread>
  • Constructor Details

    • ChangingSpread

      public ChangingSpread()
      Default constructor for serializer
    • ChangingSpread

      public ChangingSpread(double startingAmount, int resetTime, ModifySpreadWhen increaseChangeWhen, ChangingSpread.Bounds bounds)
  • Method Details

    • applyChanges

      public double applyChanges(EntityWrapper entityWrapper, double tempSpread, boolean mainHand, boolean updateSpreadChange)
      Applies all changes based on this changing spread. After changes are applied, also entity wrapper's HandData.getSpreadChange() is modified based on circumstances. This basically means that changes are always made for NEXT shot, not current.
      Parameters:
      entityWrapper - the entity wrapper used to check circumstances
      tempSpread - the spread
      mainHand - whether main hand was used
      updateSpreadChange - whether to allow updating current spread change
      Returns:
      the modifier holder with updated horizontal and vertical values
    • getKeyword

      public String getKeyword()
      Specified by:
      getKeyword in interface me.deecaad.core.file.Serializer<ChangingSpread>
    • serialize

      @NotNull public ChangingSpread serialize(@NotNull me.deecaad.core.file.SerializeData data) throws me.deecaad.core.file.SerializerException
      Specified by:
      serialize in interface me.deecaad.core.file.Serializer<ChangingSpread>
      Throws:
      me.deecaad.core.file.SerializerException