Store additional spawn-information along with an entity

This commit is contained in:
Frank 2021-12-10 00:26:09 +01:00
parent 7292c3cf3a
commit 5be62802e8
5 changed files with 58 additions and 0 deletions

View file

@ -13,6 +13,7 @@ import net.minecraft.world.entity.SpawnPlacements.Type;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.levelgen.Heightmap.Types;
import net.minecraft.world.phys.AABB;
import ru.bclib.entity.BCLEntityWrapper;
import ru.bclib.interfaces.SpawnRule;
import java.util.Arrays;
@ -33,6 +34,7 @@ public class SpawnRuleBuilder<M extends Mob> {
/**
* Starts new rule building process.
* @param entityType The entity you want to build a rule for
* @return prepared {@link SpawnRuleBuilder} instance.
*/
public static SpawnRuleBuilder start(EntityType<? extends Mob> entityType) {
@ -41,6 +43,15 @@ public class SpawnRuleBuilder<M extends Mob> {
return INSTANCE;
}
/**
* Starts new rule building process.
* @param entityType The entity you want to build a rule for
* @return prepared {@link SpawnRuleBuilder} instance.
*/
public static SpawnRuleBuilder start(BCLEntityWrapper<? extends Mob> entityType) {
return start(entityType.type());
}
/**
* Stop entity spawn on peaceful {@link Difficulty}
* @return same {@link SpawnRuleBuilder} instance.