修改粒子效果
|
@ -8,14 +8,14 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public class BulletHoleParticle extends TextureSheetParticle {
|
public class BulletHoleParticle extends TextureSheetParticle {
|
||||||
public static BulltholeParticleProvider provider(SpriteSet spriteSet) {
|
public static BulletholeParticleProvider provider(SpriteSet spriteSet) {
|
||||||
return new BulltholeParticleProvider(spriteSet);
|
return new BulletholeParticleProvider(spriteSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class BulltholeParticleProvider implements ParticleProvider<SimpleParticleType> {
|
public static class BulletholeParticleProvider implements ParticleProvider<SimpleParticleType> {
|
||||||
private final SpriteSet spriteSet;
|
private final SpriteSet spriteSet;
|
||||||
|
|
||||||
public BulltholeParticleProvider(SpriteSet spriteSet) {
|
public BulletholeParticleProvider(SpriteSet spriteSet) {
|
||||||
this.spriteSet = spriteSet;
|
this.spriteSet = spriteSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,14 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public class FireStarParticle extends TextureSheetParticle {
|
public class FireStarParticle extends TextureSheetParticle {
|
||||||
public static FirestarParticleProvider provider(SpriteSet spriteSet) {
|
public static FireStarParticleProvider provider(SpriteSet spriteSet) {
|
||||||
return new FirestarParticleProvider(spriteSet);
|
return new FireStarParticleProvider(spriteSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class FirestarParticleProvider implements ParticleProvider<SimpleParticleType> {
|
public static class FireStarParticleProvider implements ParticleProvider<SimpleParticleType> {
|
||||||
private final SpriteSet spriteSet;
|
private final SpriteSet spriteSet;
|
||||||
|
|
||||||
public FirestarParticleProvider(SpriteSet spriteSet) {
|
public FireStarParticleProvider(SpriteSet spriteSet) {
|
||||||
this.spriteSet = spriteSet;
|
this.spriteSet = spriteSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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(),
|
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");
|
"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(),
|
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;
|
return 0;
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -263,9 +263,9 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa
|
||||||
if (this.beast) {
|
if (this.beast) {
|
||||||
serverLevel.sendParticles(ParticleTypes.END_ROD, location.x, location.y, location.z, 15, 0.1, 0.1, 0.1, 0.05);
|
serverLevel.sendParticles(ParticleTypes.END_ROD, location.x, location.y, location.z, 15, 0.1, 0.1, 0.1, 0.05);
|
||||||
} else {
|
} 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(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();
|
this.discard();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,8 @@ import net.minecraftforge.registries.RegistryObject;
|
||||||
|
|
||||||
public class TargetModParticleTypes {
|
public class TargetModParticleTypes {
|
||||||
public static final DeferredRegister<ParticleType<?>> REGISTRY = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, TargetMod.MODID);
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@ import net.minecraftforge.fml.common.Mod;
|
||||||
public class TargetModParticles {
|
public class TargetModParticles {
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void registerParticles(RegisterParticleProvidersEvent event) {
|
public static void registerParticles(RegisterParticleProvidersEvent event) {
|
||||||
event.registerSpriteSet(TargetModParticleTypes.FIRESTAR.get(), FireStarParticle::provider);
|
event.registerSpriteSet(TargetModParticleTypes.FIRE_STAR.get(), FireStarParticle::provider);
|
||||||
event.registerSpriteSet(TargetModParticleTypes.BULLTHOLE.get(), BulletHoleParticle::provider);
|
event.registerSpriteSet(TargetModParticleTypes.BULLET_HOLE.get(), BulletHoleParticle::provider);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"textures": [
|
||||||
|
"target:bullet_hole"
|
||||||
|
]
|
||||||
|
}
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"textures": [
|
|
||||||
"target:bullthole"
|
|
||||||
]
|
|
||||||
}
|
|
12
src/main/resources/assets/target/particles/fire_star.json
Normal 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"
|
||||||
|
]
|
||||||
|
}
|
|
@ -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"
|
|
||||||
]
|
|
||||||
}
|
|
Before Width: | Height: | Size: 99 B |
Before Width: | Height: | Size: 266 B After Width: | Height: | Size: 266 B |
Before Width: | Height: | Size: 86 B After Width: | Height: | Size: 86 B |
Before Width: | Height: | Size: 95 B After Width: | Height: | Size: 95 B |
Before Width: | Height: | Size: 101 B After Width: | Height: | Size: 101 B |
Before Width: | Height: | Size: 104 B After Width: | Height: | Size: 104 B |
Before Width: | Height: | Size: 115 B After Width: | Height: | Size: 115 B |
Before Width: | Height: | Size: 112 B After Width: | Height: | Size: 112 B |
Before Width: | Height: | Size: 115 B After Width: | Height: | Size: 115 B |
Before Width: | Height: | Size: 112 B After Width: | Height: | Size: 112 B |