diff --git a/src/main/java/com/github/alexthe666/iceandfire/IceAndFire.java b/src/main/java/com/github/alexthe666/iceandfire/IceAndFire.java index eac62a62f..44aff2513 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/IceAndFire.java +++ b/src/main/java/com/github/alexthe666/iceandfire/IceAndFire.java @@ -2,6 +2,7 @@ import com.github.alexthe666.iceandfire.block.IafBlockRegistry; import com.github.alexthe666.iceandfire.client.ClientProxy; +import com.github.alexthe666.iceandfire.client.particle.IafParticleType; import com.github.alexthe666.iceandfire.config.ConfigHolder; import com.github.alexthe666.iceandfire.entity.IafEntityRegistry; import com.github.alexthe666.iceandfire.entity.IafVillagerRegistry; @@ -102,6 +103,7 @@ public IceAndFire() { IafContainerRegistry.CONTAINERS.register(modBus); IafRecipeSerializers.SERIALIZERS.register(modBus); IafProcessors.PROCESSORS.register(modBus); + IafParticleType.PARTICLE_TYPES.register(modBus); IafVillagerRegistry.POI_TYPES.register(modBus); IafVillagerRegistry.PROFESSIONS.register(modBus); diff --git a/src/main/java/com/github/alexthe666/iceandfire/client/ClientProxy.java b/src/main/java/com/github/alexthe666/iceandfire/client/ClientProxy.java index 23f41a281..dad492e1f 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/client/ClientProxy.java +++ b/src/main/java/com/github/alexthe666/iceandfire/client/ClientProxy.java @@ -109,9 +109,6 @@ public void spawnParticle(final EnumParticles name, double x, double y, double z case Blood: particle = new ParticleBlood(world, x, y, z); break; - case If_Pixie: - particle = new ParticlePixieDust(world, x, y, z, (float) motX, (float) motY, (float) motZ); - break; case Siren_Appearance: particle = new ParticleSirenAppearance(world, x, y, z, (int) motX); break; diff --git a/src/main/java/com/github/alexthe666/iceandfire/client/particle/IafParticleType.java b/src/main/java/com/github/alexthe666/iceandfire/client/particle/IafParticleType.java new file mode 100644 index 000000000..71763d3f1 --- /dev/null +++ b/src/main/java/com/github/alexthe666/iceandfire/client/particle/IafParticleType.java @@ -0,0 +1,26 @@ +package com.github.alexthe666.iceandfire.client.particle; + +import com.github.alexthe666.iceandfire.IceAndFire; +import net.minecraft.core.particles.ParticleType; +import net.minecraft.core.particles.SimpleParticleType; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.client.event.RegisterParticleProvidersEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.registries.DeferredRegister; +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.registries.RegistryObject; + +@Mod.EventBusSubscriber(modid = IceAndFire.MODID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) +public class IafParticleType { + public static final DeferredRegister> PARTICLE_TYPES = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, IceAndFire.MODID); + + public static final RegistryObject PIXIE_DUST = PARTICLE_TYPES.register("pixie_dust", () -> new SimpleParticleType(false)); + + @OnlyIn(Dist.CLIENT) + @SubscribeEvent + public static void registerFactories(RegisterParticleProvidersEvent event) { + event.register(IafParticleType.PIXIE_DUST.get(), ParticlePixieDust.Factory::new); + } +} diff --git a/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleBlood.java b/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleBlood.java index d3939e13c..7f4d5c6b9 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleBlood.java +++ b/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleBlood.java @@ -81,10 +81,6 @@ public int getLightColor(float partialTick) { return 240; } - public int getFXLayer() { - return 3; - } - @Override public @NotNull ParticleRenderType getRenderType() { return ParticleRenderType.CUSTOM; diff --git a/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleDreadPortal.java b/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleDreadPortal.java index 318982f24..3c4017b22 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleDreadPortal.java +++ b/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleDreadPortal.java @@ -80,15 +80,9 @@ public void render(@NotNull VertexConsumer buffer, Camera renderInfo, float part return ParticleRenderType.CUSTOM; } - @Override public int getLightColor(float partialTick) { return 240; } - public int getFXLayer() { - return 3; - } - - } diff --git a/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleDreadTorch.java b/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleDreadTorch.java index 46759d941..a89f2f8e5 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleDreadTorch.java +++ b/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleDreadTorch.java @@ -85,10 +85,6 @@ public int getLightColor(float partialTick) { return 240; } - public int getFXLayer() { - return 3; - } - @Override public @NotNull ParticleRenderType getRenderType() { return ParticleRenderType.CUSTOM; diff --git a/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleHydraBreath.java b/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleHydraBreath.java index 6c9100a63..87f0c5288 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleHydraBreath.java +++ b/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleHydraBreath.java @@ -95,7 +95,8 @@ public int getLightColor(float partialTick) { return super.getLightColor(partialTick); } - public void onUpdate() { + @Override + public void tick() { this.xo = x; this.yo = y; this.zo = z; diff --git a/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticlePixieDust.java b/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticlePixieDust.java index 3d91cbaaf..7e462e761 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticlePixieDust.java +++ b/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticlePixieDust.java @@ -1,101 +1,47 @@ package com.github.alexthe666.iceandfire.client.particle; -import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.*; -import com.mojang.math.Quaternion; -import com.mojang.math.Vector3f; -import net.minecraft.client.Camera; import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.client.particle.ParticleRenderType; -import net.minecraft.client.particle.TextureSheetParticle; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.Mth; -import net.minecraft.world.phys.Vec3; +import net.minecraft.client.particle.*; +import net.minecraft.core.particles.SimpleParticleType; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import org.jetbrains.annotations.NotNull; public class ParticlePixieDust extends TextureSheetParticle { - private static final ResourceLocation PIXIE_DUST = new ResourceLocation("iceandfire:textures/particles/pixie_dust.png"); - float reddustParticleScale; - public ParticlePixieDust(ClientLevel worldIn, double xCoordIn, double yCoordIn, double zCoordIn, float p_i46349_8_, float p_i46349_9_, float p_i46349_10_) { - this(worldIn, xCoordIn, yCoordIn, zCoordIn, 1F, p_i46349_8_, p_i46349_9_, p_i46349_10_); - } - protected ParticlePixieDust(ClientLevel worldIn, double xCoordIn, double yCoordIn, double zCoordIn, float scale, float red, float green, float blue) { + protected ParticlePixieDust(ClientLevel worldIn, double xCoordIn, double yCoordIn, double zCoordIn, float scale, double red, double green, double blue) { super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); this.xd *= 0.10000000149011612D; this.yd *= 0.10000000149011612D; this.zd *= 0.10000000149011612D; float f = (float) Math.random() * 0.4F + 0.6F; - this.rCol = ((float) (Math.random() * 0.20000000298023224D) + 0.8F) * red * f; - this.gCol = ((float) (Math.random() * 0.20000000298023224D) + 0.8F) * green * f; - this.bCol = ((float) (Math.random() * 0.20000000298023224D) + 0.8F) * blue * f; + this.rCol = (float) (((float) (Math.random() * 0.20000000298023224D) + 0.8F) * red * f); + this.gCol = (float) (((float) (Math.random() * 0.20000000298023224D) + 0.8F) * green * f); + this.bCol = (float) (((float) (Math.random() * 0.20000000298023224D) + 0.8F) * blue * f); this.quadSize *= scale; - this.reddustParticleScale = this.quadSize; + this.lifetime = (int) (8.0D / (Math.random() * 0.8D + 0.2D)); this.lifetime = (int) ((float) this.lifetime * scale); } - @Override - public void render(@NotNull VertexConsumer buffer, Camera renderInfo, float partialTicks) { - Vec3 inerp = renderInfo.getPosition(); - float scaley = ((float) this.age + partialTicks) / (float) this.lifetime * 32.0F; - scaley = Mth.clamp(scaley, 0.0F, 1.0F); - this.quadSize = this.reddustParticleScale * scaley; - - float width = quadSize * 0.09F; - if (age > this.getLifetime()) { - this.remove(); - } - - Vec3 Vector3d = renderInfo.getPosition(); - float f = (float) (Mth.lerp(partialTicks, this.xo, this.x) - Vector3d.x()); - float f1 = (float) (Mth.lerp(partialTicks, this.yo, this.y) - Vector3d.y()); - float f2 = (float) (Mth.lerp(partialTicks, this.zo, this.z) - Vector3d.z()); - Quaternion quaternion; - if (this.roll == 0.0F) { - quaternion = renderInfo.rotation(); - } else { - quaternion = new Quaternion(renderInfo.rotation()); - float f3 = Mth.lerp(partialTicks, this.oRoll, this.roll); - quaternion.mul(Vector3f.ZP.rotation(f3)); - } - - // TODO :: 1.19.2 - This doesn't get utilized (the passed-in quaterion does not change)? -// Vector3f vector3f1 = new Vector3f(-1.0F, -1.0F, 0.0F); -// vector3f1.transform(quaternion); - Vector3f[] avector3f = new Vector3f[]{new Vector3f(-1.0F, -1.0F, 0.0F), new Vector3f(-1.0F, 1.0F, 0.0F), new Vector3f(1.0F, 1.0F, 0.0F), new Vector3f(1.0F, -1.0F, 0.0F)}; - float f4 = this.getQuadSize(partialTicks); - - for (int i = 0; i < 4; ++i) { - Vector3f vector3f = avector3f[i]; - vector3f.transform(quaternion); - vector3f.mul(f4); - vector3f.add(f, f1, f2); + @OnlyIn(Dist.CLIENT) + public record Factory(SpriteSet sprite) implements ParticleProvider { + @Override + public Particle createParticle(SimpleParticleType type, ClientLevel level, double x, double y, double z, double red, double green, double blue) { + ParticlePixieDust particle = new ParticlePixieDust(level, x, y, z, 1F, red, green, blue); + particle.pickSprite(this.sprite); + return particle; } - float f7 = 0; - float f8 = 1; - float f5 = 0; - float f6 = 1; - RenderSystem.setShaderTexture(0, PIXIE_DUST); - int j = this.getLightColor(partialTicks); - Tesselator tessellator = Tesselator.getInstance(); - BufferBuilder vertexbuffer = tessellator.getBuilder(); - vertexbuffer.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.PARTICLE); - vertexbuffer.vertex(avector3f[0].x(), avector3f[0].y(), avector3f[0].z()).uv(f8, f6).color(this.rCol, this.gCol, this.bCol, this.alpha).uv2(j).endVertex(); - vertexbuffer.vertex(avector3f[1].x(), avector3f[1].y(), avector3f[1].z()).uv(f8, f5).color(this.rCol, this.gCol, this.bCol, this.alpha).uv2(j).endVertex(); - vertexbuffer.vertex(avector3f[2].x(), avector3f[2].y(), avector3f[2].z()).uv(f7, f5).color(this.rCol, this.gCol, this.bCol, this.alpha).uv2(j).endVertex(); - vertexbuffer.vertex(avector3f[3].x(), avector3f[3].y(), avector3f[3].z()).uv(f7, f6).color(this.rCol, this.gCol, this.bCol, this.alpha).uv2(j).endVertex(); - Tesselator.getInstance().end(); } - @Override public int getLightColor(float partialTick) { return 240; } - public void onUpdate() { + @Override + public void tick() { this.xo = x; this.yo = y; this.zo = z; @@ -123,6 +69,6 @@ public void onUpdate() { @Override public @NotNull ParticleRenderType getRenderType() { - return ParticleRenderType.CUSTOM; + return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; } } diff --git a/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleSerpentBubble.java b/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleSerpentBubble.java index 36cdf2d5f..2755e8bfc 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleSerpentBubble.java +++ b/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleSerpentBubble.java @@ -72,14 +72,9 @@ public void render(@NotNull VertexConsumer buffer, Camera renderInfo, float part @Override public int getLightColor(float partialTick) { - //If uncomment : BlockPos needs integers -// BlockPos blockpos = new BlockPos(this.x, this.y, this.z); return 240; } - public int getFXLayer() { - return 3; - } @Override public @NotNull ParticleRenderType getRenderType() { diff --git a/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleSirenMusic.java b/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleSirenMusic.java index 04d2340a4..c4cda4cd4 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleSirenMusic.java +++ b/src/main/java/com/github/alexthe666/iceandfire/client/particle/ParticleSirenMusic.java @@ -94,10 +94,6 @@ public int getLightColor(float partialTick) { return super.getLightColor(partialTick); } - public int getFXLayer() { - return 3; - } - @Override public @NotNull ParticleRenderType getRenderType() { return ParticleRenderType.CUSTOM; diff --git a/src/main/java/com/github/alexthe666/iceandfire/entity/EntityPixie.java b/src/main/java/com/github/alexthe666/iceandfire/entity/EntityPixie.java index 771be8243..640b4e952 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/entity/EntityPixie.java +++ b/src/main/java/com/github/alexthe666/iceandfire/entity/EntityPixie.java @@ -2,10 +2,10 @@ import com.github.alexthe666.iceandfire.IceAndFire; import com.github.alexthe666.iceandfire.block.IafBlockRegistry; +import com.github.alexthe666.iceandfire.client.particle.IafParticleType; import com.github.alexthe666.iceandfire.datagen.tags.IafItemTags; import com.github.alexthe666.iceandfire.entity.ai.*; import com.github.alexthe666.iceandfire.entity.tile.TileEntityPixieHouse; -import com.github.alexthe666.iceandfire.enums.EnumParticles; import com.github.alexthe666.iceandfire.message.MessageUpdatePixieHouse; import com.github.alexthe666.iceandfire.misc.IafSoundRegistry; import com.github.alexthe666.iceandfire.util.WorldUtil; @@ -331,7 +331,7 @@ public void aiStep() { this.setDeltaMovement(this.getDeltaMovement().add(0, 0.08, 0)); } if (level.isClientSide) { - IceAndFire.PROXY.spawnParticle(EnumParticles.If_Pixie, this.getX() + (double) (this.random.nextFloat() * this.getBbWidth() * 2F) - (double) this.getBbWidth(), this.getY() + (double) (this.random.nextFloat() * this.getBbHeight()), this.getZ() + (double) (this.random.nextFloat() * this.getBbWidth() * 2F) - (double) this.getBbWidth(), PARTICLE_RGB[this.getColor()][0], PARTICLE_RGB[this.getColor()][1], PARTICLE_RGB[this.getColor()][2]); + level.addParticle(IafParticleType.PIXIE_DUST.get(), this.getX() + (double) (this.random.nextFloat() * this.getBbWidth() * 2F) - (double) this.getBbWidth(), this.getY() + (double) (this.random.nextFloat() * this.getBbHeight()), this.getZ() + (double) (this.random.nextFloat() * this.getBbWidth() * 2F) - (double) this.getBbWidth(), PARTICLE_RGB[this.getColor()][0], PARTICLE_RGB[this.getColor()][1], PARTICLE_RGB[this.getColor()][2]); } if (ticksUntilHouseAI > 0) { ticksUntilHouseAI--; diff --git a/src/main/java/com/github/alexthe666/iceandfire/entity/EntityPixieCharge.java b/src/main/java/com/github/alexthe666/iceandfire/entity/EntityPixieCharge.java index 94fca3e67..437e6c189 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/entity/EntityPixieCharge.java +++ b/src/main/java/com/github/alexthe666/iceandfire/entity/EntityPixieCharge.java @@ -1,7 +1,6 @@ package com.github.alexthe666.iceandfire.entity; -import com.github.alexthe666.iceandfire.IceAndFire; -import com.github.alexthe666.iceandfire.enums.EnumParticles; +import com.github.alexthe666.iceandfire.client.particle.IafParticleType; import com.github.alexthe666.iceandfire.item.IafItemRegistry; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.network.protocol.Packet; @@ -78,7 +77,7 @@ public void tick() { Entity shootingEntity = this.getOwner(); if (this.level.isClientSide) { for (int i = 0; i < 5; ++i) { - IceAndFire.PROXY.spawnParticle(EnumParticles.If_Pixie, this.getX() + this.random.nextDouble() * 0.15F * (this.random.nextBoolean() ? -1 : 1), this.getY() + this.random.nextDouble() * 0.15F * (this.random.nextBoolean() ? -1 : 1), this.getZ() + this.random.nextDouble() * 0.15F * (this.random.nextBoolean() ? -1 : 1), rgb[0], rgb[1], rgb[2]); + level.addParticle(IafParticleType.PIXIE_DUST.get(), this.getX() + this.random.nextDouble() * 0.15F * (this.random.nextBoolean() ? -1 : 1), this.getY() + this.random.nextDouble() * 0.15F * (this.random.nextBoolean() ? -1 : 1), this.getZ() + this.random.nextDouble() * 0.15F * (this.random.nextBoolean() ? -1 : 1), rgb[0], rgb[1], rgb[2]); } } this.clearFire(); @@ -138,7 +137,7 @@ protected void onHit(@NotNull HitResult movingObject) { } if (this.level.isClientSide) { for (int i = 0; i < 20; ++i) { - IceAndFire.PROXY.spawnParticle(EnumParticles.If_Pixie, this.getX() + this.random.nextDouble() * 1F * (this.random.nextBoolean() ? -1 : 1), this.getY() + this.random.nextDouble() * 1F * (this.random.nextBoolean() ? -1 : 1), this.getZ() + this.random.nextDouble() * 1F * (this.random.nextBoolean() ? -1 : 1), rgb[0], rgb[1], rgb[2]); + level.addParticle(IafParticleType.PIXIE_DUST.get(), this.getX() + this.random.nextDouble() * 1F * (this.random.nextBoolean() ? -1 : 1), this.getY() + this.random.nextDouble() * 1F * (this.random.nextBoolean() ? -1 : 1), this.getZ() + this.random.nextDouble() * 1F * (this.random.nextBoolean() ? -1 : 1), rgb[0], rgb[1], rgb[2]); } } if (shootingEntity == null || !(shootingEntity instanceof Player) || !((Player) shootingEntity).isCreative()) { diff --git a/src/main/java/com/github/alexthe666/iceandfire/entity/tile/TileEntityJar.java b/src/main/java/com/github/alexthe666/iceandfire/entity/tile/TileEntityJar.java index e3a9b1c7e..0b0ace466 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/entity/tile/TileEntityJar.java +++ b/src/main/java/com/github/alexthe666/iceandfire/entity/tile/TileEntityJar.java @@ -1,9 +1,9 @@ package com.github.alexthe666.iceandfire.entity.tile; import com.github.alexthe666.iceandfire.IceAndFire; +import com.github.alexthe666.iceandfire.client.particle.IafParticleType; import com.github.alexthe666.iceandfire.entity.EntityPixie; import com.github.alexthe666.iceandfire.entity.IafEntityRegistry; -import com.github.alexthe666.iceandfire.enums.EnumParticles; import com.github.alexthe666.iceandfire.message.MessageUpdatePixieHouse; import com.github.alexthe666.iceandfire.message.MessageUpdatePixieHouseModel; import com.github.alexthe666.iceandfire.message.MessageUpdatePixieJar; @@ -102,7 +102,7 @@ public void load(CompoundTag compound) { public static void tick(Level level, BlockPos pos, BlockState state, TileEntityJar entityJar) { entityJar.ticksExisted++; if (level.isClientSide && entityJar.hasPixie) { - IceAndFire.PROXY.spawnParticle(EnumParticles.If_Pixie, + level.addParticle(IafParticleType.PIXIE_DUST.get(), pos.getX() + 0.5F + (double) (entityJar.rand.nextFloat() * PARTICLE_WIDTH * 2F) - PARTICLE_WIDTH, pos.getY() + (double) (entityJar.rand.nextFloat() * PARTICLE_HEIGHT), pos.getZ() + 0.5F + (double) (entityJar.rand.nextFloat() * PARTICLE_WIDTH * 2F) - PARTICLE_WIDTH, EntityPixie.PARTICLE_RGB[entityJar.pixieType][0], EntityPixie.PARTICLE_RGB[entityJar.pixieType][1], EntityPixie.PARTICLE_RGB[entityJar.pixieType][2]); diff --git a/src/main/java/com/github/alexthe666/iceandfire/entity/tile/TileEntityPixieHouse.java b/src/main/java/com/github/alexthe666/iceandfire/entity/tile/TileEntityPixieHouse.java index 54aa28c2b..dad5c1c7c 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/entity/tile/TileEntityPixieHouse.java +++ b/src/main/java/com/github/alexthe666/iceandfire/entity/tile/TileEntityPixieHouse.java @@ -2,9 +2,9 @@ import com.github.alexthe666.iceandfire.IceAndFire; import com.github.alexthe666.iceandfire.block.IafBlockRegistry; +import com.github.alexthe666.iceandfire.client.particle.IafParticleType; import com.github.alexthe666.iceandfire.entity.EntityPixie; import com.github.alexthe666.iceandfire.entity.IafEntityRegistry; -import com.github.alexthe666.iceandfire.enums.EnumParticles; import com.github.alexthe666.iceandfire.message.MessageUpdatePixieHouse; import com.github.alexthe666.iceandfire.message.MessageUpdatePixieHouseModel; import net.minecraft.core.BlockPos; @@ -54,12 +54,12 @@ public static int getHouseTypeFromBlock(Block block) { public static void tickClient(Level level, BlockPos pos, BlockState state, TileEntityPixieHouse entityPixieHouse) { if (entityPixieHouse.hasPixie) { - IceAndFire.PROXY.spawnParticle(EnumParticles.If_Pixie, - pos.getX() + 0.5F + (double) (entityPixieHouse.rand.nextFloat() * PARTICLE_WIDTH * 2F) - PARTICLE_WIDTH, - pos.getY() + (double) (entityPixieHouse.rand.nextFloat() * PARTICLE_HEIGHT), - pos.getZ() + 0.5F + (double) (entityPixieHouse.rand.nextFloat() * PARTICLE_WIDTH * 2F) - PARTICLE_WIDTH, - EntityPixie.PARTICLE_RGB[entityPixieHouse.pixieType][0], EntityPixie.PARTICLE_RGB[entityPixieHouse.pixieType][1], - EntityPixie.PARTICLE_RGB[entityPixieHouse.pixieType][2]); + level.addParticle(IafParticleType.PIXIE_DUST.get(), + pos.getX() + 0.5F + (double) (entityPixieHouse.rand.nextFloat() * PARTICLE_WIDTH * 2F) - PARTICLE_WIDTH, + pos.getY() + (double) (entityPixieHouse.rand.nextFloat() * PARTICLE_HEIGHT), + pos.getZ() + 0.5F + (double) (entityPixieHouse.rand.nextFloat() * PARTICLE_WIDTH * 2F) - PARTICLE_WIDTH, + EntityPixie.PARTICLE_RGB[entityPixieHouse.pixieType][0], EntityPixie.PARTICLE_RGB[entityPixieHouse.pixieType][1], + EntityPixie.PARTICLE_RGB[entityPixieHouse.pixieType][2]); } } diff --git a/src/main/java/com/github/alexthe666/iceandfire/enums/EnumParticles.java b/src/main/java/com/github/alexthe666/iceandfire/enums/EnumParticles.java index 3fa46ee5a..5f50d0801 100644 --- a/src/main/java/com/github/alexthe666/iceandfire/enums/EnumParticles.java +++ b/src/main/java/com/github/alexthe666/iceandfire/enums/EnumParticles.java @@ -6,7 +6,7 @@ public enum EnumParticles { Dread_Torch, Dread_Portal, Blood, - If_Pixie, + //If_Pixie, Siren_Appearance, Ghost_Appearance, Siren_Music, diff --git a/src/main/resources/assets/iceandfire/particles/pixie_dust.json b/src/main/resources/assets/iceandfire/particles/pixie_dust.json new file mode 100644 index 000000000..471eafe1c --- /dev/null +++ b/src/main/resources/assets/iceandfire/particles/pixie_dust.json @@ -0,0 +1,5 @@ +{ + "textures": [ + "iceandfire:pixie_dust" + ] +} diff --git a/src/main/resources/assets/iceandfire/textures/particle/pixie_dust.png b/src/main/resources/assets/iceandfire/textures/particle/pixie_dust.png new file mode 100644 index 000000000..255d773e3 Binary files /dev/null and b/src/main/resources/assets/iceandfire/textures/particle/pixie_dust.png differ