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>
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for serializerChangingSpread(double startingAmount, int resetTime, ModifySpreadWhen increaseChangeWhen, ChangingSpread.Bounds bounds) -
Method Summary
Modifier and TypeMethodDescriptiondoubleapplyChanges(EntityWrapper entityWrapper, double tempSpread, boolean mainHand, boolean updateSpreadChange) Applies all changes based on this changing spread.serialize(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, getParentKeywords, getWikiLink, letPassThrough, shouldSerialize, tryPathTo, useLater
-
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'sHandData.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 circumstancestempSpread- the spreadmainHand- whether main hand was usedupdateSpreadChange- whether to allow updating current spread change- Returns:
- the modifier holder with updated horizontal and vertical values
-
getKeyword
- Specified by:
getKeywordin interfaceme.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:
serializein interfaceme.deecaad.core.file.Serializer<ChangingSpread>- Throws:
me.deecaad.core.file.SerializerException
-