Merge remote-tracking branch 'origin/master'

This commit is contained in:
paulevsGitch 2021-11-30 12:38:59 +03:00
commit eca922058f
4 changed files with 23 additions and 21 deletions

View file

@ -1,5 +1,7 @@
package ru.betterend.entity; package ru.betterend.entity;
import java.util.EnumSet;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvent;
@ -21,7 +23,6 @@ import net.minecraft.world.entity.ai.navigation.FlyingPathNavigation;
import net.minecraft.world.entity.ai.navigation.PathNavigation; import net.minecraft.world.entity.ai.navigation.PathNavigation;
import net.minecraft.world.entity.ai.util.AirAndWaterRandomPos; import net.minecraft.world.entity.ai.util.AirAndWaterRandomPos;
import net.minecraft.world.entity.ai.util.HoverRandomPos; import net.minecraft.world.entity.ai.util.HoverRandomPos;
import net.minecraft.world.entity.animal.Animal;
import net.minecraft.world.entity.animal.FlyingAnimal; import net.minecraft.world.entity.animal.FlyingAnimal;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
@ -30,14 +31,13 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.pathfinder.BlockPathTypes; import net.minecraft.world.level.pathfinder.BlockPathTypes;
import net.minecraft.world.level.pathfinder.Path; import net.minecraft.world.level.pathfinder.Path;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import ru.bclib.entity.DespawnableAnimal;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.betterend.registry.EndEntities; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import java.util.EnumSet; public class DragonflyEntity extends DespawnableAnimal implements FlyingAnimal {
public class DragonflyEntity extends Animal implements FlyingAnimal {
public DragonflyEntity(EntityType<DragonflyEntity> entityType, Level world) { public DragonflyEntity(EntityType<DragonflyEntity> entityType, Level world) {
super(entityType, world); super(entityType, world);
this.moveControl = new FlyingMoveControl(this, 20, true); this.moveControl = new FlyingMoveControl(this, 20, true);

View file

@ -1,5 +1,9 @@
package ru.betterend.entity; package ru.betterend.entity;
import java.util.EnumSet;
import org.jetbrains.annotations.Nullable;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Registry; import net.minecraft.core.Registry;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
@ -27,7 +31,6 @@ import net.minecraft.world.entity.ai.navigation.FlyingPathNavigation;
import net.minecraft.world.entity.ai.navigation.PathNavigation; import net.minecraft.world.entity.ai.navigation.PathNavigation;
import net.minecraft.world.entity.ai.util.AirAndWaterRandomPos; import net.minecraft.world.entity.ai.util.AirAndWaterRandomPos;
import net.minecraft.world.entity.ai.util.HoverRandomPos; import net.minecraft.world.entity.ai.util.HoverRandomPos;
import net.minecraft.world.entity.animal.Animal;
import net.minecraft.world.entity.animal.FlyingAnimal; import net.minecraft.world.entity.animal.FlyingAnimal;
import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
@ -38,7 +41,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.pathfinder.BlockPathTypes; import net.minecraft.world.level.pathfinder.BlockPathTypes;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.Nullable; import ru.bclib.entity.DespawnableAnimal;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
@ -47,9 +50,7 @@ import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndEntities; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EndItems; import ru.betterend.registry.EndItems;
import java.util.EnumSet; public class SilkMothEntity extends DespawnableAnimal implements FlyingAnimal {
public class SilkMothEntity extends Animal implements FlyingAnimal {
private BlockPos hivePos; private BlockPos hivePos;
private BlockPos entrance; private BlockPos entrance;
private Level hiveWorld; private Level hiveWorld;

View file

@ -12,7 +12,7 @@ import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.MobCategory; import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier.Builder; import net.minecraft.world.entity.ai.attributes.AttributeSupplier.Builder;
import net.minecraft.world.level.levelgen.Heightmap.Types; import net.minecraft.world.level.levelgen.Heightmap.Types;
import ru.bclib.api.spawning.SpawnRuleBulder; import ru.bclib.api.spawning.SpawnRuleBuilder;
import ru.bclib.util.ColorUtil; import ru.bclib.util.ColorUtil;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.config.Configs; import ru.betterend.config.Configs;
@ -93,11 +93,11 @@ public class EndEntities {
public static void register() { public static void register() {
// Air // // Air //
SpawnRuleBulder.start(DRAGONFLY).aboveGround(2).maxNearby(8).buildNoRestrictions(Types.MOTION_BLOCKING); SpawnRuleBuilder.start(DRAGONFLY).aboveGround(2).maxNearby(8).buildNoRestrictions(Types.MOTION_BLOCKING);
SpawnRuleBulder.start(SILK_MOTH).aboveGround(2).maxNearby(4).buildNoRestrictions(Types.MOTION_BLOCKING); SpawnRuleBuilder.start(SILK_MOTH).aboveGround(2).maxNearby(4).buildNoRestrictions(Types.MOTION_BLOCKING);
// Land // // Land //
SpawnRuleBulder SpawnRuleBuilder
.start(END_SLIME) .start(END_SLIME)
.notPeaceful() .notPeaceful()
.maxNearby(4, 64) .maxNearby(4, 64)
@ -105,11 +105,11 @@ public class EndEntities {
.customRule(EndSlimeEntity::canSpawn) .customRule(EndSlimeEntity::canSpawn)
.buildNoRestrictions(Types.MOTION_BLOCKING); .buildNoRestrictions(Types.MOTION_BLOCKING);
SpawnRuleBulder.start(SHADOW_WALKER).vanillaHostile().onlyOnValidBlocks().maxNearby(8, 64).buildNoRestrictions(Types.MOTION_BLOCKING); SpawnRuleBuilder.start(SHADOW_WALKER).vanillaHostile().onlyOnValidBlocks().maxNearby(8, 64).buildNoRestrictions(Types.MOTION_BLOCKING);
// Water // // Water //
SpawnRuleBulder.start(END_FISH).maxNearby(8, 64).buildInWater(Types.MOTION_BLOCKING); SpawnRuleBuilder.start(END_FISH).maxNearby(8, 64).buildInWater(Types.MOTION_BLOCKING);
SpawnRuleBulder.start(CUBOZOA).maxNearby(8, 64).buildInWater(Types.MOTION_BLOCKING); SpawnRuleBuilder.start(CUBOZOA).maxNearby(8, 64).buildInWater(Types.MOTION_BLOCKING);
} }
protected static <T extends Entity> EntityType<T> register(String name, MobCategory group, float width, float height, EntityFactory<T> entity) { protected static <T extends Entity> EntityType<T> register(String name, MobCategory group, float width, float height, EntityFactory<T> entity) {

View file

@ -1,6 +1,10 @@
package ru.betterend.registry; package ru.betterend.registry;
import java.util.List;
import java.util.function.Supplier;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
@ -83,9 +87,6 @@ import ru.betterend.world.features.trees.UmbrellaTreeFeature;
import ru.betterend.world.generator.GeneratorOptions; import ru.betterend.world.generator.GeneratorOptions;
import ru.betterend.world.surface.UmbraSurfaceBuilder; import ru.betterend.world.surface.UmbraSurfaceBuilder;
import java.util.List;
import java.util.function.Supplier;
public class EndFeatures { public class EndFeatures {
// Trees // // Trees //
public static final BCLFeature MOSSY_GLOWSHROOM = redisterVegetation("mossy_glowshroom", new MossyGlowshroomFeature(), 3); public static final BCLFeature MOSSY_GLOWSHROOM = redisterVegetation("mossy_glowshroom", new MossyGlowshroomFeature(), 3);
@ -290,7 +291,7 @@ public class EndFeatures {
} }
private static BCLFeature registerOre(String name, Block blockOre, int veins, int veinSize, int offset, int minY, int maxY) { private static BCLFeature registerOre(String name, Block blockOre, int veins, int veinSize, int offset, int minY, int maxY) {
return BCLFeature.makeOreFeature(BetterEnd.makeID(name), blockOre, veins, veinSize, offset, minY, maxY); return BCLFeature.makeOreFeature(BetterEnd.makeID(name), blockOre, Blocks.END_STONE, veins, veinSize, offset, minY, maxY);
} }
private static BCLFeature registerLayer(String name, Block block, float radius, int minY, int maxY, int count) { private static BCLFeature registerLayer(String name, Block block, float radius, int minY, int maxY, int count) {