Minecraft 1.19.2 Fabric模组开发 05.动画效果物品

news2024/11/25 11:48:30

我们本次在Fabric中实现一个具有动画效果的物品,本次演示的模型代码均在文末给出

tribody.gif
效果演示 效果演示 效果演示

首先,请确保你的开发包中引入了geckolib依赖,相关教程请参考:Minecraft 1.19.2 Fabric模组开发 03.动画生物实体

1.首先我们要使用geckolib制作一个物品和对应的动画:

在blockbench中新建一个

cr0.jpg

之后我们找到Geckolib Model Settings并点击将模型转换为Block/Item

cr1.jpg

之后导出物品模型文件,动画文件,展示文件:

cr2.jpg

将这些文件分别放入到resources包中的如下位置:

39383_5b0a73f572-cr3.jpg

2.在items包中新建一个我们的物品类ItemTribody:

ItemTribody.java

package net.joy187.joyggd.items;

import net.minecraft.item.Item;
import software.bernie.geckolib3.core.IAnimatable;
import software.bernie.geckolib3.core.PlayState;
import software.bernie.geckolib3.core.builder.AnimationBuilder;
import software.bernie.geckolib3.core.controller.AnimationController;
import software.bernie.geckolib3.core.event.predicate.AnimationEvent;
import software.bernie.geckolib3.core.manager.AnimationData;
import software.bernie.geckolib3.core.manager.AnimationFactory;

public class ItemTribody extends Item implements IAnimatable{

	public AnimationFactory factory = new AnimationFactory(this);
	
	public ItemTribody(Settings settings){
		super(settings);
	}
	//动画状态机
	private <E extends IAnimatable> PlayState predicate(AnimationEvent<E> event){
	    //这里我们默认循环播放名为"animation.tribody.run"的动画
		event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.tribody.run" ,true));
		return PlayState.CONTINUE;
	}
	
	@Override
	public void registerControllers(AnimationData animationData){
	    //注册动画状态机
		animationData.addAnimationController(new AnimationController(this,"controller",
		0, this::predicate));
	}
		
	@Override
	public AnimationFactory getFactory() 
	{
		return this.factory; 
	}
	
}

在ItemInit类中将我们的物品进行注册:

ItemInit.java

    public static final Item DROP =  registerItem("tribody",
    		new ItemTribody(new FabricItemSettings().group(ModMain.ITEMTAB)));

3.在Item包中新建一个model包,model包中新建一个物品模型类ModelTribody,用于指定我们的物品模型:

ModelTribody.java

package net.joy187.joyggd.items.model;

import net.joy187.joyggd.ModMain;
import net.joy187.joyggd.items.ItemTribody;
import net.minecraft.util.Identifier;
import software.bernie.geckolib3.model.AnimatedGeoModel;

public class ModelTribody extends AnimatedGeoModel<ItemTribody> {
    //模型文件在资源包中的路径
    @Override
    public Identifier getModelResource(ItemTribody animatable) {
        return new Identifier(ModMain.MOD_ID, "geo/tribody.geo.json");
    }
    
    //贴图文件在资源包中的路径
    @Override
    public Identifier getTextureResource(ItemTribody entity) {

        return new Identifier(ModMain.MOD_ID, "textures/item/tribody.png");
    }
    
    //动画文件在资源包中的路径
    @Override
    public Identifier getAnimationResource(ItemTribody entity) {
        return new Identifier(ModMain.MOD_ID, "animations/tribody.animation.json");
    }
    
}

4.在Item包中新建一个render包,包中新建类RenderTribody,用于指定我们的物品渲染:

RenderTribody.java

package net.joy187.joyggd.items.render;

import net.joy187.joyggd.items.ItemTribody;
import net.joy187.joyggd.items.model.ModelTribody;
import software.bernie.geckolib3.renderers.geo.GeoItemRenderer;


public class RenderTribody extends GeoItemRenderer<ItemTribody> {
	public RenderTribody() { 
	    //里面传入上一步中的物品模型类
		super(new ModelTribody());
	}
}

5.代码部分完成,由于第一步中我们已经将各种文件放好了,所以只需要在资源包的lang文件夹中添加物品的英文、中文名称:

en_us.json

"item.joyggd.tribody": "Drop",

中文名称

zh_cn.json

"item.joyggd.tribody": "水滴",

6.保存所有代码文件,运行游戏:

当我们把物品拿在手上:

tri2.gif

本次演示物品的动画模型文件(参照第一步放入geo包):

tribody.geo.json

{
	"format_version": "1.12.0",
	"minecraft:geometry": [
		{
			"description": {
				"identifier": "geometry.tribody - Converted",
				"texture_width": 16,
				"texture_height": 16,
				"visible_bounds_width": 2,
				"visible_bounds_height": 2.5,
				"visible_bounds_offset": [0, 0.75, 0]
			},
			"bones": [
				{
					"name": "Drop",
					"pivot": [-1, 4, 2]
				},
				{
					"name": "drop3",
					"parent": "Drop",
					"pivot": [-8, 8, 8],
					"cubes": [
						{
							"origin": [-1, 4.5, -7.5],
							"size": [0.5, 0.5, 1],
							"uv": {
								"north": {"uv": [8, 1], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [7.5, 15.5], "uv_size": [0.5, -14.5]},
								"south": {"uv": [7.5, 15], "uv_size": [0.5, 0.5]},
								"west": {"uv": [7.5, 1], "uv_size": [0.5, 14.5]},
								"up": {"uv": [8, 15.5], "uv_size": [-0.5, -14.5]},
								"down": {"uv": [8, 15.5], "uv_size": [-0.5, -14.5]}
							}
						},
						{
							"origin": [-1, 5, -6.5],
							"size": [0.5, 0.5, 14],
							"uv": {
								"north": {"uv": [8.5, 1.5], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [8, 15.5], "uv_size": [0.5, -14]},
								"south": {"uv": [8, 15], "uv_size": [0.5, 0.5]},
								"west": {"uv": [8, 1.5], "uv_size": [0.5, 14]},
								"up": {"uv": [8.5, 15.5], "uv_size": [-0.5, -14]},
								"down": {"uv": [8.5, 15.5], "uv_size": [-0.5, -14]}
							}
						},
						{
							"origin": [-1, 4, -5.5],
							"size": [0.5, 0.5, 13],
							"uv": {
								"north": {"uv": [7.5, 2.5], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [7, 15.5], "uv_size": [0.5, -13]},
								"south": {"uv": [7, 15], "uv_size": [0.5, 0.5]},
								"west": {"uv": [7, 2.5], "uv_size": [0.5, 13]},
								"up": {"uv": [7.5, 15.5], "uv_size": [-0.5, -13]},
								"down": {"uv": [7.5, 15.5], "uv_size": [-0.5, -13]}
							}
						},
						{
							"origin": [-1, 5.5, -5],
							"size": [0.5, 0.5, 12.5],
							"uv": {
								"north": {"uv": [9, 3], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [8.5, 15.5], "uv_size": [0.5, -12.5]},
								"south": {"uv": [8.5, 15], "uv_size": [0.5, 0.5]},
								"west": {"uv": [8.5, 3], "uv_size": [0.5, 12.5]},
								"up": {"uv": [9, 15.5], "uv_size": [-0.5, -12.5]},
								"down": {"uv": [9, 15.5], "uv_size": [-0.5, -12.5]}
							}
						},
						{
							"origin": [-1, 3.5, -4],
							"size": [0.5, 0.5, 11.5],
							"uv": {
								"north": {"uv": [7, 4], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [6.5, 15.5], "uv_size": [0.5, -11.5]},
								"south": {"uv": [6.5, 15], "uv_size": [0.5, 0.5]},
								"west": {"uv": [6.5, 4], "uv_size": [0.5, 11.5]},
								"up": {"uv": [7, 15.5], "uv_size": [-0.5, -11.5]},
								"down": {"uv": [7, 15.5], "uv_size": [-0.5, -11.5]}
							}
						},
						{
							"origin": [-1, 6, -3.5],
							"size": [0.5, 0.5, 11],
							"uv": {
								"north": {"uv": [9.5, 4.5], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [9, 15.5], "uv_size": [0.5, -11]},
								"south": {"uv": [9, 15], "uv_size": [0.5, 0.5]},
								"west": {"uv": [9, 4.5], "uv_size": [0.5, 11]},
								"up": {"uv": [9.5, 15.5], "uv_size": [-0.5, -11]},
								"down": {"uv": [9.5, 15.5], "uv_size": [-0.5, -11]}
							}
						},
						{
							"origin": [-1, 3, -2.5],
							"size": [0.5, 0.5, 9.5],
							"uv": {
								"north": {"uv": [6.5, 5.5], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [6, 15], "uv_size": [0.5, -9.5]},
								"south": {"uv": [6, 14.5], "uv_size": [0.5, 0.5]},
								"west": {"uv": [6, 5.5], "uv_size": [0.5, 9.5]},
								"up": {"uv": [6.5, 15], "uv_size": [-0.5, -9.5]},
								"down": {"uv": [6.5, 15], "uv_size": [-0.5, -9.5]}
							}
						},
						{
							"origin": [-1, 6.5, -2],
							"size": [0.5, 0.5, 9],
							"uv": {
								"north": {"uv": [10, 6], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [9.5, 15], "uv_size": [0.5, -9]},
								"south": {"uv": [9.5, 14.5], "uv_size": [0.5, 0.5]},
								"west": {"uv": [9.5, 6], "uv_size": [0.5, 9]},
								"up": {"uv": [10, 15], "uv_size": [-0.5, -9]},
								"down": {"uv": [10, 15], "uv_size": [-0.5, -9]}
							}
						},
						{
							"origin": [-1, 2.5, -1],
							"size": [0.5, 0.5, 7.5],
							"uv": {
								"north": {"uv": [6, 7], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [5.5, 14.5], "uv_size": [0.5, -7.5]},
								"south": {"uv": [5.5, 14], "uv_size": [0.5, 0.5]},
								"west": {"uv": [5.5, 7], "uv_size": [0.5, 7.5]},
								"up": {"uv": [6, 14.5], "uv_size": [-0.5, -7.5]},
								"down": {"uv": [6, 14.5], "uv_size": [-0.5, -7.5]}
							}
						},
						{
							"origin": [-1, 7, 0],
							"size": [0.5, 0.5, 6.5],
							"uv": {
								"north": {"uv": [10.5, 8], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [10, 14.5], "uv_size": [0.5, -6.5]},
								"south": {"uv": [10, 14], "uv_size": [0.5, 0.5]},
								"west": {"uv": [10, 8], "uv_size": [0.5, 6.5]},
								"up": {"uv": [10.5, 14.5], "uv_size": [-0.5, -6.5]},
								"down": {"uv": [10.5, 14.5], "uv_size": [-0.5, -6.5]}
							}
						},
						{
							"origin": [-1, 2, 0.5],
							"size": [0.5, 0.5, 5.5],
							"uv": {
								"north": {"uv": [5.5, 8.5], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [5, 14], "uv_size": [0.5, -5.5]},
								"south": {"uv": [5, 13.5], "uv_size": [0.5, 0.5]},
								"west": {"uv": [5, 8.5], "uv_size": [0.5, 5.5]},
								"up": {"uv": [5.5, 14], "uv_size": [-0.5, -5.5]},
								"down": {"uv": [5.5, 14], "uv_size": [-0.5, -5.5]}
							}
						},
						{
							"origin": [-1, 7.5, 1.5],
							"size": [0.5, 0.5, 5],
							"uv": {
								"north": {"uv": [11, 9.5], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [10.5, 14.5], "uv_size": [0.5, -5]},
								"south": {"uv": [10.5, 14], "uv_size": [0.5, 0.5]},
								"west": {"uv": [10.5, 9.5], "uv_size": [0.5, 5]},
								"up": {"uv": [11, 14.5], "uv_size": [-0.5, -5]},
								"down": {"uv": [11, 14.5], "uv_size": [-0.5, -5]}
							}
						},
						{
							"origin": [-1, 1.5, 2],
							"size": [0.5, 0.5, 3.5],
							"uv": {
								"north": {"uv": [5, 10], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [4.5, 13.5], "uv_size": [0.5, -3.5]},
								"south": {"uv": [4.5, 13], "uv_size": [0.5, 0.5]},
								"west": {"uv": [4.5, 10], "uv_size": [0.5, 3.5]},
								"up": {"uv": [5, 13.5], "uv_size": [-0.5, -3.5]},
								"down": {"uv": [5, 13.5], "uv_size": [-0.5, -3.5]}
							}
						},
						{
							"origin": [-1, 8, 3],
							"size": [0.5, 0.5, 2.5],
							"uv": {
								"north": {"uv": [11.5, 11], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [11, 13.5], "uv_size": [0.5, -2.5]},
								"south": {"uv": [11, 13], "uv_size": [0.5, 0.5]},
								"west": {"uv": [11, 11], "uv_size": [0.5, 2.5]},
								"up": {"uv": [11.5, 13.5], "uv_size": [-0.5, -2.5]},
								"down": {"uv": [11.5, 13.5], "uv_size": [-0.5, -2.5]}
							}
						},
						{
							"origin": [-1, 1, 3.5],
							"size": [0.5, 0.5, 0.5],
							"uv": {
								"north": {"uv": [4.5, 11.5], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [4, 12], "uv_size": [0.5, -0.5]},
								"south": {"uv": [4, 11.5], "uv_size": [0.5, 0.5]},
								"west": {"uv": [4, 11.5], "uv_size": [0.5, 0.5]},
								"up": {"uv": [4.5, 12], "uv_size": [-0.5, -0.5]},
								"down": {"uv": [4.5, 12], "uv_size": [-0.5, -0.5]}
							}
						}
					]
				},
				{
					"name": "drop2",
					"parent": "Drop",
					"pivot": [-8, 8, 8],
					"cubes": [
						{
							"origin": [-1.5, 3.5, -4],
							"size": [0.5, 2.5, 11.5],
							"uv": {
								"north": {"uv": [8, 1], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [7.5, 1], "uv_size": [0.5, 14.5]},
								"south": {"uv": [7.5, 15], "uv_size": [0.5, 0.5]},
								"west": {"uv": [7.5, 1], "uv_size": [0.5, 14.5]},
								"up": {"uv": [8, 1], "uv_size": [-0.5, 14.5]},
								"down": {"uv": [8, 15.5], "uv_size": [-0.5, -14.5]}
							}
						},
						{
							"origin": [-1, 4.5, -6.5],
							"size": [0.5, 0.5, 14],
							"uv": {
								"north": {"uv": [8.5, 1.5], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [8, 1.5], "uv_size": [0.5, 14]},
								"south": {"uv": [8, 15], "uv_size": [0.5, 0.5]},
								"west": {"uv": [8, 1.5], "uv_size": [0.5, 14]},
								"up": {"uv": [8.5, 1.5], "uv_size": [-0.5, 14]},
								"down": {"uv": [8.5, 15.5], "uv_size": [-0.5, -14]}
							}
						},
						{
							"origin": [-2, 4, -3.5],
							"size": [0.5, 1.5, 10],
							"uv": {
								"north": {"uv": [7.5, 2.5], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [7, 2.5], "uv_size": [0.5, 13]},
								"south": {"uv": [7, 15], "uv_size": [0.5, 0.5]},
								"west": {"uv": [7, 2.5], "uv_size": [0.5, 13]},
								"up": {"uv": [7.5, 2.5], "uv_size": [-0.5, 13]},
								"down": {"uv": [7.5, 15.5], "uv_size": [-0.5, -13]}
							}
						},
						{
							"origin": [-0.5, 3.5, -3],
							"size": [0.5, 2.5, 10.5],
							"uv": {
								"north": {"uv": [9, 3], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [8.5, 3], "uv_size": [0.5, 12.5]},
								"south": {"uv": [8.5, 15], "uv_size": [0.5, 0.5]},
								"west": {"uv": [8.5, 3], "uv_size": [0.5, 12.5]},
								"up": {"uv": [9, 3], "uv_size": [-0.5, 12.5]},
								"down": {"uv": [9, 15.5], "uv_size": [-0.5, -12.5]}
							}
						},
						{
							"origin": [-2.5, 4.5, -3],
							"size": [0.5, 0.5, 8.5],
							"uv": {
								"north": {"uv": [7, 4], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [6.5, 4], "uv_size": [0.5, 11.5]},
								"south": {"uv": [6.5, 15], "uv_size": [0.5, 0.5]},
								"west": {"uv": [6.5, 4], "uv_size": [0.5, 11.5]},
								"up": {"uv": [7, 4], "uv_size": [-0.5, 11.5]},
								"down": {"uv": [7, 15.5], "uv_size": [-0.5, -11.5]}
							}
						},
						{
							"origin": [0, 4, -1.5],
							"size": [0.5, 1.5, 8],
							"uv": {
								"north": {"uv": [9.5, 4.5], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [9, 4.5], "uv_size": [0.5, 11]},
								"south": {"uv": [9, 15], "uv_size": [0.5, 0.5]},
								"west": {"uv": [9, 4.5], "uv_size": [0.5, 11]},
								"up": {"uv": [9.5, 4.5], "uv_size": [-0.5, 11]},
								"down": {"uv": [9.5, 15.5], "uv_size": [-0.5, -11]}
							}
						},
						{
							"origin": [0.5, 4.5, 0.5],
							"size": [0.5, 0.5, 5],
							"uv": {
								"north": {"uv": [9.5, 4.5], "uv_size": [-0.5, 0.5]},
								"east": {"uv": [9, 4.5], "uv_size": [0.5, 11]},
								"south": {"uv": [9, 15], "uv_size": [0.5, 0.5]},
								"west": {"uv": [9, 4.5], "uv_size": [0.5, 11]},
								"up": {"uv": [9.5, 4.5], "uv_size": [-0.5, 11]},
								"down": {"uv": [9.5, 15.5], "uv_size": [-0.5, -11]}
							}
						}
					]
				}
			]
		}
	]
}

物品动画文件(放入animations包):

tribody.animation.json

{
	"format_version": "1.8.0",
	"animations": {
		"animation.tribody.run": {
			"loop": true,
			"bones": {
				"Drop": {
					"rotation": {
						"vector": [0, "math.sin(query.anim_time*120)*5", "math.sin(query.anim_time*360)*360"]
					},
					"position": {
						"vector": ["math.sin(query.anim_time*360)*10", "math.sin(query.anim_time*720)*2", "math.cos(query.anim_time*360)*10"]
					}
				}
			}
		}
	},
	"geckolib_format_version": 2
}

手上展示模型文件(放入models/item包):

tribody.json

{
  "credit": "Made with Blockbench",
  "parent": "builtin/entity",
  "display": {
    "thirdperson_righthand": {
      "rotation": [
        -161.25,
        0,
        0
      ],
      "translation": [
        -1.75,
        7.25,
        -1.25
      ]
    },
    "thirdperson_lefthand": {
      "rotation": [
        -174.75,
        0,
        0
      ],
      "translation": [
        0.75,
        6.5,
        -3
      ]
    },
    "firstperson_righthand": {
      "rotation": [
        180,
        -11.25,
        180
      ],
      "translation": [
        0,
        -1.5,
        -2.25
      ]
    },
    "firstperson_lefthand": {
      "rotation": [
        180,
        0,
        0
      ],
      "translation": [
        0,
        9,
        0
      ]
    },
    "gui": {
      "rotation": [
        -92.23,
        -47.05,
        82.48
      ],
      "translation": [
        3.75,
        3,
        0
      ]
    },
    "head": {
      "rotation": [
        -180,
        7.5,
        -180
      ],
      "translation": [
        0,
        6.5,
        -2.5
      ]
    },
    "fixed": {
      "rotation": [
        0,
        -90,
        0
      ],
      "translation": [
        1,
        -4.5,
        -1
      ]
    }
  }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/168114.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

nvidia显卡编码并发session限制破解

对于服务器型显卡&#xff08;比如&#xff1a;Tesla T4、NVIDIA A100等&#xff09;&#xff0c;nvidia显卡编码并发session路数没有限制&#xff0c;对于消费型显卡&#xff08;比如&#xff1a;GeForce RTX 3070、GeForce RTX 3080等&#xff09;,nvidia显卡编码并发session…

Odoo 16 企业版手册 - 财务管理之会计仪表板

会计仪表板 财务管理是任何类型业务不可避免的一部分。无论您经营的业务规模或类型如何&#xff0c;如果财务流程没有得到适当的管理和监控&#xff0c;您将在未来面临严重的财务失败。手动管理所有会计操作不是一个好主意&#xff0c;因为它需要大量的时间和精力。在人工会计管…

esp32 Python开发快速入门--环境配置以及点亮LED灯

esp32 Python开发快速入门--环境配置以及点亮LED灯1. 环境配置2. 固件的烧录3 下面开始点灯1. 环境配置 需要配置两个环境&#xff0c; 开发的IDE Thonny 链接如下 https://thonny.org/ 安装串口助手&#xff0c;芯片是通过串口来实现通信的&#xff0c;需要驱动&#xff0c;…

Openresty宏观概述笔记

最近由于项目需要学习了安全代理的相关知识&#xff0c;其实刚开始的时候是非常需要一个入门的介绍&#xff0c;大概说明下这个到底是个什么东西&#xff0c;能干啥&#xff0c;简单的原理是什么&#xff0c;为此我记录下我看完用完的心得&#xff0c;记录成笔记。 一般我们代码…

Nginx基础01:安装和基本使用

背景Nginx是一个高性能的Web服务器&#xff0c;几乎所有的Web服务都需要使用Nginx。关于Nginx的功能特性这里不再赘述&#xff0c;让我们从0开始&#xff0c;了解Nginx的基本用法&#xff0c;学习它在Web服务中都有哪些应用。本文主要介绍Nginx的安装以及基础的控制命令。Nginx…

讨论| 电视行业已是落日夕阳?

如今&#xff0c;随着移动设备、互联网技术的发展&#xff0c;电视似乎逐渐淡出人们的视野。近期&#xff0c;与电视相关的热门讨论似乎都是对于各大视频平台的会员投屏制度&#xff0c;这似乎更加减少了大众对于电视的使用欲望。那么电视领域是否真的趋于淘汰了呢&#xff1f;…

PASCAL VOC 数据集的标注格式

PASCAL VOC 数据集的标注格式 PASCAL VOC 挑战赛 &#xff08; **The PASCAL Visual Object Classes &#xff09;是一个世界级的计算机视觉挑战赛。 PASCAL的全称是Pattern Analysis, Statistical Modelling and Computational Learning&#xff0c;很多优秀的计算机视觉模型…

区块链知识系列 - 系统学习EVM(一)

EVM有一个基于栈的架构&#xff0c;在一个栈中保存了所有内存数值。EVM的数据处理单位被定义为256位的“字”&#xff08;这主要是为了方便处理哈希运算和椭圆曲线运算操作&#xff09; 这里所说的内存数值是指那些EVM字节码运行所需要的输入、输出参数数据和智能合约程序运行中…

拉伯证券|锂离子动力电池有哪些优缺点?锂离子电池的优缺点详解

锂离子动力电池是20世纪开发成功的新型高能电池。这种电池的负极是石墨等资料&#xff0c;正极用磷酸铁锂、钴酸锂、钛酸锂等。70年代进入实用化。因其具有能量高、电池电压高、工作温度规模宽、贮存寿命长等优点&#xff0c;已广泛应用于军事和民用小型电器中。 锂离子动力电池…

jvm垃圾回收笔记

JVM基础知识笔记 1. 垃圾回收相关算法 标记清除-标记整理-复制 这三个看上面的文章 1.1 分代收集算法 将不同生命周期的对象采用不同的收集方式&#xff0c;以便提高回收效率&#xff0c;一般是将Java堆分为新生代和老年代&#xff0c;这样可以根据各个年代的特点使用不同的…

拉伯证券|A股涨势趋缓,个股分化,北向资金继续“买买买”

今天上午&#xff0c;A股商场涨势趋缓&#xff0c;主要指数涨跌互现。 个股方面也现较大分解&#xff0c;接连涨停股和接连大幅跌落股同时呈现。 值得注意的是&#xff0c;作为近期最为坚定买入A股的力量之一&#xff0c;北向资金今天上午继续“买买买”&#xff0c;上午半个交…

Wider Face+YOLOV7人脸检测

1 Wider Face标注格式转成YOLO格式1.1 Wider Face标注介绍The format of txt ground truth. File name Number of bounding box x1, y1, w, h, blur, expression, illumination, invalid, occlusion, pose0--Parade/0_Parade_marchingband_1_849.jpg 1 449 330 122 149 0 0 0 0…

Java开发 - Spring Test知多少?

前言 在前文中&#xff0c;我们也使用了测试代码来进行简单的单元测试&#xff0c;但是我们会发现&#xff0c;里面有大量的重复代码&#xff0c;实际给我们的体验并不是太好&#xff0c;所以这篇&#xff0c;我们来学习Spring Test&#xff0c;Spring Test不仅仅限于在Mybati…

AUTOSAR RTE 总结

1. Interface和在Interface下面包含哪些data element在SWC创立之前就定义好了&#xff0c;存储在一个arxml文件里面&#xff0c; 它相当于一个库文件&#xff0c;在新建AUTOSAR project的第一步就应该被导入进来 2. port在SWC创建的阶段被create&#xff0c;因为Interface没有…

某博数据挖掘:使用Scrapy构建自定义数据采集提取洞察信息

想要深入了解某博上最新的动态和信息吗?那么学习如何使用Scrapy构建一个某博数据采集将是不二之选。Scrapy是一个强大的框架,能够快速地爬取网站上的数据。 新版API构建的某博数据采集拥有最丰富的字段信息,能够更好地深入挖掘某博上的数据。提供了多种采集模式,包括用户、…

邮件定时发送java实现

本文总结如何通过java实现邮件接口的定时发送任务。1、邮箱服务器地址和端口以139邮箱为例&#xff0c;获取服务器地址和端口。139邮箱的路径&#xff1a;设置-常见设置-邮箱协议设置2、客户端配置工具&#xff1a;springboot2.4.3使用maven&#xff0c;使用java11pom.xml引入m…

华为机试题:HJ14 字符串排序(python)

文章目录知识点详解1、input()&#xff1a;获取控制台&#xff08;任意形式&#xff09;的输入。输出均为字符串类型。2、print() &#xff1a;打印输出。3、int() &#xff1a;将一个字符串或数字转换为整型&#xff08;强转&#xff09;。4、range() &#xff1a;输出指定范围…

《Linux Shell脚本攻略》学习笔记-第十二章

12.1 简介 我们可以通过关闭无用的服务、调整内核参数或是添加新的硬件来改善系统性能。 12.2 识别服务 Linux系统可以同时运行数百个任务&#xff0c;其中可能也会有那么一两个你不需要的守护进程。 有三种可以用于启动守护进程和服务的工具&#xff0c;Linux发行版支持其中任…

LeetCode题解 贪心(一):455 分发饼干;376 摆动序列;53 最大子序和

随想录 && LeetCode 贪心算法 贪心之于算法&#xff0c;内核是一个最优解是由多个局部最优解组合而成的 比如&#xff0c;如何在一个月之内最有效的减肥&#xff0c;子问题就是每周如何减肥&#xff0c;再拆分就是每一天如何减肥 如果能找到令每一天都有效减肥的策…

vue实现购物车思想

vue实现购物车思想一、问题&#xff1a;二、解决步骤一、问题&#xff1a; 实现购物车功能&#xff0c;具体如下 在该界面显示所有物品的列表&#xff0c;点击开菜显示购物车 在该界面只显示订单的列表 如何实现购物车数据的同步呢&#xff1f; 二、解决步骤 具体思路如…