修改粒子效果

This commit is contained in:
17146 2024-05-19 18:51:44 +08:00
parent 7fe21681dc
commit 9408c315e9
20 changed files with 33 additions and 32 deletions

View file

@ -8,14 +8,14 @@ import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public class BulletHoleParticle extends TextureSheetParticle {
public static BulltholeParticleProvider provider(SpriteSet spriteSet) {
return new BulltholeParticleProvider(spriteSet);
public static BulletholeParticleProvider provider(SpriteSet spriteSet) {
return new BulletholeParticleProvider(spriteSet);
}
public static class BulltholeParticleProvider implements ParticleProvider<SimpleParticleType> {
public static class BulletholeParticleProvider implements ParticleProvider<SimpleParticleType> {
private final SpriteSet spriteSet;
public BulltholeParticleProvider(SpriteSet spriteSet) {
public BulletholeParticleProvider(SpriteSet spriteSet) {
this.spriteSet = spriteSet;
}

View file

@ -8,14 +8,14 @@ import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public class FireStarParticle extends TextureSheetParticle {
public static FirestarParticleProvider provider(SpriteSet spriteSet) {
return new FirestarParticleProvider(spriteSet);
public static FireStarParticleProvider provider(SpriteSet spriteSet) {
return new FireStarParticleProvider(spriteSet);
}
public static class FirestarParticleProvider implements ParticleProvider<SimpleParticleType> {
public static class FireStarParticleProvider implements ParticleProvider<SimpleParticleType> {
private final SpriteSet spriteSet;
public FirestarParticleProvider(SpriteSet spriteSet) {
public FireStarParticleProvider(SpriteSet spriteSet) {
this.spriteSet = spriteSet;
}

View file

@ -43,7 +43,7 @@ public class MediumExpCommand {
server.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, new Vec3(x, (y + 1), z), Vec2.ZERO, server, 4, "", Component.literal(""), server.getServer(), null).withSuppressedOutput(),
"particle minecraft:campfire_cosy_smoke ~ ~ ~ 2 0.001 2 0.01 80 force");
server.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, new Vec3(x, (y + 1), z), Vec2.ZERO, server, 4, "", Component.literal(""), server.getServer(), null).withSuppressedOutput(),
"particle target:firestar ~ ~ ~ 0 0 0 0.2 80 force");
"particle target:fire_star ~ ~ ~ 0 0 0 0.2 80 force");
}
return 0;
}));

View file

@ -263,9 +263,9 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa
if (this.beast) {
serverLevel.sendParticles(ParticleTypes.END_ROD, location.x, location.y, location.z, 15, 0.1, 0.1, 0.1, 0.05);
} else {
serverLevel.sendParticles(TargetModParticleTypes.BULLTHOLE.get(), location.x, location.y, location.z, 1, 0, 0, 0, 0);
serverLevel.sendParticles(TargetModParticleTypes.BULLET_HOLE.get(), location.x, location.y, location.z, 1, 0, 0, 0, 0);
serverLevel.sendParticles(ParticleTypes.SMOKE, location.x, location.y, location.z, 3, 0, 0.1, 0, 0.01);
serverLevel.sendParticles(TargetModParticleTypes.BULLTHOLE.get(), location.x, location.y, location.z, 1, 0, 0, 0, 0);
serverLevel.sendParticles(TargetModParticleTypes.BULLET_HOLE.get(), location.x, location.y, location.z, 1, 0, 0, 0, 0);
this.discard();
}

View file

@ -9,7 +9,8 @@ import net.minecraftforge.registries.RegistryObject;
public class TargetModParticleTypes {
public static final DeferredRegister<ParticleType<?>> REGISTRY = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, TargetMod.MODID);
public static final RegistryObject<SimpleParticleType> FIRESTAR = REGISTRY.register("firestar", () -> new SimpleParticleType(false));
public static final RegistryObject<SimpleParticleType> BULLTHOLE = REGISTRY.register("bullthole", () -> new SimpleParticleType(false));
public static final RegistryObject<SimpleParticleType> FIRE_STAR = REGISTRY.register("fire_star", () -> new SimpleParticleType(false));
public static final RegistryObject<SimpleParticleType> BULLET_HOLE = REGISTRY.register("bullet_hole", () -> new SimpleParticleType(false));
}

View file

@ -11,8 +11,8 @@ import net.minecraftforge.fml.common.Mod;
public class TargetModParticles {
@SubscribeEvent
public static void registerParticles(RegisterParticleProvidersEvent event) {
event.registerSpriteSet(TargetModParticleTypes.FIRESTAR.get(), FireStarParticle::provider);
event.registerSpriteSet(TargetModParticleTypes.BULLTHOLE.get(), BulletHoleParticle::provider);
event.registerSpriteSet(TargetModParticleTypes.FIRE_STAR.get(), FireStarParticle::provider);
event.registerSpriteSet(TargetModParticleTypes.BULLET_HOLE.get(), BulletHoleParticle::provider);
}
}

View file

@ -0,0 +1,5 @@
{
"textures": [
"target:bullet_hole"
]
}

View file

@ -1,5 +0,0 @@
{
"textures": [
"target:bullthole"
]
}

View file

@ -0,0 +1,12 @@
{
"textures": [
"target:fire_star_1",
"target:fire_star_2",
"target:fire_star_3",
"target:fire_star_4",
"target:fire_star_5",
"target:fire_star_6",
"target:fire_star_7",
"target:fire_star_8"
]
}

View file

@ -1,12 +0,0 @@
{
"textures": [
"target:firestar_1",
"target:firestar_2",
"target:firestar_3",
"target:firestar_4",
"target:firestar_5",
"target:firestar_6",
"target:firestar_7",
"target:firestar_8"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 B

View file

Before

Width:  |  Height:  |  Size: 266 B

After

Width:  |  Height:  |  Size: 266 B

View file

Before

Width:  |  Height:  |  Size: 86 B

After

Width:  |  Height:  |  Size: 86 B

View file

Before

Width:  |  Height:  |  Size: 95 B

After

Width:  |  Height:  |  Size: 95 B

View file

Before

Width:  |  Height:  |  Size: 101 B

After

Width:  |  Height:  |  Size: 101 B

View file

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 104 B

View file

Before

Width:  |  Height:  |  Size: 115 B

After

Width:  |  Height:  |  Size: 115 B

View file

Before

Width:  |  Height:  |  Size: 112 B

After

Width:  |  Height:  |  Size: 112 B

View file

Before

Width:  |  Height:  |  Size: 115 B

After

Width:  |  Height:  |  Size: 115 B

View file

Before

Width:  |  Height:  |  Size: 112 B

After

Width:  |  Height:  |  Size: 112 B