Renaming goals, second pass

This commit is contained in:
Auxilor
2022-03-02 16:22:18 +00:00
parent fb7799e931
commit 09d4db816e
10 changed files with 42 additions and 42 deletions

View File

@@ -2,9 +2,9 @@ package com.willfp.eco.core.entities.ai;
import com.google.common.collect.HashBiMap;
import com.willfp.eco.core.entities.ai.entity.EntityGoalAvoidEntity;
import com.willfp.eco.core.entities.ai.entity.EntityGoalBreakDoor;
import com.willfp.eco.core.entities.ai.entity.EntityGoalBreakDoors;
import com.willfp.eco.core.entities.ai.entity.EntityGoalBreatheAir;
import com.willfp.eco.core.entities.ai.entity.EntityGoalEatGround;
import com.willfp.eco.core.entities.ai.entity.EntityGoalEatGrass;
import com.willfp.eco.core.entities.ai.entity.EntityGoalFleeSun;
import com.willfp.eco.core.entities.ai.entity.EntityGoalFloat;
import com.willfp.eco.core.entities.ai.entity.EntityGoalFollowBoats;
@@ -51,9 +51,9 @@ public final class EntityGoals {
static {
register(EntityGoalAvoidEntity.DESERIALIZER);
register(EntityGoalBreakDoor.DESERIALIZER);
register(EntityGoalBreakDoors.DESERIALIZER);
register(EntityGoalBreatheAir.DESERIALIZER);
register(EntityGoalEatGround.DESERIALIZER);
register(EntityGoalEatGrass.DESERIALIZER);
register(EntityGoalFleeSun.DESERIALIZER);
register(EntityGoalFloat.DESERIALIZER);
register(EntityGoalFollowBoats.DESERIALIZER);

View File

@@ -7,7 +7,7 @@ import com.willfp.eco.core.entities.ai.target.TargetGoalNearestAttackable;
import com.willfp.eco.core.entities.ai.target.TargetGoalNearestAttackableWitch;
import com.willfp.eco.core.entities.ai.target.TargetGoalNearestHealableRaider;
import com.willfp.eco.core.entities.ai.target.TargetGoalNonTameRandom;
import com.willfp.eco.core.entities.ai.target.TargetGoalOwnerHurt;
import com.willfp.eco.core.entities.ai.target.TargetGoalOwnerTarget;
import com.willfp.eco.core.entities.ai.target.TargetGoalOwnerHurtBy;
import com.willfp.eco.core.entities.ai.target.TargetGoalResetUniversalAnger;
import com.willfp.eco.core.serialization.KeyedDeserializer;
@@ -33,7 +33,7 @@ public final class TargetGoals {
register(TargetGoalNearestAttackableWitch.DESERIALIZER);
register(TargetGoalNearestHealableRaider.DESERIALIZER);
register(TargetGoalNonTameRandom.DESERIALIZER);
register(TargetGoalOwnerHurt.DESERIALIZER);
register(TargetGoalOwnerTarget.DESERIALIZER);
register(TargetGoalOwnerHurtBy.DESERIALIZER);
register(TargetGoalResetUniversalAnger.DESERIALIZER);
}

View File

@@ -13,21 +13,21 @@ import org.jetbrains.annotations.Nullable;
*
* @param maxProgress The time taken to break the door (any integer above 240).
*/
public record EntityGoalBreakDoor(
public record EntityGoalBreakDoors(
int maxProgress
) implements EntityGoal<Mob> {
/**
* The deserializer for the goal.
*/
public static final KeyedDeserializer<EntityGoalBreakDoor> DESERIALIZER = new EntityGoalBreakDoor.Deserializer();
public static final KeyedDeserializer<EntityGoalBreakDoors> DESERIALIZER = new EntityGoalBreakDoors.Deserializer();
/**
* Deserialize configs into the goal.
*/
private static final class Deserializer implements KeyedDeserializer<EntityGoalBreakDoor> {
private static final class Deserializer implements KeyedDeserializer<EntityGoalBreakDoors> {
@Override
@Nullable
public EntityGoalBreakDoor deserialize(@NotNull final Config config) {
public EntityGoalBreakDoors deserialize(@NotNull final Config config) {
if (!(
config.has("maxProgress")
)) {
@@ -35,7 +35,7 @@ public record EntityGoalBreakDoor(
}
try {
return new EntityGoalBreakDoor(
return new EntityGoalBreakDoors(
config.getInt("maxProgress")
);
} catch (Exception e) {
@@ -51,7 +51,7 @@ public record EntityGoalBreakDoor(
@NotNull
@Override
public NamespacedKey getKey() {
return NamespacedKey.minecraft("break_door");
return NamespacedKey.minecraft("break_doors");
}
}
}

View File

@@ -10,26 +10,26 @@ import org.jetbrains.annotations.NotNull;
/**
* Allows an entity to eat the ground.
*/
public record EntityGoalEatGround(
public record EntityGoalEatGrass(
) implements EntityGoal<Mob> {
/**
* The deserializer for the goal.
*/
public static final KeyedDeserializer<EntityGoalEatGround> DESERIALIZER = new EntityGoalEatGround.Deserializer();
public static final KeyedDeserializer<EntityGoalEatGrass> DESERIALIZER = new EntityGoalEatGrass.Deserializer();
/**
* Deserialize configs into the goal.
*/
private static final class Deserializer implements KeyedDeserializer<EntityGoalEatGround> {
private static final class Deserializer implements KeyedDeserializer<EntityGoalEatGrass> {
@Override
public EntityGoalEatGround deserialize(@NotNull final Config config) {
return new EntityGoalEatGround();
public EntityGoalEatGrass deserialize(@NotNull final Config config) {
return new EntityGoalEatGrass();
}
@NotNull
@Override
public NamespacedKey getKey() {
return NamespacedKey.minecraft("eat_ground");
return NamespacedKey.minecraft("eat_grass");
}
}
}

View File

@@ -10,26 +10,26 @@ import org.jetbrains.annotations.NotNull;
/**
* Allows an entity to react when the owner hits a target.
*/
public record TargetGoalOwnerHurt(
public record TargetGoalOwnerTarget(
) implements TargetGoal<Tameable> {
/**
* The deserializer for the goal.
*/
public static final KeyedDeserializer<TargetGoalOwnerHurt> DESERIALIZER = new TargetGoalOwnerHurt.Deserializer();
public static final KeyedDeserializer<TargetGoalOwnerTarget> DESERIALIZER = new TargetGoalOwnerTarget.Deserializer();
/**
* Deserialize configs into the goal.
*/
private static final class Deserializer implements KeyedDeserializer<TargetGoalOwnerHurt> {
private static final class Deserializer implements KeyedDeserializer<TargetGoalOwnerTarget> {
@Override
public TargetGoalOwnerHurt deserialize(@NotNull final Config config) {
return new TargetGoalOwnerHurt();
public TargetGoalOwnerTarget deserialize(@NotNull final Config config) {
return new TargetGoalOwnerTarget();
}
@NotNull
@Override
public NamespacedKey getKey() {
return NamespacedKey.minecraft("owner_hurt");
return NamespacedKey.minecraft("owner_target");
}
}
}