Jungle Spore particles

This commit is contained in:
paulevsGitch 2020-12-29 20:20:09 +03:00
parent 2f4caeb673
commit 3de7d611df
9 changed files with 96 additions and 1 deletions

View file

@ -0,0 +1,64 @@
package ru.betterend.particle;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.particle.AnimatedParticle;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.ParticleFactory;
import net.minecraft.client.particle.SpriteProvider;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.particle.DefaultParticleType;
import ru.betterend.util.MHelper;
@Environment(EnvType.CLIENT)
public class ParticleJungleSpore extends AnimatedParticle {
protected ParticleJungleSpore(ClientWorld world, double x, double y, double z, SpriteProvider sprites, double r, double g, double b) {
super(world, x, y, z, sprites, 0);
setSprite(sprites.getSprite(random));
this.maxAge = MHelper.randRange(150, 300, random);
this.scale = MHelper.randRange(0.05F, 0.1F, random);
this.setTargetColor(15916745);
this.setSpriteForAge(spriteProvider);
this.setColorAlpha(0);
}
@Override
public void tick() {
int ticks = this.age % 30;
if (ticks == 0) {
this.velocityX = random.nextGaussian() * 0.02;
this.velocityY = random.nextFloat() * 0.02 + 0.02;
this.velocityZ = random.nextGaussian() * 0.02;
ticks = 0;
}
if (this.age < 30) {
float delta = ticks / 30F;
this.setColorAlpha(delta);
}
else if (this.age > this.maxAge - 30) {
float delta = ticks / 30F;
this.setColorAlpha(1 - delta);
}
this.velocityY -= 0.001F;
this.velocityX *= 0.99F;
this.velocityZ *= 0.99F;
super.tick();
}
@Environment(EnvType.CLIENT)
public static class FactoryJungleSpore implements ParticleFactory<DefaultParticleType> {
private final SpriteProvider sprites;
public FactoryJungleSpore(SpriteProvider sprites) {
this.sprites = sprites;
}
@Override
public Particle createParticle(DefaultParticleType type, ClientWorld world, double x, double y, double z, double vX, double vY, double vZ) {
return new ParticleJungleSpore(world, x, y, z, sprites, 1, 1, 1);
}
}
}

View file

@ -1,6 +1,7 @@
package ru.betterend.recipe; package ru.betterend.recipe;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.item.Items;
import ru.betterend.recipe.builders.FurnaceRecipe; import ru.betterend.recipe.builders.FurnaceRecipe;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndItems; import ru.betterend.registry.EndItems;
@ -11,5 +12,6 @@ public class FurnaceRecipes {
FurnaceRecipe.make("end_glass", EndBlocks.ENDSTONE_DUST, Blocks.GLASS).build(); FurnaceRecipe.make("end_glass", EndBlocks.ENDSTONE_DUST, Blocks.GLASS).build();
FurnaceRecipe.make("end_berry", EndItems.SHADOW_BERRY_RAW, EndItems.SHADOW_BERRY_COOKED).build(); FurnaceRecipe.make("end_berry", EndItems.SHADOW_BERRY_RAW, EndItems.SHADOW_BERRY_COOKED).build();
FurnaceRecipe.make("end_fish", EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED).build(); FurnaceRecipe.make("end_fish", EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED).build();
FurnaceRecipe.make("slime_ball", EndBlocks.JELLYSHROOM_CAP_PURPLE, Items.SLIME_BALL).build();
} }
} }

View file

@ -12,6 +12,7 @@ import ru.betterend.particle.InfusionParticleType;
import ru.betterend.particle.ParticleBlackSpore; import ru.betterend.particle.ParticleBlackSpore;
import ru.betterend.particle.ParticleGeyser; import ru.betterend.particle.ParticleGeyser;
import ru.betterend.particle.ParticleGlowingSphere; import ru.betterend.particle.ParticleGlowingSphere;
import ru.betterend.particle.ParticleJungleSpore;
import ru.betterend.particle.ParticleSnowflake; import ru.betterend.particle.ParticleSnowflake;
import ru.betterend.particle.ParticleSulphur; import ru.betterend.particle.ParticleSulphur;
import ru.betterend.particle.ParticleTenaneaPetal; import ru.betterend.particle.ParticleTenaneaPetal;
@ -27,6 +28,7 @@ public class EndParticles {
public static final DefaultParticleType AMBER_SPHERE = register("amber_sphere"); public static final DefaultParticleType AMBER_SPHERE = register("amber_sphere");
public static final DefaultParticleType BLACK_SPORE = register("black_spore"); public static final DefaultParticleType BLACK_SPORE = register("black_spore");
public static final DefaultParticleType TENANEA_PETAL = register("tenanea_petal"); public static final DefaultParticleType TENANEA_PETAL = register("tenanea_petal");
public static final DefaultParticleType JUNGLE_SPORE = register("jungle_spore");
public static void register() { public static void register() {
ParticleFactoryRegistry.getInstance().register(GLOWING_SPHERE, ParticleGlowingSphere.FactoryGlowingSphere::new); ParticleFactoryRegistry.getInstance().register(GLOWING_SPHERE, ParticleGlowingSphere.FactoryGlowingSphere::new);
@ -38,6 +40,7 @@ public class EndParticles {
ParticleFactoryRegistry.getInstance().register(AMBER_SPHERE, ParticleGlowingSphere.FactoryGlowingSphere::new); ParticleFactoryRegistry.getInstance().register(AMBER_SPHERE, ParticleGlowingSphere.FactoryGlowingSphere::new);
ParticleFactoryRegistry.getInstance().register(BLACK_SPORE, ParticleBlackSpore.FactoryBlackSpore::new); ParticleFactoryRegistry.getInstance().register(BLACK_SPORE, ParticleBlackSpore.FactoryBlackSpore::new);
ParticleFactoryRegistry.getInstance().register(TENANEA_PETAL, ParticleTenaneaPetal.FactoryTenaneaPetal::new); ParticleFactoryRegistry.getInstance().register(TENANEA_PETAL, ParticleTenaneaPetal.FactoryTenaneaPetal::new);
ParticleFactoryRegistry.getInstance().register(JUNGLE_SPORE, ParticleJungleSpore.FactoryJungleSpore::new);
} }
private static DefaultParticleType register(String name) { private static DefaultParticleType register(String name) {

View file

@ -1,7 +1,9 @@
package ru.betterend.world.biome; package ru.betterend.world.biome;
import net.minecraft.entity.EntityType;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
public class BiomeUmbrellaJungle extends EndBiome { public class BiomeUmbrellaJungle extends EndBiome {
@ -11,6 +13,7 @@ public class BiomeUmbrellaJungle extends EndBiome {
.setWaterAndFogColor(119, 198, 253) .setWaterAndFogColor(119, 198, 253)
.setFoliageColor(27, 183, 194) .setFoliageColor(27, 183, 194)
.setFogDensity(2.3F) .setFogDensity(2.3F)
.setParticles(EndParticles.JUNGLE_SPORE, 0.0001F)
.setMusic(EndSounds.MUSIC_FOREST) .setMusic(EndSounds.MUSIC_FOREST)
.setSurface(EndBlocks.JUNGLE_MOSS) .setSurface(EndBlocks.JUNGLE_MOSS)
.addFeature(EndFeatures.END_LAKE) .addFeature(EndFeatures.END_LAKE)
@ -29,6 +32,7 @@ public class BiomeUmbrellaJungle extends EndBiome {
.addFeature(EndFeatures.CHARNIA_CYAN) .addFeature(EndFeatures.CHARNIA_CYAN)
.addFeature(EndFeatures.CHARNIA_GREEN) .addFeature(EndFeatures.CHARNIA_GREEN)
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) .addFeature(EndFeatures.CHARNIA_LIGHT_BLUE)
.addFeature(EndFeatures.CHARNIA_RED_RARE)); .addFeature(EndFeatures.CHARNIA_RED_RARE)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
} }
} }

View file

@ -0,0 +1,3 @@
{
"material": "canvas:emissive_no_diffuse"
}

View file

@ -0,0 +1,19 @@
{
"textures": [
"betterend:jungle_spore_0",
"betterend:jungle_spore_1",
"betterend:jungle_spore_2",
"betterend:jungle_spore_0",
"betterend:jungle_spore_1",
"betterend:jungle_spore_2",
"betterend:jungle_spore_0",
"betterend:jungle_spore_1",
"betterend:jungle_spore_2",
"betterend:jungle_spore_0",
"betterend:jungle_spore_1",
"betterend:jungle_spore_2",
"betterend:jungle_spore_0",
"betterend:jungle_spore_1",
"betterend:jungle_spore_2"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B