Bassebombecraft

Bassebombecraft

18.5k Downloads

Clarify if AddEffectAtClient operator should be used for SpawnDecoy2

athrane opened this issue ยท 0 comments

commented

The AddEffectAtClient operator is used for the decrease/increase size operators? Should it be used here as well.
Implementation is located inProjectileModifierEventHandler where it might should be added to:

	/**
	 * Create decoy operator.
	 * 
	 * The reason for not using the no-arg constructor for {@linkplain AddEffect2}
	 * is that it by default gets the target entity as living entity #1 from the
	 * ports.
	 * 
	 * But {@linkplain SpawnDecoy2} sets the created entity as living entity #2 in
	 * the ports.
	 * 
	 * In order for {@linkplain AddEffect2} to pick up the target from living entity
	 * #2 then its constructor is invoked with adapted functions.
	 */
	static Supplier<Operator2> splDecoyOp = () -> {
		Function<Ports, LivingEntity> fnGetTarget = getFnGetLivingEntity2();
		BiConsumer<Ports, EffectInstance> bcSetEffectInstance = getBcSetEffectInstance1();
		return new Sequence2(new SpawnDecoy2(), new AddEffect2(fnGetTarget, bcSetEffectInstance, RECEIVE_AGGRO_EFFECT,
				receiveAggroEffectDuration.get(), receiveAggroEffectAmplifier.get())

		// TODO: AddEffectAtClient be used as well?
		// AddEffectAtClient addOp2 = new AddEffectAtClient(ops.getSplTargetEntity(),
		// addOp.getSplEffectInstance());

		);
	};