diff --git a/src/client/java/net/rotgruengelb/forestal/ForestalClient.java b/src/client/java/net/rotgruengelb/forestal/ForestalClient.java index 06941d9..59b959c 100644 --- a/src/client/java/net/rotgruengelb/forestal/ForestalClient.java +++ b/src/client/java/net/rotgruengelb/forestal/ForestalClient.java @@ -1,9 +1,12 @@ package net.rotgruengelb.forestal; import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry; +import net.minecraft.client.render.RenderLayer; +import net.rotgruengelb.forestal.block.ForestalBlocks; import net.rotgruengelb.forestal.client.particle.ForestalParticleFactories; -import net.rotgruengelb.forestal.client.render.entity.DeerEntityRenderer; +import net.rotgruengelb.forestal.client.render.entity.BlackBearEntityRenderer; import net.rotgruengelb.forestal.client.render.entity.GrizzlyBearEntityRenderer; import net.rotgruengelb.forestal.entity.ForestalEntities; @@ -12,8 +15,11 @@ public class ForestalClient implements ClientModInitializer { public void onInitializeClient() { EntityRendererRegistry.register(ForestalEntities.GRIZZLY_BEAR, GrizzlyBearEntityRenderer::new); -// EntityRendererRegistry.register(ForestalEntities.DEER, DeerEntityRenderer::new); + EntityRendererRegistry.register(ForestalEntities.BLACK_BEAR, BlackBearEntityRenderer::new); + // EntityRendererRegistry.register(ForestalEntities.DEER, DeerEntityRenderer::new); ForestalParticleFactories.registerModParticleFactories(); + + BlockRenderLayerMap.INSTANCE.putBlock(ForestalBlocks.PUFFED_DANDELION, RenderLayer.getCutout()); } } \ No newline at end of file diff --git a/src/client/java/net/rotgruengelb/forestal/client/particle/DandelionPappusParticle.java b/src/client/java/net/rotgruengelb/forestal/client/particle/DandelionPappusParticle.java new file mode 100644 index 0000000..7db1c10 --- /dev/null +++ b/src/client/java/net/rotgruengelb/forestal/client/particle/DandelionPappusParticle.java @@ -0,0 +1,66 @@ +package net.rotgruengelb.forestal.client.particle; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.particle.*; +import net.minecraft.client.world.ClientWorld; + +@Environment(value = EnvType.CLIENT) +public class DandelionPappusParticle extends SpriteBillboardParticle { + private final float j; + private final float k; + private float l; + + protected DandelionPappusParticle(ClientWorld world, double x, double y, double z, SpriteProvider spriteProvider) { + super(world, x, y, z); + float f; + this.setSprite(spriteProvider); + this.l = (float) Math.toRadians(this.random.nextBoolean() ? -30.0 : 30.0); + this.j = this.random.nextFloat(); + this.k = (float) Math.toRadians(this.random.nextBoolean() ? -5.0 : 5.0); + this.maxAge = 300; + this.gravityStrength = 5E-4f; + this.scale = f = this.random.nextBoolean() ? 0.05f : 0.075f; + this.setBoundingBoxSpacing(f, f); + this.velocityMultiplier = 0.8f; + } + + @Override + public ParticleTextureSheet getType() { + return ParticleTextureSheet.PARTICLE_SHEET_OPAQUE; + } + + @Override + public void tick() { + this.prevPosX = this.x; + this.prevPosY = this.y; + this.prevPosZ = this.z; + if (this.maxAge-- <= 0) { + this.markDead(); + } + if (this.dead) { + return; + } + float f = 300 - this.maxAge; + float g = Math.min(f / 300.0f, 1.0f); + double d = Math.cos(Math.toRadians(this.j * 60.0f)) * 2.0 * Math.pow(g, 1.25); + double e = Math.sin(Math.toRadians(this.j * 60.0f)) * 2.0 * Math.pow(g, 1.25); + this.velocityX += d * (double) 0.0025f; + this.velocityZ += e * (double) 0.0025f; + this.velocityY -= this.gravityStrength; + this.l += this.k / 20.0f; + this.prevAngle = this.angle; + this.angle += this.l / 20.0f; + this.move(this.velocityX, this.velocityY, this.velocityZ); + if (this.onGround || this.maxAge < 299 && (this.velocityX == 0.0 || this.velocityZ == 0.0)) { + this.markDead(); + } + if (this.dead) { + return; + } + this.velocityX *= this.velocityMultiplier * (this.random.nextBoolean() ? 1.15 : 1.25); + this.velocityY *= this.velocityMultiplier; + this.velocityZ *= this.velocityMultiplier * (this.random.nextBoolean() ? 1.15 : 1.25); + } +} + diff --git a/src/client/java/net/rotgruengelb/forestal/client/particle/ForestalParticleFactories.java b/src/client/java/net/rotgruengelb/forestal/client/particle/ForestalParticleFactories.java index 19786de..4dda09d 100644 --- a/src/client/java/net/rotgruengelb/forestal/client/particle/ForestalParticleFactories.java +++ b/src/client/java/net/rotgruengelb/forestal/client/particle/ForestalParticleFactories.java @@ -8,6 +8,7 @@ public class ForestalParticleFactories { public static void registerModParticleFactories() { registerSleepingParticle(ForestalParticleTypes.SLEEPING_ZZZ); + registerDandelionPappusParticle(ForestalParticleTypes.DANDELION_PAPPUS); } public static void registerSleepingParticle(DefaultParticleType particleType) { @@ -17,4 +18,9 @@ public static void registerSleepingParticle(DefaultParticleType particleType) { return factory.createParticle(particleType, world, x, y, z, velocityX, velocityY, velocityZ); }); } + + public static void registerDandelionPappusParticle(DefaultParticleType particleType) { + ParticleFactoryRegistry.getInstance() + .register(particleType, provider -> (parameters, world, x, y, z, velocityX, velocityY, velocityZ) -> new DandelionPappusParticle(world, x, y, z, provider)); + } } diff --git a/src/client/java/net/rotgruengelb/forestal/client/render/entity/BlackBearEntityRenderer.java b/src/client/java/net/rotgruengelb/forestal/client/render/entity/BlackBearEntityRenderer.java new file mode 100644 index 0000000..256aab5 --- /dev/null +++ b/src/client/java/net/rotgruengelb/forestal/client/render/entity/BlackBearEntityRenderer.java @@ -0,0 +1,37 @@ +package net.rotgruengelb.forestal.client.render.entity; + +import net.minecraft.client.render.VertexConsumerProvider; +import net.minecraft.client.render.entity.EntityRendererFactory; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.util.Identifier; +import net.rotgruengelb.forestal.Forestal; +import net.rotgruengelb.forestal.client.render.entity.model.BlackBearEntityModel; +import net.rotgruengelb.forestal.entity.BlackBearEntity; +import software.bernie.geckolib.renderer.GeoEntityRenderer; + +public class BlackBearEntityRenderer extends GeoEntityRenderer { + + public BlackBearEntityRenderer(EntityRendererFactory.Context renderManager) { + super(renderManager, new BlackBearEntityModel()); + } + + @Override + public Identifier getTextureLocation(BlackBearEntity grizzlyBear) { + if (grizzlyBear.isSleeping()) { + return new Identifier(Forestal.MOD_ID, "textures/entity/black_bear/black_bear_sleeping.png"); + } + return new Identifier(Forestal.MOD_ID, "textures/entity/black_bear/black_bear_normal.png"); + } + + @Override + public void render(BlackBearEntity grizzlyBearEntity, float entityYaw, float partialTick, MatrixStack poseStack, VertexConsumerProvider bufferSource, int packedLight) { + poseStack.scale(1.6F, 1.6F, 1.6F); + if (grizzlyBearEntity.isBaby()) { + poseStack.scale(0.6F, 0.6F, 0.6F); + } + if (grizzlyBearEntity.isSleeping()) { + poseStack.translate(0, -0.5, 0); + } + super.render(grizzlyBearEntity, entityYaw, partialTick, poseStack, bufferSource, packedLight); + } +} diff --git a/src/client/java/net/rotgruengelb/forestal/client/render/entity/model/BlackBearEntityModel.java b/src/client/java/net/rotgruengelb/forestal/client/render/entity/model/BlackBearEntityModel.java new file mode 100644 index 0000000..7163ff6 --- /dev/null +++ b/src/client/java/net/rotgruengelb/forestal/client/render/entity/model/BlackBearEntityModel.java @@ -0,0 +1,42 @@ +package net.rotgruengelb.forestal.client.render.entity.model; + +import net.minecraft.util.Identifier; +import net.minecraft.util.math.MathHelper; +import net.rotgruengelb.forestal.Forestal; +import net.rotgruengelb.forestal.entity.BlackBearEntity; +import software.bernie.geckolib.constant.DataTickets; +import software.bernie.geckolib.core.animatable.model.CoreGeoBone; +import software.bernie.geckolib.core.animation.AnimationState; +import software.bernie.geckolib.model.GeoModel; +import software.bernie.geckolib.model.data.EntityModelData; + +public class BlackBearEntityModel extends GeoModel { + @Override + public Identifier getModelResource(BlackBearEntity animatable) { + return new Identifier(Forestal.MOD_ID, "geo/black_bear.geo.json"); + } + + @Override + public Identifier getTextureResource(BlackBearEntity grizzlyBear) { + if (grizzlyBear.isSleeping()) { + return new Identifier(Forestal.MOD_ID, "textures/entity/black_bear/black_bear_sleeping.png"); + } + return new Identifier(Forestal.MOD_ID, "textures/entity/black_bear/black_bear_normal.png"); + } + + @Override + public Identifier getAnimationResource(BlackBearEntity animatable) { + return new Identifier(Forestal.MOD_ID, "animations/black_bear.animation.json"); + } + + @Override + public void setCustomAnimations(BlackBearEntity animatable, long instanceId, AnimationState animationState) { + CoreGeoBone head = getAnimationProcessor().getBone("head"); + + if (head != null) { + EntityModelData entityData = animationState.getData(DataTickets.ENTITY_MODEL_DATA); + head.setRotX(entityData.headPitch() * MathHelper.RADIANS_PER_DEGREE); + head.setRotY(entityData.netHeadYaw() * MathHelper.RADIANS_PER_DEGREE); + } + } +} diff --git a/src/main/java/net/rotgruengelb/forestal/block/ForestalBlocks.java b/src/main/java/net/rotgruengelb/forestal/block/ForestalBlocks.java index d44c10c..c3ad1e1 100644 --- a/src/main/java/net/rotgruengelb/forestal/block/ForestalBlocks.java +++ b/src/main/java/net/rotgruengelb/forestal/block/ForestalBlocks.java @@ -4,6 +4,7 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.block.Block; import net.minecraft.block.Blocks; +import net.minecraft.block.MapColor; import net.minecraft.item.BlockItem; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; @@ -13,10 +14,13 @@ public class ForestalBlocks { - public static final Block GRIZZLY_PLUSHIE = registerBlock("grizzly_plushie", new PlushieBlock(FabricBlockSettings.create() + public static final Block GRIZZLY_BEAR_PLUSHIE = registerBlock("grizzly_bear_plushie", new PlushieBlock(FabricBlockSettings.create() .nonOpaque().breakInstantly().noBlockBreakParticles().sounds(BlockSoundGroup.WOOL))); - public static final Block PUFFED_DANDELION = registerBlock("puffed_dandelion", - new PuffedDandelionBlock(FabricBlockSettings.copyOf(Blocks.DANDELION))); + public static final Block BLACK_BEAR_PLUSHIE = registerBlock("black_bear_plushie", + new PlushieBlock(FabricBlockSettings.create() + .nonOpaque().breakInstantly().noBlockBreakParticles().sounds(BlockSoundGroup.WOOL))); + public static final Block PUFFED_DANDELION = registerBlock("puffed_dandelion", new PuffedDandelionBlock(FabricBlockSettings.copyOf(Blocks.DANDELION) + .mapColor(MapColor.OFF_WHITE))); private static Block registerBlockNoItem(String name, Block block) { return Registry.register(Registries.BLOCK, new Identifier(Forestal.MOD_ID, name), block); diff --git a/src/main/java/net/rotgruengelb/forestal/block/PuffedDandelionBlock.java b/src/main/java/net/rotgruengelb/forestal/block/PuffedDandelionBlock.java index 1d4a49d..fb7483e 100644 --- a/src/main/java/net/rotgruengelb/forestal/block/PuffedDandelionBlock.java +++ b/src/main/java/net/rotgruengelb/forestal/block/PuffedDandelionBlock.java @@ -1,16 +1,21 @@ package net.rotgruengelb.forestal.block; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.fabricmc.fabric.api.tag.convention.v1.ConventionalBiomeTags; import net.minecraft.block.BlockState; -import net.minecraft.block.CherryLeavesBlock; import net.minecraft.block.FlowerBlock; -import net.minecraft.client.util.ParticleUtil; import net.minecraft.entity.effect.StatusEffects; -import net.minecraft.particle.ParticleTypes; +import net.minecraft.particle.ParticleEffect; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; +import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.random.Random; import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.dimension.DimensionType; +import net.rotgruengelb.forestal.particle.ForestalParticleTypes; + +import java.awt.*; public class PuffedDandelionBlock extends FlowerBlock { @@ -18,17 +23,35 @@ public PuffedDandelionBlock(FabricBlockSettings settings) { super(StatusEffects.SATURATION, 7, settings); } + public static void spawnParticle(World world, Vec3d pos, Random random, ParticleEffect effect) { + double d = pos.getX() + (random.nextDouble() / 2); + double e = pos.getY() - 0.05; + double f = pos.getZ() + (random.nextDouble() / 2); + world.addParticle(effect, d, e, f, 0.0, 0.0, 0.0); + } + + public int particlesFrequency(World world, BlockPos pos) { + if (world.hasRain(pos)) { return 1; } + + final RegistryEntry biome = world.getBiome(pos); + final DimensionType dim = world.getDimension(); + + int freq = 19; + if (biome.isIn(ConventionalBiomeTags.IN_NETHER) || dim.ultrawarm()) { freq += 5; } + if (biome.isIn(ConventionalBiomeTags.CLIMATE_DRY)) { freq += 6; } + if (!world.isSkyVisible(pos) || world.isRaining()) { freq += 2; } + if (!biome.isIn(ConventionalBiomeTags.FLORAL)) { freq += 3; } + return freq; + } + @Override public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) { super.randomDisplayTick(state, world, pos, random); - if (random.nextInt(10) != 0) { - return; - } - BlockPos blockPos = pos.down(); - BlockState blockState = world.getBlockState(blockPos); - if (CherryLeavesBlock.isFaceFullSquare(blockState.getCollisionShape(world, blockPos), Direction.UP)) { + if (random.nextInt(particlesFrequency(world, pos)) != 2) { return; } - ParticleUtil.spawnParticle(world, pos, random, ParticleTypes.CHERRY_LEAVES); + double spawnY = (pos.getY() + (random.nextBoolean() ? 0.7 : 0.5)); + Vec3d particlePos = new Vec3d(pos.getX(), spawnY, pos.getZ()); + spawnParticle(world, particlePos, random, ForestalParticleTypes.DANDELION_PAPPUS); } } diff --git a/src/main/java/net/rotgruengelb/forestal/entity/BearEntity.java b/src/main/java/net/rotgruengelb/forestal/entity/BearEntity.java index e3dea8b..86de9f7 100644 --- a/src/main/java/net/rotgruengelb/forestal/entity/BearEntity.java +++ b/src/main/java/net/rotgruengelb/forestal/entity/BearEntity.java @@ -1,7 +1,9 @@ package net.rotgruengelb.forestal.entity; +import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.minecraft.block.BlockState; import net.minecraft.entity.EntityType; +import net.minecraft.entity.ItemEntity; import net.minecraft.entity.SpawnReason; import net.minecraft.entity.ai.goal.*; import net.minecraft.entity.attribute.DefaultAttributeContainer; @@ -17,35 +19,44 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.loot.LootTable; +import net.minecraft.loot.context.LootContextParameterSet; +import net.minecraft.loot.context.LootContextParameters; +import net.minecraft.loot.context.LootContextTypes; import net.minecraft.nbt.NbtCompound; import net.minecraft.recipe.Ingredient; import net.minecraft.registry.tag.BlockTags; import net.minecraft.registry.tag.TagKey; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundEvent; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.random.Random; import net.minecraft.world.ServerWorldAccess; import net.minecraft.world.World; import net.rotgruengelb.forestal.sound.ForestalSoundEvents; +import net.rotgruengelb.forestal.util.ForestalTags; import org.jetbrains.annotations.Nullable; import java.util.EnumSet; public class BearEntity extends AnimalEntity { - public static final SoundEvent SOUND_DEATH = ForestalSoundEvents.ENTITY_GRIZZLY_BEAR_DEATH; private static final TrackedData BEAR_FLAGS = DataTracker.registerData(BearEntity.class, TrackedDataHandlerRegistry.BYTE); private static final int SLEEPING_FLAG = 1; - public static SoundEvent SOUND_AMBIENT_BABY; - public static SoundEvent SOUND_AMBIENT; - public static SoundEvent SOUND_STEP; - public static SoundEvent SOUND_HURT; - public static TagKey FOOD_TAG; + protected SoundEvent SOUND_DEATH; + protected Identifier BRUSHING_LOOTTABLE; + protected SoundEvent SOUND_AMBIENT_BABY; + protected SoundEvent SOUND_AMBIENT; + protected SoundEvent SOUND_STEP; + protected SoundEvent SOUND_HURT; + protected TagKey FOOD_TAG; public BearEntity(EntityType entityType, World world) { super(entityType, world); - setStepHeight(1.0f); + this.setStepHeight(1.0f); } public static DefaultAttributeContainer.Builder createBearAttributes() { @@ -83,6 +94,31 @@ private void setBearFlag(int mask, boolean value) { } + @Override + public ActionResult interactMob(PlayerEntity player, Hand hand) { + ItemStack stackInHand = player.getStackInHand(hand); + if (this.isBaby() || !stackInHand.isIn(ForestalTags.Items.BEAR_BRUSH)) { + return super.interactMob(player, hand); + } + //~ ~~ <*))>< ~~ ~ + if (!this.getWorld().isClient) { + final LootTable lootTable = this.getWorld().getServer().getLootManager() + .getLootTable(BRUSHING_LOOTTABLE); + final ObjectArrayList loot = lootTable.generateLoot(new LootContextParameterSet.Builder((ServerWorld) this.getWorld()).add(LootContextParameters.ORIGIN, this.getPos()) + .add(LootContextParameters.THIS_ENTITY, this).build(LootContextTypes.GIFT)); + for (ItemStack itemStack : loot) { + ItemEntity itemEntity = this.dropStack(itemStack, 1.6f); + if (itemEntity != null) { + itemEntity.setVelocity(itemEntity.getVelocity() + .add((this.random.nextFloat() - this.random.nextFloat()) * 0.1F, this.random.nextFloat() * 0.05F, (this.random.nextFloat() - this.random.nextFloat()) * 0.1F)); + } + } + stackInHand.damage(this.random.nextInt(16), player, (playerEntity) -> playerEntity.sendToolBreakStatus(hand)); + this.playSound(ForestalSoundEvents.ENTITY_GENERIC_BEAR_BRUSH, 1.0f, 1.0f); + } + return ActionResult.success(this.getWorld().isClient); + } + @Nullable @Override public PassiveEntity createChild(ServerWorld world, PassiveEntity entity) { @@ -109,24 +145,24 @@ public boolean isBreedingItem(ItemStack stack) { @Override public void initGoals() { super.initGoals(); - this.goalSelector.add(0, new SwimGoal(this)); - this.goalSelector.add(1, new EscapeDangerGoal(this, 1.1)); - this.goalSelector.add(2, new AnimalMateGoal(this, 1.05)); - this.goalSelector.add(3, new TemptGoal(this, 0.9, Ingredient.fromTag(FOOD_TAG), false)); - this.goalSelector.add(4, new FindSleepingPlaceGoal(0.85)); - this.goalSelector.add(5, new SleepGoal()); - this.goalSelector.add(6, new FollowParentGoal(this, 0.95)); - this.goalSelector.add(7, new WanderAroundFarGoal(this, 0.9)); - this.goalSelector.add(8, new WanderAroundGoal(this, 0.85)); - this.goalSelector.add(9, new LookAtEntityGoal(this, PlayerEntity.class, 6.0f, 0.017f)); - this.goalSelector.add(10, new LookAtEntityGoal(this, VillagerEntity.class, 4.0f, 0.007f)); - this.goalSelector.add(11, new LookAroundGoal(this)); + goalSelector.add(0, new SwimGoal(this)); + goalSelector.add(1, new EscapeDangerGoal(this, 1.1)); + goalSelector.add(2, new AnimalMateGoal(this, 1.05)); + goalSelector.add(3, new TemptGoal(this, 0.9, Ingredient.fromTag(FOOD_TAG), false)); + // goalSelector.add(4, new FindSleepingPlaceGoal(0.85)); + // goalSelector.add(5, new SleepGoal()); + goalSelector.add(6, new FollowParentGoal(this, 0.95)); + goalSelector.add(7, new WanderAroundFarGoal(this, 0.9)); + goalSelector.add(8, new WanderAroundGoal(this, 0.85)); + goalSelector.add(9, new LookAtEntityGoal(this, PlayerEntity.class, 6.0f, 0.017f)); + goalSelector.add(10, new LookAtEntityGoal(this, VillagerEntity.class, 4.0f, 0.007f)); + goalSelector.add(11, new LookAroundGoal(this)); } @Override public void tick() { super.tick(); - if (this.canMoveVoluntarily() && this.isTouchingWater() || this.getWorld().isDay()) { + if (this.canMoveVoluntarily() && this.isTouchingWater()) { this.setSleeping(false); } } @@ -190,22 +226,22 @@ protected boolean isAtFavoredLocation() { public boolean canStart() { if (BearEntity.this.sidewaysSpeed == 0.0F && BearEntity.this.upwardSpeed == 0.0F && BearEntity.this.forwardSpeed == 0.0F && BearEntity.this.getWorld() .isNight()) { - return this.canNotSleep() || !BearEntity.this.isSleeping(); + return this.canSleep() || !BearEntity.this.isSleeping(); } else { return false; } } public boolean shouldContinue() { - return this.canNotSleep(); + return this.canSleep(); } - private boolean canNotSleep() { + private boolean canSleep() { if (this.timer > 0) { --this.timer; return false; } else { - return this.isAtFavoredLocation() && !BearEntity.this.inPowderSnow; // && + return this.isAtFavoredLocation() && !BearEntity.this.inPowderSnow; } } diff --git a/src/main/java/net/rotgruengelb/forestal/entity/BlackBearEntity.java b/src/main/java/net/rotgruengelb/forestal/entity/BlackBearEntity.java new file mode 100644 index 0000000..ff388b9 --- /dev/null +++ b/src/main/java/net/rotgruengelb/forestal/entity/BlackBearEntity.java @@ -0,0 +1,51 @@ +package net.rotgruengelb.forestal.entity; + +import net.minecraft.entity.EntityType; +import net.minecraft.entity.passive.AnimalEntity; +import net.minecraft.world.World; +import net.rotgruengelb.forestal.loot.ForestalLootTables; +import net.rotgruengelb.forestal.sound.ForestalSoundEvents; +import net.rotgruengelb.forestal.util.ForestalTags; +import software.bernie.geckolib.animatable.GeoEntity; +import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache; +import software.bernie.geckolib.core.animatable.instance.SingletonAnimatableInstanceCache; +import software.bernie.geckolib.core.animation.*; +import software.bernie.geckolib.core.object.PlayState; + +public class BlackBearEntity extends BearEntity implements GeoEntity { + + private final AnimatableInstanceCache cache = new SingletonAnimatableInstanceCache(this); + + public BlackBearEntity(EntityType entityType, World world) { + super(entityType, world); + SOUND_AMBIENT_BABY = ForestalSoundEvents.ENTITY_BLACK_BEAR_AMBIENT_BABY; + SOUND_AMBIENT = ForestalSoundEvents.ENTITY_BLACK_BEAR_AMBIENT; + SOUND_DEATH = ForestalSoundEvents.ENTITY_BLACK_BEAR_DEATH; + SOUND_STEP = ForestalSoundEvents.ENTITY_BLACK_BEAR_STEP; + SOUND_HURT = ForestalSoundEvents.ENTITY_BLACK_BEAR_HURT; + FOOD_TAG = ForestalTags.Items.BLACK_BEAR_FOOD; + BRUSHING_LOOTTABLE = ForestalLootTables.BLACK_BEAR_BRUSHING_GAMEPLAY; + } + + @Override + public void registerControllers(AnimatableManager.ControllerRegistrar controllers) { + controllers.add(new AnimationController<>(this, "controller", 0, this::predicate)); + } + + private PlayState predicate(AnimationState animationState) { + if (animationState.getAnimatable().isSleeping()) { + animationState.getController().setAnimation(RawAnimation.begin() + .then("animation.black_bear.sleep", Animation.LoopType.LOOP)); + } else if (animationState.isMoving() && !this.isSleeping()) { + animationState.getController().setAnimation(RawAnimation.begin() + .then("animation.black_bear.walk", Animation.LoopType.LOOP)); + } else { + animationState.getController().setAnimation(RawAnimation.begin() + .then("animation.black_bear.idle", Animation.LoopType.LOOP)); + } + return PlayState.CONTINUE; + } + + @Override + public AnimatableInstanceCache getAnimatableInstanceCache() { return cache; } +} diff --git a/src/main/java/net/rotgruengelb/forestal/entity/ForestalEntities.java b/src/main/java/net/rotgruengelb/forestal/entity/ForestalEntities.java index a0d0a66..c6ce2d5 100644 --- a/src/main/java/net/rotgruengelb/forestal/entity/ForestalEntities.java +++ b/src/main/java/net/rotgruengelb/forestal/entity/ForestalEntities.java @@ -14,14 +14,16 @@ public class ForestalEntities { public static final EntityType GRIZZLY_BEAR = Registry.register(Registries.ENTITY_TYPE, new Identifier(Forestal.MOD_ID, "grizzly_bear"), FabricEntityTypeBuilder.create(SpawnGroup.CREATURE, GrizzlyBearEntity::new) .dimensions(EntityDimensions.fixed(1.5f, 1.5f)).build()); -// public static final EntityType DEER = Registry.register(Registries.ENTITY_TYPE, new Identifier(Forestal.MOD_ID, "deer"), FabricEntityTypeBuilder.create(SpawnGroup.CREATURE, DeerEntity::new) -// .dimensions(EntityDimensions.fixed(1.5f, 1.5f)).build()); + public static final EntityType BLACK_BEAR = Registry.register(Registries.ENTITY_TYPE, new Identifier(Forestal.MOD_ID, "black_bear"), FabricEntityTypeBuilder.create(SpawnGroup.CREATURE, BlackBearEntity::new) + .dimensions(EntityDimensions.fixed(1.2f, 1.2f)).build()); + // public static final EntityType DEER = Registry.register(Registries.ENTITY_TYPE, new Identifier(Forestal.MOD_ID, "deer"), FabricEntityTypeBuilder.create(SpawnGroup.CREATURE, DeerEntity::new) + // .dimensions(EntityDimensions.fixed(1.5f, 1.5f)).build()); public static void registerModEntities() { Forestal.LOGGER.debug("Registering ForestalEntities for " + Forestal.MOD_ID); -// FabricDefaultAttributeRegistry.register(ForestalEntities.DEER, DeerEntity.createDeerAttributes()); - FabricDefaultAttributeRegistry.register(ForestalEntities.GRIZZLY_BEAR, - GrizzlyBearEntity.createBearAttributes()); + // FabricDefaultAttributeRegistry.register(ForestalEntities.DEER, DeerEntity.createDeerAttributes()); + FabricDefaultAttributeRegistry.register(ForestalEntities.GRIZZLY_BEAR, GrizzlyBearEntity.createBearAttributes()); + FabricDefaultAttributeRegistry.register(ForestalEntities.BLACK_BEAR, BlackBearEntity.createBearAttributes()); } } diff --git a/src/main/java/net/rotgruengelb/forestal/entity/GrizzlyBearEntity.java b/src/main/java/net/rotgruengelb/forestal/entity/GrizzlyBearEntity.java index 49bc52d..19e3dee 100644 --- a/src/main/java/net/rotgruengelb/forestal/entity/GrizzlyBearEntity.java +++ b/src/main/java/net/rotgruengelb/forestal/entity/GrizzlyBearEntity.java @@ -2,12 +2,9 @@ import net.minecraft.entity.EntityType; import net.minecraft.entity.passive.AnimalEntity; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ActionResult; -import net.minecraft.util.Hand; +import net.minecraft.loot.LootTables; import net.minecraft.world.World; -import net.rotgruengelb.forestal.item.ForestalItems; +import net.rotgruengelb.forestal.loot.ForestalLootTables; import net.rotgruengelb.forestal.sound.ForestalSoundEvents; import net.rotgruengelb.forestal.util.ForestalTags; import software.bernie.geckolib.animatable.GeoEntity; @@ -22,28 +19,13 @@ public class GrizzlyBearEntity extends BearEntity implements GeoEntity { public GrizzlyBearEntity(EntityType entityType, World world) { super(entityType, world); - setStepHeight(1.0f); SOUND_AMBIENT_BABY = ForestalSoundEvents.ENTITY_GRIZZLY_BEAR_AMBIENT_BABY; SOUND_AMBIENT = ForestalSoundEvents.ENTITY_GRIZZLY_BEAR_AMBIENT; SOUND_STEP = ForestalSoundEvents.ENTITY_GRIZZLY_BEAR_STEP; SOUND_HURT = ForestalSoundEvents.ENTITY_GRIZZLY_BEAR_HURT; + SOUND_DEATH = ForestalSoundEvents.ENTITY_GRIZZLY_BEAR_DEATH; FOOD_TAG = ForestalTags.Items.GRIZZLY_BEAR_FOOD; - } - - @Override - public ActionResult interactMob(PlayerEntity player, Hand hand) { - ItemStack itemStack = player.getStackInHand(hand); - if (!this.isBaby() && itemStack.isIn(ForestalTags.Items.GRIZZLY_BEAR_BRUSH)) { - // TODO: SoundEvent and LootTable - if (!this.getWorld().isClient) { - if (this.random.nextInt(3) == 0) { - this.dropStack(new ItemStack(ForestalItems.GRIZZLY_BEAR_HAIR, this.random.nextInt(3)), 1.4f); - } - itemStack.damage(8, player, (playerEntity) -> playerEntity.sendToolBreakStatus(hand)); - } - return ActionResult.success(this.getWorld().isClient); - } - return super.interactMob(player, hand); + BRUSHING_LOOTTABLE = ForestalLootTables.GRIZZLY_BEAR_BRUSHING_GAMEPLAY; } @Override @@ -62,12 +44,9 @@ private PlayState predicate(AnimationState animationState) { animationState.getController().setAnimation(RawAnimation.begin() .then("animation.grizzly_bear.idle", Animation.LoopType.LOOP)); } - return PlayState.CONTINUE; } - - @Override public AnimatableInstanceCache getAnimatableInstanceCache() { return cache; } } diff --git a/src/main/java/net/rotgruengelb/forestal/item/ForestalItems.java b/src/main/java/net/rotgruengelb/forestal/item/ForestalItems.java index 4135f12..80d73f8 100644 --- a/src/main/java/net/rotgruengelb/forestal/item/ForestalItems.java +++ b/src/main/java/net/rotgruengelb/forestal/item/ForestalItems.java @@ -13,12 +13,14 @@ import net.rotgruengelb.forestal.entity.ForestalEntities; import net.rotgruengelb.forestal.sound.ForestalSoundEvents; -import static net.rotgruengelb.forestal.block.ForestalBlocks.GRIZZLY_PLUSHIE; +import static net.rotgruengelb.forestal.block.ForestalBlocks.*; public class ForestalItems { public static final Item GRIZZLY_BEAR_SPAWN_EGG = registerItem("grizzly_bear_spawn_egg", new SpawnEggItem(ForestalEntities.GRIZZLY_BEAR, 0x966240, 0x553a28, new FabricItemSettings())); + public static final Item BLACK_BEAR_SPAWN_EGG = registerItem("black_bear_spawn_egg", new SpawnEggItem(ForestalEntities.BLACK_BEAR, 0x966240, 0x553a28, new FabricItemSettings())); // public static final Item DEER_SPAWN_EGG = registerItem("deer_spawn_egg", new SpawnEggItem(ForestalEntities.DEER, 0x966240, 0x553a28, new FabricItemSettings())); public static final Item GRIZZLY_BEAR_HAIR = registerItem("grizzly_bear_hair", new Item(new FabricItemSettings())); + public static final Item BLACK_BEAR_HAIR = registerItem("black_bear_hair", new Item(new FabricItemSettings())); public static final Item MUSIC_DISC_REVERB = registerMusicDisc("reverb", 14, ForestalSoundEvents.MUSIC_DISC_REVERB, 79); public static final Item MUSIC_DISC_SUNRAYS = registerMusicDisc("foolishly", 15, ForestalSoundEvents.MUSIC_DISC_FOOLISHLY, 191); @@ -33,8 +35,12 @@ private static Item registerMusicDisc(String name, int comparatorOutput, SoundEv public static void addItemsToItemGroup() { addToItemGroup(ItemGroups.SPAWN_EGGS, GRIZZLY_BEAR_SPAWN_EGG); - addToItemGroup(ItemGroups.FUNCTIONAL, GRIZZLY_PLUSHIE.asItem()); + addToItemGroup(ItemGroups.SPAWN_EGGS, BLACK_BEAR_SPAWN_EGG); + addToItemGroup(ItemGroups.FUNCTIONAL, GRIZZLY_BEAR_PLUSHIE.asItem()); + addToItemGroup(ItemGroups.FUNCTIONAL, BLACK_BEAR_PLUSHIE.asItem()); addToItemGroup(ItemGroups.INGREDIENTS, GRIZZLY_BEAR_HAIR); + addToItemGroup(ItemGroups.INGREDIENTS, BLACK_BEAR_HAIR); + addToItemGroup(ItemGroups.NATURAL, PUFFED_DANDELION.asItem()); addToItemGroup(ItemGroups.TOOLS, MUSIC_DISC_REVERB); addToItemGroup(ItemGroups.TOOLS, MUSIC_DISC_SUNRAYS); } diff --git a/src/main/java/net/rotgruengelb/forestal/loot/ForestalLootTables.java b/src/main/java/net/rotgruengelb/forestal/loot/ForestalLootTables.java new file mode 100644 index 0000000..8aa7385 --- /dev/null +++ b/src/main/java/net/rotgruengelb/forestal/loot/ForestalLootTables.java @@ -0,0 +1,12 @@ +package net.rotgruengelb.forestal.loot; + +import net.minecraft.util.Identifier; + +public class ForestalLootTables { + public static final Identifier GRIZZLY_BEAR_BRUSHING_GAMEPLAY = register("gameplay/grizzly_bear_brushing"); + public static final Identifier BLACK_BEAR_BRUSHING_GAMEPLAY = register("gameplay/black_bear_brushing"); + + private static Identifier register(String id) { + return new Identifier("forestal", id); + } +} diff --git a/src/main/java/net/rotgruengelb/forestal/particle/ForestalParticleTypes.java b/src/main/java/net/rotgruengelb/forestal/particle/ForestalParticleTypes.java index e1df7cc..9153d74 100644 --- a/src/main/java/net/rotgruengelb/forestal/particle/ForestalParticleTypes.java +++ b/src/main/java/net/rotgruengelb/forestal/particle/ForestalParticleTypes.java @@ -10,6 +10,7 @@ public class ForestalParticleTypes { public static DefaultParticleType SLEEPING_ZZZ = register("sleeping_zzz", false); + public static DefaultParticleType DANDELION_PAPPUS = register("dandelion_pappus", false); private static DefaultParticleType register(String name, boolean alwaysSpawn) { return Registry.register(Registries.PARTICLE_TYPE, new Identifier("forestal", name), FabricParticleTypes.simple(alwaysSpawn)); diff --git a/src/main/java/net/rotgruengelb/forestal/sound/ForestalSoundEvents.java b/src/main/java/net/rotgruengelb/forestal/sound/ForestalSoundEvents.java index 4b050a4..a1b1639 100644 --- a/src/main/java/net/rotgruengelb/forestal/sound/ForestalSoundEvents.java +++ b/src/main/java/net/rotgruengelb/forestal/sound/ForestalSoundEvents.java @@ -3,6 +3,7 @@ import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.sound.SoundEvent; +import net.minecraft.sound.SoundEvents; import net.minecraft.util.Identifier; import net.rotgruengelb.forestal.Forestal; @@ -13,6 +14,13 @@ public class ForestalSoundEvents { public static final SoundEvent ENTITY_GRIZZLY_BEAR_AMBIENT_BABY = registerSoundEvent("entity.forestal.grizzly_bear.ambient_baby"); public static final SoundEvent ENTITY_GRIZZLY_BEAR_HURT = registerSoundEvent("entity.forestal.grizzly_bear.hurt"); public static final SoundEvent ENTITY_GRIZZLY_BEAR_DEATH = registerSoundEvent("entity.forestal.grizzly_bear.death"); + public static final SoundEvent ENTITY_BLACK_BEAR_STEP = registerSoundEvent("entity.forestal.black_bear.step"); + public static final SoundEvent ENTITY_BLACK_BEAR_AMBIENT = registerSoundEvent("entity.forestal.black_bear.ambient"); + public static final SoundEvent ENTITY_BLACK_BEAR_AMBIENT_BABY = registerSoundEvent("entity.forestal.black_bear.ambient_baby"); + public static final SoundEvent ENTITY_BLACK_BEAR_HURT = registerSoundEvent("entity.forestal.black_bear.hurt"); + public static final SoundEvent ENTITY_BLACK_BEAR_DEATH = registerSoundEvent("entity.forestal.black_bear.death"); + public static final SoundEvent ENTITY_GENERIC_BEAR_BRUSH = registerSoundEvent("entity.forestal.generic.bear_brush"); + public static final SoundEvent MUSIC_DISC_REVERB = registerSoundEvent("music_disc.forestal.reverb"); public static final SoundEvent MUSIC_DISC_FOOLISHLY = registerSoundEvent("music_disc.forestal.foolishly"); diff --git a/src/main/java/net/rotgruengelb/forestal/util/ForestalTags.java b/src/main/java/net/rotgruengelb/forestal/util/ForestalTags.java index 2fb5c56..597fc3d 100644 --- a/src/main/java/net/rotgruengelb/forestal/util/ForestalTags.java +++ b/src/main/java/net/rotgruengelb/forestal/util/ForestalTags.java @@ -18,12 +18,18 @@ public static class SPAWNS_GRIZZLY_BEAR { public static final TagKey RARE = of("spawns_entity/grizzly_bear/rare"); public static final TagKey ALL = of("spawns_entity/grizzly_bear"); } + public static class SPAWNS_BLACK_BEAR { + public static final TagKey COMMON = of("spawns_entity/black_bear/common"); + public static final TagKey RARE = of("spawns_entity/black_bear/rare"); + public static final TagKey ALL = of("spawns_entity/black_bear"); + } } public static class Items { - public static final TagKey GRIZZLY_BEAR_BRUSH = of("grizzly_bear_brush"); + public static final TagKey BEAR_BRUSH = of("bear_brush"); public static final TagKey GRIZZLY_BEAR_FOOD = of("grizzly_bear_food"); + public static final TagKey BLACK_BEAR_FOOD = of("black_bear_food"); private static TagKey of(String id) { return TagKey.of(RegistryKeys.ITEM, new Identifier(Forestal.MOD_ID, id)); diff --git a/src/main/java/net/rotgruengelb/forestal/world/gen/ForestalEntityGeneration.java b/src/main/java/net/rotgruengelb/forestal/world/gen/ForestalEntityGeneration.java index 4b52417..9b499e6 100644 --- a/src/main/java/net/rotgruengelb/forestal/world/gen/ForestalEntityGeneration.java +++ b/src/main/java/net/rotgruengelb/forestal/world/gen/ForestalEntityGeneration.java @@ -12,6 +12,7 @@ public class ForestalEntityGeneration { public static void addSpawns() { addGrizzlyBearSpawn(); + addBlackBearSpawn(); // addDeerSpawn(); } @@ -22,6 +23,13 @@ public static void addGrizzlyBearSpawn() { SpawnRestriction.register(ForestalEntities.GRIZZLY_BEAR, SpawnRestriction.Location.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, GrizzlyBearEntity::isValidBearSpawn); } + public static void addBlackBearSpawn() { + BiomeModifications.addSpawn(BiomeSelectors.tag(ForestalTags.Biomes.SPAWNS_BLACK_BEAR.COMMON), SpawnGroup.CREATURE, ForestalEntities.BLACK_BEAR, 30, 1, 2); + BiomeModifications.addSpawn(BiomeSelectors.tag(ForestalTags.Biomes.SPAWNS_BLACK_BEAR.RARE), SpawnGroup.CREATURE, ForestalEntities.BLACK_BEAR, 7, 1, 1); + + SpawnRestriction.register(ForestalEntities.BLACK_BEAR, SpawnRestriction.Location.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, GrizzlyBearEntity::isValidBearSpawn); + } + // public static void addDeerSpawn() { // BiomeModifications.addSpawn(BiomeSelectors.tag(ForestalTags.Biomes.SPAWNS_GRIZZLY_BEAR.COMMON), SpawnGroup.CREATURE, ForestalEntities.DEER, 30, 1, 4); // diff --git a/src/main/resources/assets/forestal/animations/black_bear.animation.json b/src/main/resources/assets/forestal/animations/black_bear.animation.json new file mode 100644 index 0000000..3f2c8c8 --- /dev/null +++ b/src/main/resources/assets/forestal/animations/black_bear.animation.json @@ -0,0 +1,135 @@ +{ + "format_version": "1.8.0", + "animations": { + "animation.black_bear.idle": { + "loop": true, + "animation_length": 2, + "bones": { + "head": { + "rotation": { + "vector": ["Math.sin((query.anim_time + 0.1) * 180) * 1.5", 0, 0] + }, + "position": { + "vector": [0, "-1+Math.sin((query.anim_time - 0.0) * 180) * 0.4", 0] + } + }, + "body": { + "position": { + "vector": [0, "-1+Math.sin((query.anim_time - 0.0) * 180) * 0.4", 0] + } + } + } + }, + "animation.black_bear.walk": { + "loop": true, + "animation_length": 1.5, + "bones": { + "head": { + "rotation": { + "vector": ["math.sin(36+query.anim_time*480)*-1", 0, "math.sin(36+query.anim_time*240)*2"] + }, + "position": { + "vector": [0, "math.sin(query.anim_time*480)*0.25", 0] + } + }, + "body": { + "rotation": { + "vector": [0, 0, 0] + }, + "position": { + "vector": [0, "math.sin(query.anim_time*480)*0.25", 0] + } + }, + "leg_1": { + "rotation": { + "vector": ["math.sin(query.anim_time*240)*15", 0, 0] + }, + "position": { + "vector": [0, "math.max(0,math.cos(query.anim_time*240)*-1)", 0] + } + }, + "leg_2": { + "rotation": { + "vector": ["math.sin(query.anim_time*240)*-15", 0, 0] + }, + "position": { + "vector": [0, "math.max(0,math.cos(query.anim_time*240)*1)", 0] + } + }, + "leg_3": { + "rotation": { + "vector": ["math.sin(query.anim_time*240)*-15", 0, 0] + }, + "position": { + "vector": [0, "math.max(0,math.cos(query.anim_time*240)*1)", 0] + } + }, + "leg_4": { + "rotation": { + "vector": ["math.sin(query.anim_time*240)*15", 0, 0] + }, + "position": { + "vector": [0, "math.max(0,math.cos(query.anim_time*240)*-1)", 0] + } + } + } + }, + "animation.black_bear.sleep": { + "loop": true, + "animation_length": 2, + "bones": { + "head": { + "rotation": { + "vector": ["Math.sin((query.anim_time + 0.1) * 180) * 1.5", 0, 0] + }, + "position": { + "vector": [0, "-1+Math.sin((query.anim_time - 0.0) * 180) * 0.4", 0] + } + }, + "body": { + "position": { + "vector": [0, "-1+Math.sin((query.anim_time - 0.0) * 180) * 0.4", 0] + } + }, + "black_bear": { + "position": { + "vector": [0, -3, 0] + } + }, + "leg_1": { + "rotation": { + "vector": [-25, 0, -90] + }, + "position": { + "vector": [3, 1, 0] + } + }, + "leg_2": { + "rotation": { + "vector": [-25, 0, 90] + }, + "position": { + "vector": [-3, 1, 0] + } + }, + "leg_3": { + "rotation": { + "vector": [90, 42.5, 0] + }, + "position": { + "vector": [1, 1, 2] + } + }, + "leg_4": { + "rotation": { + "vector": [90, -42.5, 0] + }, + "position": { + "vector": [-2, 1, 2] + } + } + } + } + }, + "geckolib_format_version": 2 +} \ No newline at end of file diff --git a/src/main/resources/assets/forestal/blockstates/black_bear_plushie.json b/src/main/resources/assets/forestal/blockstates/black_bear_plushie.json new file mode 100644 index 0000000..fa0315e --- /dev/null +++ b/src/main/resources/assets/forestal/blockstates/black_bear_plushie.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=south": { + "model": "forestal:block/black_bear_plushie" + }, + "facing=west": { + "model": "forestal:block/black_bear_plushie", + "y": 90 + }, + "facing=north": { + "model": "forestal:block/black_bear_plushie", + "y": 180 + }, + "facing=east": { + "model": "forestal:block/black_bear_plushie", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/forestal/blockstates/grizzly_bear_plushie.json b/src/main/resources/assets/forestal/blockstates/grizzly_bear_plushie.json new file mode 100644 index 0000000..98db36f --- /dev/null +++ b/src/main/resources/assets/forestal/blockstates/grizzly_bear_plushie.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=south": { + "model": "forestal:block/grizzly_bear_plushie" + }, + "facing=west": { + "model": "forestal:block/grizzly_bear_plushie", + "y": 90 + }, + "facing=north": { + "model": "forestal:block/grizzly_bear_plushie", + "y": 180 + }, + "facing=east": { + "model": "forestal:block/grizzly_bear_plushie", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/forestal/blockstates/grizzly_plushie.json b/src/main/resources/assets/forestal/blockstates/grizzly_plushie.json deleted file mode 100644 index 564d95e..0000000 --- a/src/main/resources/assets/forestal/blockstates/grizzly_plushie.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "variants": { - "facing=south": { - "model": "forestal:block/grizzly_plushie" - }, - "facing=west": { - "model": "forestal:block/grizzly_plushie", - "y": 90 - }, - "facing=north": { - "model": "forestal:block/grizzly_plushie", - "y": 180 - }, - "facing=east": { - "model": "forestal:block/grizzly_plushie", - "y": 270 - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/forestal/blockstates/puffed_dandelion.json b/src/main/resources/assets/forestal/blockstates/puffed_dandelion.json new file mode 100644 index 0000000..4704cdf --- /dev/null +++ b/src/main/resources/assets/forestal/blockstates/puffed_dandelion.json @@ -0,0 +1,9 @@ +{ + "variants": { + "": [ + { + "model": "forestal:block/puffed_dandelion" + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/forestal/geo/black_bear.geo.json b/src/main/resources/assets/forestal/geo/black_bear.geo.json new file mode 100644 index 0000000..8b0517f --- /dev/null +++ b/src/main/resources/assets/forestal/geo/black_bear.geo.json @@ -0,0 +1,72 @@ +{ + "format_version": "1.12.0", + "minecraft:geometry": [ + { + "description": { + "identifier": "geometry.unknown", + "texture_width": 64, + "texture_height": 64, + "visible_bounds_width": 2, + "visible_bounds_height": 2.5, + "visible_bounds_offset": [0, 0.75, 0] + }, + "bones": [ + { + "name": "black_bear", + "pivot": [0, 0, -4] + }, + { + "name": "head", + "parent": "black_bear", + "pivot": [1, 7, -8], + "cubes": [ + {"origin": [-5, 4, -13], "size": [10, 8, 5], "uv": [0, 26]}, + {"origin": [-3, 4, -15], "size": [6, 2, 2], "uv": [0, 49]}, + {"origin": [-6, 11, -12], "size": [3, 3, 2], "uv": [26, 49]}, + {"origin": [3, 11, -12], "size": [3, 3, 2], "uv": [16, 49]} + ] + }, + { + "name": "body", + "parent": "black_bear", + "pivot": [0, 9, -1], + "cubes": [ + {"origin": [-6, 4, -8], "size": [12, 12, 14], "inflate": 0.1, "uv": [0, 0]} + ] + }, + { + "name": "leg_1", + "parent": "black_bear", + "pivot": [3.5, 4.5, -4.5], + "cubes": [ + {"origin": [1, 0, -7], "size": [5, 5, 5], "uv": [40, 39]} + ] + }, + { + "name": "leg_2", + "parent": "black_bear", + "pivot": [-3.5, 4.5, -4.5], + "cubes": [ + {"origin": [-6, 0, -7], "size": [5, 5, 5], "uv": [30, 26]} + ] + }, + { + "name": "leg_3", + "parent": "black_bear", + "pivot": [3.5, 4.5, 3.5], + "cubes": [ + {"origin": [1, 0, 1], "size": [5, 5, 5], "uv": [20, 39]} + ] + }, + { + "name": "leg_4", + "parent": "black_bear", + "pivot": [-3.5, 4.5, 3.5], + "cubes": [ + {"origin": [-6, 0, 1], "size": [5, 5, 5], "uv": [0, 39]} + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/forestal/lang/en_us.json b/src/main/resources/assets/forestal/lang/en_us.json index 5545948..2fd2c3b 100644 --- a/src/main/resources/assets/forestal/lang/en_us.json +++ b/src/main/resources/assets/forestal/lang/en_us.json @@ -1,8 +1,13 @@ { - "block.forestal.grizzly_plushie": "Grizzly Bear Plushie", + "block.forestal.grizzly_bear_plushie": "Grizzly Bear Plushie", + "block.forestal.black_bear_plushie": "Black Bear Plushie", + "block.forestal.puffed_dandelion": "Puffed Dandelion", "entity.forestal.grizzly_bear": "Grizzly Bear", + "entity.forestal.black_bear": "Black Bear", "item.forestal.grizzly_bear_spawn_egg": "Grizzly Bear Spawn Egg", + "item.forestal.black_bear_spawn_egg": "Black Bear Spawn Egg", "item.forestal.grizzly_bear_hair": "Grizzly Bear Hair", + "item.forestal.black_bear_hair": "Black Bear Hair", "item.forestal.music_disc_foolishly": "Music Disc", "item.forestal.music_disc_foolishly.desc": "Shaun1p - foolishly", "item.forestal.music_disc_reverb": "Music Disc", @@ -11,5 +16,11 @@ "subtitles.entity.forestal.grizzly_bear.ambient_baby": "Grizzly Bear hums", "subtitles.entity.forestal.grizzly_bear.death": "Grizzly Bear dies", "subtitles.entity.forestal.grizzly_bear.hurt": "Grizzly Bear hurts", - "subtitles.entity.forestal.grizzly_bear.warning": "Grizzly Bear roars" + "subtitles.entity.forestal.grizzly_bear.warning": "Grizzly Bear roars", + "subtitles.entity.forestal.black_bear.ambient": "Black Bear groans", + "subtitles.entity.forestal.black_bear.ambient_baby": "Black Bear hums", + "subtitles.entity.forestal.black_bear.death": "Black Bear dies", + "subtitles.entity.forestal.black_bear.hurt": "Black Bear hurts", + "subtitles.entity.forestal.black_bear.warning": "Black Bear roars", + "subtitles.entity.forestal.generic.bear_brush": "Bear brushed" } \ No newline at end of file diff --git a/src/main/resources/assets/forestal/models/block/black_bear_plushie.json b/src/main/resources/assets/forestal/models/block/black_bear_plushie.json new file mode 100644 index 0000000..eabfed4 --- /dev/null +++ b/src/main/resources/assets/forestal/models/block/black_bear_plushie.json @@ -0,0 +1,151 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "0": "forestal:block/black_bear_plushie" + }, + "elements": [ + { + "from": [4, 0, 6], + "to": [12, 8, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 9]}, + "faces": { + "north": {"uv": [2.5, 2.5, 6.5, 6.5], "texture": "#0"}, + "east": {"uv": [0, 2.5, 2.5, 6.5], "texture": "#0"}, + "south": {"uv": [9, 2.5, 13, 6.5], "texture": "#0"}, + "west": {"uv": [6.5, 2.5, 9, 6.5], "texture": "#0"}, + "up": {"uv": [6.5, 2.5, 2.5, 0], "texture": "#0"}, + "down": {"uv": [10.5, 0, 6.5, 2.5], "texture": "#0"} + } + }, + { + "from": [5, 3, 4], + "to": [11, 5, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 9]}, + "faces": { + "north": {"uv": [1, 7.5, 4, 8.5], "texture": "#0"}, + "east": {"uv": [0, 7.5, 1, 8.5], "texture": "#0"}, + "south": {"uv": [5, 7.5, 8, 8.5], "texture": "#0"}, + "west": {"uv": [4, 7.5, 5, 8.5], "texture": "#0"}, + "up": {"uv": [4, 7.5, 1, 6.5], "texture": "#0"}, + "down": {"uv": [7, 6.5, 4, 7.5], "texture": "#0"} + } + }, + { + "from": [3, 0, 7], + "to": [4, 4, 9], + "rotation": {"angle": -22.5, "axis": "z", "origin": [4, 4, 8]}, + "faces": { + "north": {"uv": [1, 9.5, 1.5, 11.5], "texture": "#0"}, + "east": {"uv": [0, 9.5, 1, 11.5], "texture": "#0"}, + "south": {"uv": [2.5, 9.5, 3, 11.5], "texture": "#0"}, + "west": {"uv": [1.5, 9.5, 2.5, 11.5], "texture": "#0"}, + "up": {"uv": [1.5, 9.5, 1, 8.5], "texture": "#0"}, + "down": {"uv": [2, 8.5, 1.5, 9.5], "texture": "#0"} + } + }, + { + "from": [12, 0, 7], + "to": [13, 4, 9], + "rotation": {"angle": 22.5, "axis": "z", "origin": [12, 4, 8]}, + "faces": { + "north": {"uv": [8, 8.5, 8.5, 10.5], "texture": "#0"}, + "east": {"uv": [7, 8.5, 8, 10.5], "texture": "#0"}, + "south": {"uv": [9.5, 8.5, 10, 10.5], "texture": "#0"}, + "west": {"uv": [8.5, 8.5, 9.5, 10.5], "texture": "#0"}, + "up": {"uv": [8.5, 8.5, 8, 7.5], "texture": "#0"}, + "down": {"uv": [9, 7.5, 8.5, 8.5], "texture": "#0"} + } + }, + { + "from": [3, 7, 8], + "to": [6, 9, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 9]}, + "faces": { + "north": {"uv": [10.5, 8.5, 12, 9.5], "texture": "#0"}, + "east": {"uv": [10, 8.5, 10.5, 9.5], "texture": "#0"}, + "south": {"uv": [12.5, 8.5, 14, 9.5], "texture": "#0"}, + "west": {"uv": [12, 8.5, 12.5, 9.5], "texture": "#0"}, + "up": {"uv": [12, 8.5, 10.5, 8], "texture": "#0"}, + "down": {"uv": [13.5, 8, 12, 8.5], "texture": "#0"} + } + }, + { + "from": [10, 7, 8], + "to": [13, 9, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 9]}, + "faces": { + "north": {"uv": [3.5, 10.5, 5, 11.5], "texture": "#0"}, + "east": {"uv": [3, 10.5, 3.5, 11.5], "texture": "#0"}, + "south": {"uv": [5.5, 10.5, 7, 11.5], "texture": "#0"}, + "west": {"uv": [5, 10.5, 5.5, 11.5], "texture": "#0"}, + "up": {"uv": [5, 10.5, 3.5, 10], "texture": "#0"}, + "down": {"uv": [6.5, 10, 5, 10.5], "texture": "#0"} + } + }, + { + "from": [10, 0, 5], + "to": [13, 2, 6], + "rotation": {"angle": -22.5, "axis": "y", "origin": [11.5, 1, 5.5]}, + "faces": { + "north": {"uv": [9.5, 7, 11, 8], "texture": "#0"}, + "east": {"uv": [9, 7, 9.5, 8], "texture": "#0"}, + "south": {"uv": [11.5, 7, 13, 8], "texture": "#0"}, + "west": {"uv": [11, 7, 11.5, 8], "texture": "#0"}, + "up": {"uv": [11, 7, 9.5, 6.5], "texture": "#0"}, + "down": {"uv": [12.5, 6.5, 11, 7], "texture": "#0"} + } + }, + { + "from": [3, 0, 5], + "to": [6, 2, 6], + "rotation": {"angle": 22.5, "axis": "y", "origin": [4.5, 1, 5.5]}, + "faces": { + "north": {"uv": [3.5, 9, 5, 10], "texture": "#0"}, + "east": {"uv": [3, 9, 3.5, 10], "texture": "#0"}, + "south": {"uv": [5.5, 9, 7, 10], "texture": "#0"}, + "west": {"uv": [5, 9, 5.5, 10], "texture": "#0"}, + "up": {"uv": [5, 9, 3.5, 8.5], "texture": "#0"}, + "down": {"uv": [6.5, 8.5, 5, 9], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [32.5, 9.5, 15.5], + "translation": [-0.75, 2.5, 1.25], + "scale": [0.7, 0.7, 0.7] + }, + "thirdperson_lefthand": { + "rotation": [32.5, 9.5, -15.5], + "translation": [-0.75, 2.5, 1.25], + "scale": [0.7, 0.7, 0.7] + }, + "ground": { + "translation": [0, 5.5, 0], + "scale": [0.85, 0.85, 0.85] + }, + "gui": { + "rotation": [-170.53, 48.28, -157.4], + "translation": [1, 2.75, 0], + "scale": [1.1, 1.1, 1.1] + }, + "head": { + "translation": [0, 16, 0], + "scale": [1.2, 1.2, 1.2] + }, + "fixed": { + "rotation": [-90, 0, 0], + "translation": [0, 0, -13.5], + "scale": [1.7, 1.7, 1.7] + } + }, + "groups": [ + { + "name": "black_bear_plushie", + "origin": [4.5, 1, 4.5], + "color": 0, + "children": [0, 1, 2, 3, 4, 5, 6, 7] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/forestal/models/block/grizzly_plushie.json b/src/main/resources/assets/forestal/models/block/grizzly_bear_plushie.json similarity index 98% rename from src/main/resources/assets/forestal/models/block/grizzly_plushie.json rename to src/main/resources/assets/forestal/models/block/grizzly_bear_plushie.json index 9895192..f0785d7 100644 --- a/src/main/resources/assets/forestal/models/block/grizzly_plushie.json +++ b/src/main/resources/assets/forestal/models/block/grizzly_bear_plushie.json @@ -2,7 +2,7 @@ "credit": "Made with Blockbench", "texture_size": [32, 32], "textures": { - "0": "forestal:block/grizzly_plushie" + "0": "forestal:block/grizzly_bear_plushie" }, "elements": [ { @@ -142,7 +142,7 @@ }, "groups": [ { - "name": "grizzly_plushie", + "name": "grizzly_bear_plushie", "origin": [8, 8, 8], "color": 0, "children": [0, 1, 2, 3, 4, 5, 6, 7] diff --git a/src/main/resources/assets/forestal/models/block/puffed_dandelion.json b/src/main/resources/assets/forestal/models/block/puffed_dandelion.json new file mode 100644 index 0000000..7af809c --- /dev/null +++ b/src/main/resources/assets/forestal/models/block/puffed_dandelion.json @@ -0,0 +1,7 @@ + +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "forestal:block/puffed_dandelion" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/forestal/models/item/black_bear_hair.json b/src/main/resources/assets/forestal/models/item/black_bear_hair.json new file mode 100644 index 0000000..543ce63 --- /dev/null +++ b/src/main/resources/assets/forestal/models/item/black_bear_hair.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "forestal:item/black_bear_hair" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/forestal/models/item/black_bear_plushie.json b/src/main/resources/assets/forestal/models/item/black_bear_plushie.json new file mode 100644 index 0000000..6944120 --- /dev/null +++ b/src/main/resources/assets/forestal/models/item/black_bear_plushie.json @@ -0,0 +1,3 @@ +{ + "parent": "forestal:block/black_bear_plushie" +} \ No newline at end of file diff --git a/src/main/resources/assets/forestal/models/item/black_bear_spawn_egg.json b/src/main/resources/assets/forestal/models/item/black_bear_spawn_egg.json new file mode 100644 index 0000000..fff64c3 --- /dev/null +++ b/src/main/resources/assets/forestal/models/item/black_bear_spawn_egg.json @@ -0,0 +1,3 @@ +{ + "parent": "minecraft:item/template_spawn_egg" +} \ No newline at end of file diff --git a/src/main/resources/assets/forestal/models/item/grizzly_bear_plushie.json b/src/main/resources/assets/forestal/models/item/grizzly_bear_plushie.json new file mode 100644 index 0000000..7cb0d6c --- /dev/null +++ b/src/main/resources/assets/forestal/models/item/grizzly_bear_plushie.json @@ -0,0 +1,3 @@ +{ + "parent": "forestal:block/grizzly_bear_plushie" +} \ No newline at end of file diff --git a/src/main/resources/assets/forestal/models/item/grizzly_plushie.json b/src/main/resources/assets/forestal/models/item/grizzly_plushie.json deleted file mode 100644 index 57b2d7f..0000000 --- a/src/main/resources/assets/forestal/models/item/grizzly_plushie.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "forestal:block/grizzly_plushie" -} \ No newline at end of file diff --git a/src/main/resources/assets/forestal/models/item/puffed_dandelion.json b/src/main/resources/assets/forestal/models/item/puffed_dandelion.json new file mode 100644 index 0000000..bb16985 --- /dev/null +++ b/src/main/resources/assets/forestal/models/item/puffed_dandelion.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "forestal:block/puffed_dandelion" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/forestal/particles/dandelion_pappus.json b/src/main/resources/assets/forestal/particles/dandelion_pappus.json new file mode 100644 index 0000000..643d59c --- /dev/null +++ b/src/main/resources/assets/forestal/particles/dandelion_pappus.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "forestal:dandelion_pappus" + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/forestal/sounds.json b/src/main/resources/assets/forestal/sounds.json index 7d578dc..2be8fd7 100644 --- a/src/main/resources/assets/forestal/sounds.json +++ b/src/main/resources/assets/forestal/sounds.json @@ -70,5 +70,106 @@ } ], "subtitle": "subtitles.entity.forestal.grizzly_bear.warning" + }, + "entity.forestal.black_bear.ambient": { + "sounds": [ + "minecraft:mob/polarbear/idle1", + "minecraft:mob/polarbear/idle2", + "minecraft:mob/polarbear/idle3", + "minecraft:mob/polarbear/idle4" + ], + "subtitle": "subtitles.entity.forestal.black_bear.ambient" + }, + "entity.forestal.black_bear.ambient_baby": { + "sounds": [ + "minecraft:mob/polarbear_baby/idle1", + "minecraft:mob/polarbear_baby/idle2", + "minecraft:mob/polarbear_baby/idle3", + "minecraft:mob/polarbear_baby/idle4" + ], + "subtitle": "subtitles.entity.forestal.black_bear.ambient_baby" + }, + "entity.forestal.black_bear.death": { + "sounds": [ + "minecraft:mob/polarbear/death1", + "minecraft:mob/polarbear/death2", + "minecraft:mob/polarbear/death3" + ], + "subtitle": "subtitles.entity.forestal.black_bear.death" + }, + "entity.forestal.black_bear.hurt": { + "sounds": [ + "minecraft:mob/polarbear/hurt1", + "minecraft:mob/polarbear/hurt2", + "minecraft:mob/polarbear/hurt3", + "minecraft:mob/polarbear/hurt4" + ], + "subtitle": "subtitles.entity.forestal.black_bear.hurt" + }, + "entity.forestal.black_bear.step": { + "sounds": [ + "minecraft:mob/polarbear/step1", + "minecraft:mob/polarbear/step2", + "minecraft:mob/polarbear/step3", + "minecraft:mob/polarbear/step4" + ], + "subtitle": "subtitles.block.generic.footsteps" + }, + "entity.forestal.black_bear.warning": { + "sounds": [ + "minecraft:mob/polarbear/warning1", + "minecraft:mob/polarbear/warning2", + "minecraft:mob/polarbear/warning3", + { + "name": "minecraft:mob/polarbear/warning3", + "pitch": 0.9 + } + ], + "subtitle": "subtitles.entity.forestal.black_bear.warning" + }, + "entity.forestal.generic.bear_brush": { + "sounds": [ + { + "name": "item/brush/brushing_gravel1", + "pitch": 0.6, + "volume": 0.8 + }, + { + "name": "item/brush/brushing_gravel1", + "pitch": 0.4, + "volume": 0.8 + }, + { + "name": "item/brush/brushing_gravel2", + "pitch": 0.6, + "volume": 0.8 + }, + { + "name": "item/brush/brushing_gravel2", + "pitch": 0.8, + "volume": 0.8 + }, + { + "name": "item/brush/brushing_gravel3", + "pitch": 0.6, + "volume": 0.8 + }, + { + "name": "item/brush/brushing_gravel4", + "pitch": 0.5, + "volume": 0.8 + }, + { + "name": "dig/cloth4", + "pitch": 1, + "volume": 0.9 + }, + { + "name": "dig/cloth3", + "pitch": 0.9, + "volume": 0.9 + } + ], + "subtitle": "subtitles.entity.forestal.generic.bear_brush" } } \ No newline at end of file diff --git a/src/main/resources/assets/forestal/textures/block/black_bear_plushie.png b/src/main/resources/assets/forestal/textures/block/black_bear_plushie.png new file mode 100644 index 0000000..76036f6 Binary files /dev/null and b/src/main/resources/assets/forestal/textures/block/black_bear_plushie.png differ diff --git a/src/main/resources/assets/forestal/textures/block/grizzly_plushie.png b/src/main/resources/assets/forestal/textures/block/grizzly_bear_plushie.png similarity index 100% rename from src/main/resources/assets/forestal/textures/block/grizzly_plushie.png rename to src/main/resources/assets/forestal/textures/block/grizzly_bear_plushie.png diff --git a/src/main/resources/assets/forestal/textures/block/puffed_dandelion.png b/src/main/resources/assets/forestal/textures/block/puffed_dandelion.png new file mode 100644 index 0000000..a968202 Binary files /dev/null and b/src/main/resources/assets/forestal/textures/block/puffed_dandelion.png differ diff --git a/src/main/resources/assets/forestal/textures/entity/black_bear/black_bear_normal.png b/src/main/resources/assets/forestal/textures/entity/black_bear/black_bear_normal.png new file mode 100644 index 0000000..b92ddb0 Binary files /dev/null and b/src/main/resources/assets/forestal/textures/entity/black_bear/black_bear_normal.png differ diff --git a/src/main/resources/assets/forestal/textures/entity/black_bear/black_bear_sleeping.png b/src/main/resources/assets/forestal/textures/entity/black_bear/black_bear_sleeping.png new file mode 100644 index 0000000..96482aa Binary files /dev/null and b/src/main/resources/assets/forestal/textures/entity/black_bear/black_bear_sleeping.png differ diff --git a/src/main/resources/assets/forestal/textures/item/black_bear_hair.png b/src/main/resources/assets/forestal/textures/item/black_bear_hair.png new file mode 100644 index 0000000..8bb589a Binary files /dev/null and b/src/main/resources/assets/forestal/textures/item/black_bear_hair.png differ diff --git a/src/main/resources/assets/forestal/textures/particle/dandelion_pappus.png b/src/main/resources/assets/forestal/textures/particle/dandelion_pappus.png new file mode 100644 index 0000000..b94651c Binary files /dev/null and b/src/main/resources/assets/forestal/textures/particle/dandelion_pappus.png differ diff --git a/src/main/resources/data/forestal/loot_tables/blocks/black_bear_plushie.json b/src/main/resources/data/forestal/loot_tables/blocks/black_bear_plushie.json new file mode 100644 index 0000000..6adc7c4 --- /dev/null +++ b/src/main/resources/data/forestal/loot_tables/blocks/black_bear_plushie.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "forestal:black_bear_plushie" + } + ], + "rolls": 1 + } + ], + "random_sequence": "forestal:blocks/black_bear_plushie" +} \ No newline at end of file diff --git a/src/main/resources/data/forestal/loot_tables/blocks/grizzly_bear_plushie.json b/src/main/resources/data/forestal/loot_tables/blocks/grizzly_bear_plushie.json new file mode 100644 index 0000000..7b10e7c --- /dev/null +++ b/src/main/resources/data/forestal/loot_tables/blocks/grizzly_bear_plushie.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "forestal:grizzly_bear_plushie" + } + ], + "rolls": 1 + } + ], + "random_sequence": "forestal:blocks/grizzly_bear_plushie" +} \ No newline at end of file diff --git a/src/main/resources/data/forestal/loot_tables/blocks/grizzly_plushie.json b/src/main/resources/data/forestal/loot_tables/blocks/puffed_dandelion.json similarity index 71% rename from src/main/resources/data/forestal/loot_tables/blocks/grizzly_plushie.json rename to src/main/resources/data/forestal/loot_tables/blocks/puffed_dandelion.json index ce69709..888d8ea 100644 --- a/src/main/resources/data/forestal/loot_tables/blocks/grizzly_plushie.json +++ b/src/main/resources/data/forestal/loot_tables/blocks/puffed_dandelion.json @@ -11,11 +11,11 @@ "entries": [ { "type": "minecraft:item", - "name": "forestal:grizzly_plushie" + "name": "forestal:puffed_dandelion" } ], "rolls": 1 } ], - "random_sequence": "forestal:blocks/grizzly_plushie" + "random_sequence": "forestal:blocks/puffed_dandelion" } \ No newline at end of file diff --git a/src/main/resources/data/forestal/loot_tables/gameplay/black_bear_brushing.json b/src/main/resources/data/forestal/loot_tables/gameplay/black_bear_brushing.json new file mode 100644 index 0000000..eec7061 --- /dev/null +++ b/src/main/resources/data/forestal/loot_tables/gameplay/black_bear_brushing.json @@ -0,0 +1,95 @@ +{ + "type": "minecraft:gift", + "pools": [ + { + "rolls": 1, + "bonus_rolls": 0, + "entries": [ + { + "type": "minecraft:item", + "name": "forestal:black_bear_hair", + "weight": 36, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 1, + "max": 3 + }, + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.4 + } + ] + } + ] + }, + { + "type": "minecraft:empty", + "weight": 52 + }, + { + "type": "minecraft:item", + "name": "minecraft:stick", + "weight": 2 + }, + { + "type": "minecraft:item", + "name": "minecraft:short_grass", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 1, + "max": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:fern", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 4 + }, + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.7 + } + ] + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:wheat_seeds", + "weight": 5, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 1, + "max": 5 + }, + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.7 + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/forestal/loot_tables/gameplay/grizzly_bear_brushing.json b/src/main/resources/data/forestal/loot_tables/gameplay/grizzly_bear_brushing.json new file mode 100644 index 0000000..d757562 --- /dev/null +++ b/src/main/resources/data/forestal/loot_tables/gameplay/grizzly_bear_brushing.json @@ -0,0 +1,95 @@ +{ + "type": "minecraft:gift", + "pools": [ + { + "rolls": 1, + "bonus_rolls": 0, + "entries": [ + { + "type": "minecraft:item", + "name": "forestal:grizzly_bear_hair", + "weight": 36, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 1, + "max": 3 + }, + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.4 + } + ] + } + ] + }, + { + "type": "minecraft:empty", + "weight": 52 + }, + { + "type": "minecraft:item", + "name": "minecraft:stick", + "weight": 2 + }, + { + "type": "minecraft:item", + "name": "minecraft:short_grass", + "weight": 3, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 1, + "max": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:fern", + "weight": 2, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "type": "minecraft:uniform", + "min": 1, + "max": 4 + }, + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.7 + } + ] + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:wheat_seeds", + "weight": 5, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 1, + "max": 5 + }, + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.7 + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/forestal/recipes/black_bear_plushie.json b/src/main/resources/data/forestal/recipes/black_bear_plushie.json new file mode 100644 index 0000000..c69433b --- /dev/null +++ b/src/main/resources/data/forestal/recipes/black_bear_plushie.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "pattern": [ + "h h", + "hwh", + "hhh" + ], + "key": { + "h": { + "item": "forestal:black_bear_hair" + }, + "w": { + "item": "minecraft:black_wool" + } + }, + "result": { + "item": "forestal:black_bear_plushie" + } +} diff --git a/src/main/resources/data/forestal/recipes/grizzly_plushie.json b/src/main/resources/data/forestal/recipes/grizzly_bear_plushie.json similarity index 85% rename from src/main/resources/data/forestal/recipes/grizzly_plushie.json rename to src/main/resources/data/forestal/recipes/grizzly_bear_plushie.json index 8630277..9a11340 100644 --- a/src/main/resources/data/forestal/recipes/grizzly_plushie.json +++ b/src/main/resources/data/forestal/recipes/grizzly_bear_plushie.json @@ -15,6 +15,6 @@ } }, "result": { - "item": "forestal:grizzly_plushie" + "item": "forestal:grizzly_bear_plushie" } } diff --git a/src/main/resources/data/forestal/tags/items/grizzly_bear_brush.json b/src/main/resources/data/forestal/tags/items/bear_brush.json similarity index 100% rename from src/main/resources/data/forestal/tags/items/grizzly_bear_brush.json rename to src/main/resources/data/forestal/tags/items/bear_brush.json diff --git a/src/main/resources/data/forestal/tags/items/black_bear_food.json b/src/main/resources/data/forestal/tags/items/black_bear_food.json new file mode 100644 index 0000000..2e91368 --- /dev/null +++ b/src/main/resources/data/forestal/tags/items/black_bear_food.json @@ -0,0 +1,29 @@ +{ + "replace": false, + "values": [ + { + "id": "minecraft:sweet_berries", + "required": false + }, + { + "id": "minecraft:glow_berries", + "required": false + }, + { + "id": "minecraft:porkchop", + "required": false + }, + { + "id": "minecraft:cooked_porkchop", + "required": false + }, + { + "id": "minecraft:mutton", + "required": false + }, + { + "id": "minecraft:cooked_mutton", + "required": false + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/forestal/tags/worldgen/biome/spawns_entity/black_bear.json b/src/main/resources/data/forestal/tags/worldgen/biome/spawns_entity/black_bear.json new file mode 100644 index 0000000..3598c0c --- /dev/null +++ b/src/main/resources/data/forestal/tags/worldgen/biome/spawns_entity/black_bear.json @@ -0,0 +1,13 @@ +{ + "replace": false, + "values": [ + { + "id": "#forestal:spawns_entity_black_bear/common", + "required": false + }, + { + "id": "#forestal:spawns_entity_black_bear/rare", + "required": false + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/forestal/tags/worldgen/biome/spawns_entity/black_bear/common.json b/src/main/resources/data/forestal/tags/worldgen/biome/spawns_entity/black_bear/common.json new file mode 100644 index 0000000..c6e88a9 --- /dev/null +++ b/src/main/resources/data/forestal/tags/worldgen/biome/spawns_entity/black_bear/common.json @@ -0,0 +1,9 @@ +{ + "replace": false, + "values": [ + { + "id": "#c:tree_deciduous", + "required": false + } + ] +} diff --git a/src/main/resources/data/forestal/tags/worldgen/biome/spawns_entity/black_bear/rare.json b/src/main/resources/data/forestal/tags/worldgen/biome/spawns_entity/black_bear/rare.json new file mode 100644 index 0000000..03885fe --- /dev/null +++ b/src/main/resources/data/forestal/tags/worldgen/biome/spawns_entity/black_bear/rare.json @@ -0,0 +1,13 @@ +{ + "replace": false, + "values": [ + { + "id": "#c:taiga", + "required": false + }, + { + "id": "#c:mountain_slope", + "required": false + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/small_flowers.json b/src/main/resources/data/minecraft/tags/blocks/small_flowers.json new file mode 100644 index 0000000..eba27b4 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/blocks/small_flowers.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "forestal:puffed_dandelion" + ] +} diff --git a/src/main/resources/data/minecraft/tags/items/music_discs.json b/src/main/resources/data/minecraft/tags/items/music_discs.json index 9f6276d..c2a1812 100644 --- a/src/main/resources/data/minecraft/tags/items/music_discs.json +++ b/src/main/resources/data/minecraft/tags/items/music_discs.json @@ -10,4 +10,4 @@ "required": false } ] -} \ No newline at end of file +} diff --git a/src/main/resources/data/minecraft/tags/items/small_flowers.json b/src/main/resources/data/minecraft/tags/items/small_flowers.json new file mode 100644 index 0000000..eba27b4 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/items/small_flowers.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "forestal:puffed_dandelion" + ] +}