Minecraft 1.19.2 Forge模组开发 04.动画效果物品

news2024/11/15 11:34:28

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

tribody.gif
效 果 演 示 效果演示

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

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

在blockbench中新建一个

cr0.jpg

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

cr1.jpg

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

cr2.jpg

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

cr3.jpg

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

ItemTribody.java

package com.joy187.re8joymod.items;

import com.joy187.re8joymod.Main;
import com.joy187.re8joymod.items.render.RenderTribody;
import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer;
import net.minecraft.world.item.Item;
import net.minecraftforge.client.extensions.common.IClientItemExtensions;
import software.bernie.example.GeckoLibMod;
import software.bernie.example.client.renderer.item.PistolRender;
import software.bernie.geckolib3.core.AnimationState;
import software.bernie.geckolib3.core.IAnimatable;
import software.bernie.geckolib3.core.PlayState;
import software.bernie.geckolib3.core.builder.AnimationBuilder;
import software.bernie.geckolib3.core.builder.ILoopType;
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;
import software.bernie.geckolib3.network.GeckoLibNetwork;
import software.bernie.geckolib3.network.ISyncable;
import software.bernie.geckolib3.util.GeckoLibUtil;

import java.util.function.Consumer;


public class ItemTribody extends Item implements IAnimatable {
    public AnimationFactory factory = new AnimationFactory(this);

    public ItemTribody() {
        super(new Item.Properties().tab(Main.TUTORIAL_TAB).stacksTo(1));
    }

    @Override
    public void initializeClient(Consumer<IClientItemExtensions> consumer) {
        super.initializeClient(consumer);
        consumer.accept(new IClientItemExtensions() {
            //物品渲染类
            private final BlockEntityWithoutLevelRenderer renderer = new RenderTribody();

            @Override
            public BlockEntityWithoutLevelRenderer getCustomRenderer() {
                return renderer;
            }
        });
    }
    
    //动画控制器
    @Override
    public void registerControllers(AnimationData data) {
        data.addAnimationController(new AnimationController(this, "controller",
                0, this::predicate));
    }

    //动画播放设定
    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 AnimationFactory getFactory() {
        return this.factory;
    }
}

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

ItemInit.java

    public static RegistryObject<Item> DROP = register("tribody",()->
    {
        return new ItemTribody();
    });

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

ModelTribody.java

package com.joy187.re8joymod.items.model;

import com.joy187.re8joymod.Main;
import com.joy187.re8joymod.items.ItemTribody;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib3.model.AnimatedGeoModel;

public class ModelTribody extends AnimatedGeoModel<ItemTribody>{
    
    //模型文件在资源包中的路径
    @Override
    public ResourceLocation getModelResource(ItemTribody object) {
        return new ResourceLocation(Main.MOD_ID, "geo/tribody.geo.json");
    }
    
    //贴图文件在资源包中的路径
    @Override
    public ResourceLocation getTextureResource(ItemTribody object) {
        return new ResourceLocation(Main.MOD_ID, "textures/item/drop2.png");
    }

    //动画文件在资源包中的路径
    @Override
    public ResourceLocation getAnimationResource(ItemTribody animatable) {
        return new ResourceLocation(Main.MOD_ID, "animations/tribody.animation.json");
    }
}

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

RenderTribody.java

package com.joy187.re8joymod.items.render;

import com.joy187.re8joymod.items.ItemTribody;
import com.joy187.re8joymod.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.re8joymod.tribody": "Drop",

中文名称

zh_cn.json

"item.re8joymod.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/57927.html

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

相关文章

(三)操作系统的运行环境

文章目录一、操作系统的运行机制1. 时钟管理2. 中断机制3. 原语4. 系统数据结构5. 系统调用二、操作系统体系结构1. 传统的操作系统结构&#xff08;大内核&#xff09;第一代&#xff1a;无结构OS第二代&#xff1a;模块化结构OS&#xff1a;模块-接口法OS第三代&#xff1a;分…

[附源码]计算机毕业设计springboot学习帮扶网站设计与实现

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

坦克大战②

1. 我方坦克发射单颗子弹 当发射一颗子弹后&#xff0c;就相当于启动一个线程来控制它的位置坐标&#xff1b;Hero[我方坦克]有子弹的对象&#xff0c;当按下J时&#xff0c;就创建一个发射子弹的线程&#xff0c;通过坐标变化让子弹不停的移动&#xff0c;形成一个射击的效果&…

redis 集群搭建的三种方式

文章目录一、Redis主从二、Redis哨兵三、Redis集群一、Redis主从 二、Redis哨兵 三、Redis集群 下载redis wget http://download.redis.io/releases/redis-5.0.3.tar.gz解压redis tar zxvf redis-5.0.3.tar.gz进行重命名 mv redis-5.0.3 redis安装gcc yum install gcc进入red…

如何学习一门技术

如何学习一门技术 同样的生活&#xff0c;在你经历了一些意外和不如意之后&#xff0c;你再回过头来看&#xff0c;之前你所抱怨的生活其实是一个蛮不错的生活。 罗翔&#xff1a;每一个人都应该拥有学习的能力和权力&#xff0c;真正的知识要能走出书斋&#xff0c;去影响每…

StarkNet 性能路线图

目录 前言 区块限制&#xff1a;Validity Rollups vs L1 为什么 L1 吞吐量有限&#xff1f; 为什么相同的障碍不影响validity rollups&#xff1f; Sequencer 并行化 Cairo-VM 的新 Rust 实现 Rust 对 sequencer重新实现 Provers呢&#xff1f; Summary 参考 前言 St…

详解设计模式:迭代器模式

迭代器模式&#xff08;Iterator Pattern&#xff09;也被称为游标模式&#xff08;Cursor Pattern&#xff09;&#xff0c;是在 GoF 23 种设计模式中定义了的行为型模式。是一种最简单也最常见的设计模式。 迭代器模式 可以让用户透过特定的接口巡访容器中的每一个元素而不用…

HTML5期末大作业:美食网页主题网站设计与实现——HTML+CSS+JavaScript月饼美食食品企业网站html模板9页面

&#x1f468;‍&#x1f393;静态网站的编写主要是用HTML DIVCSS JS等来完成页面的排版设计&#x1f469;‍&#x1f393;,常用的网页设计软件有Dreamweaver、EditPlus、HBuilderX、VScode 、Webstorm、Animate等等&#xff0c;用的最多的还是DW&#xff0c;当然不同软件写出的…

[附源码]计算机毕业设计校园运动会管理系统Springboot程序

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

Linux基本工具——vim

Linux编辑器vim什么是vimvim的三种常用模式vim的基本操作命令模式插入模式底行模式搭配vim环境sudo怎么才能让普通用户使用什么是vim vim是linux下一款功能强大&#xff0c;多模式的编辑器。 现阶段有13种模式。 这就是进入vim的方式。 vim的三种常用模式 命令模式 我们第一…

CentOS7 编译安装最新的Linux Kernel 6.0 rc3

哪个男孩不想手动编译一份自己的内核呢&#xff1f;安装编译环境 CentOS7安装必要的包 yum groupinstall "Development Tools" -y && yum install openssl-devel -y && yum install rpm-build redhat-rpm-config asciidoc hmaccalc perl-ExtUtils-…

Java核心技术卷Ⅰ-第四章对象和类

重点 1.使用预定义类 2.方法参数 3.对象构造 4.包 5.类设计技巧 1.使用预定义类 一个源文件只能有一个公共类&#xff0c;可以有任意数目的非公共类可以使用通配符调用Java编译器&#xff1a;javac Test*.java使用var声明局部变量就不用担心0、0L和0.0之间的区别&#xff0c;因…

找出链表中间结点的三种解法

初阶链表刷题注意&#xff01;&#xff01;&#xff01;学习的是解题的思维&#xff01; 找出链表的中间结点&#xff08;链接在末尾&#xff09; 解题思路 数组解法 由于链表不能通过下标访问对应的结点&#xff0c;所以我们将所有的结点存储在数组中&#xff0c;这样就可以通…

测试开发怎么学?

随着互联网行业的高速发展,快速高质量的产品版本迭代成为企业始终立于不败之地的迫切需求,而在短期迭代的快节奏中.传统测试工作面对更大压力,无法持续提供高效率高质量的人力支撑&#xff0c;所以越来越多的企业需要技术更为全面的测试开发工程师。 测试开发本质上属于测试,区…

【数据结构】二叉树链式结构的实现

&#x1f451;作者主页&#xff1a;进击的安度因 &#x1f3e0;学习社区&#xff1a;进击的安度因&#xff08;个人社区&#xff09; &#x1f4d6;专栏链接&#xff1a;数据结构 文章目录一、二叉树的链式存储二、二叉树链式结构的实现结构设计手动构建二叉树前序遍历中序遍历…

游戏思考26:游戏服务器压力测试文档(最近在忙这个,这个会更新频繁,12/03未完待续)

文章目录一、压力测试关注点二、计算最耗时的加载操作1&#xff09;从数据库读取数据&#xff0c;对加载的类型进一步划分各种类型&#xff0c;计算最耗时操作2&#xff09;查看CPU随着在线人数的变化所占百分比3&#xff09;查看内存变化4&#xff09;备注一、压力测试关注点 …

【C语言字符串】一道题检验你的字符串学习情况

作者&#xff1a;匿名者Unit 目录 一.字符串引言1.字符串基础二.洛谷P5734详解1.字符串相关库函数&#xff08;1&#xff09; strcpy函数 &#xff08;2&#xff09; strcat函数 &#xff08;3&#xff09;strstr函数 2.题目讲解一.字符串引言 1.字符串基础 字符串通常以\0作为…

008. 子集

1.题目链接&#xff1a; 78. 子集 2.解题思路&#xff1a; 2.1.题目要求&#xff1a; 给一个元素各不相同的数组 nums&#xff0c;返回各种可能的子集&#xff08;子集不能重复&#xff09; 比如&#xff1a; 输入&#xff1a;nums [1,2,3] 输出&#xff1a;[[],[1],[2],[…

做了8年前端,感谢那些优秀的后端,陪伴我工作,教会我成长

☆ 前段时间由于一时的头脑发热&#xff0c;写了一篇《做了8年前端&#xff0c;细说那些曾经让你浴霸不能的后端》的博客&#xff0c;虽然每个细节也都属实吧&#xff0c;但始终是一些负能量的东西&#xff0c;建议大家不要去看了&#xff0c;今年互联网情况已经这样了&#xf…

安卓APP源码和设计报告——体育馆预约系统

项目名称&#xff1a;体育馆体育场预约系统专业&#xff1a;班级&#xff1a;学号&#xff1a;姓名&#xff1a; 目 录 一、项目功能介绍3 二、项目运行环境3 1、开发环境3 2、运行环境3 3、是否需要联网3 三、项目配置文件及工程结构4 1、工程配置文件4 2、工程结构目…