Added remaining entity goals

This commit is contained in:
Auxilor
2022-03-01 20:40:45 +00:00
parent e09e9b4e8d
commit 2c51a6900f
8 changed files with 203 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
package com.willfp.eco.core.entities.ai.goals.entity;
import com.willfp.eco.core.entities.ai.goals.EntityGoal;
/**
* Restrict sun.
*/
public record EntityGoalRestrictSun(
) implements EntityGoal {
}

View File

@@ -0,0 +1,14 @@
package com.willfp.eco.core.entities.ai.goals.entity;
import com.willfp.eco.core.entities.ai.goals.EntityGoal;
/**
* Stroll through village.
*
* @param searchRange The search range.
*/
public record EntityGoalStrollThroughVillage(
int searchRange
) implements EntityGoal {
}

View File

@@ -0,0 +1,21 @@
package com.willfp.eco.core.entities.ai.goals.entity;
import com.willfp.eco.core.entities.ai.goals.EntityGoal;
import org.bukkit.inventory.ItemStack;
import java.util.Collection;
/**
* Be tempted by holding items.
*
* @param speed The speed at which the entity follows the item.
* @param items The items that the entity will be attracted by.
* @param canBeScared If the entity can be scared and lose track of the item.
*/
public record EntityGoalTempt(
double speed,
Collection<ItemStack> items,
boolean canBeScared
) implements EntityGoal {
}

View File

@@ -0,0 +1,11 @@
package com.willfp.eco.core.entities.ai.goals.entity;
import com.willfp.eco.core.entities.ai.goals.EntityGoal;
/**
* Try to find water.
*/
public record EntityGoalTryFindWater(
) implements EntityGoal {
}

View File

@@ -0,0 +1,24 @@
package com.willfp.eco.core.entities.ai.goals.entity;
import com.willfp.eco.core.entities.ai.goals.EntityGoal;
import org.bukkit.Sound;
import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import java.util.function.Predicate;
/**
* Use item.
*
* @param item The item.
* @param sound The sound to play on use.
* @param condition The condition when to use the item.
*/
public record EntityGoalUseItem(
@NotNull ItemStack item,
@NotNull Sound sound,
@NotNull Predicate<LivingEntity> condition
) implements EntityGoal {
}

View File

@@ -0,0 +1,14 @@
package com.willfp.eco.core.entities.ai.goals.entity;
import com.willfp.eco.core.entities.ai.goals.EntityGoal;
/**
* Fly randomly while avoiding water.
*
* @param speed The speed.
*/
public record EntityGoalWaterAvoidingRandomFlying(
double speed
) implements EntityGoal {
}

View File

@@ -0,0 +1,16 @@
package com.willfp.eco.core.entities.ai.goals.entity;
import com.willfp.eco.core.entities.ai.goals.EntityGoal;
/**
* Stroll randomly while avoiding water.
*
* @param speed The speed.
* @param chance The chance to stroll every tick, as a percentage.
*/
public record EntityGoalWaterAvoidingRandomStroll(
double speed,
double chance
) implements EntityGoal {
}