Package com.teampotato.potacore.entity
Class ProjectileHelper
java.lang.Object
com.teampotato.potacore.entity.ProjectileHelper
A utility class for handling projectile-related entity operations with deduplication logic.
This class provides a method to process two potentially related entities while ensuring the same entity isn't processed twice when both references point to the same entity.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidhandle(@Nullable net.minecraft.world.entity.Entity entity, @Nullable net.minecraft.world.entity.Entity directEntity, @NotNull Runnable action) Processes the specified entities with the given action, avoiding duplicate processing when both parameters refer to the same entity.
-
Constructor Details
-
ProjectileHelper
public ProjectileHelper()
-
-
Method Details
-
handle
public static void handle(@Nullable @Nullable net.minecraft.world.entity.Entity entity, @Nullable @Nullable net.minecraft.world.entity.Entity directEntity, @NotNull @NotNull Runnable action) Processes the specified entities with the given action, avoiding duplicate processing when both parameters refer to the same entity.- Parameters:
entity- The primary entity to process (typically a projectile). May be null.directEntity- The direct source entity to process (typically the projectile owner). May be null.action- The non-null runnable action to perform.- Throws:
NullPointerException- ifactionis null
-