Fixes
This commit is contained in:
parent
6ee49ed3e6
commit
49c8d97d9e
11 changed files with 101 additions and 21 deletions
|
@ -31,12 +31,13 @@ import net.minecraft.world.WorldAccess;
|
||||||
import net.minecraft.world.WorldView;
|
import net.minecraft.world.WorldView;
|
||||||
import ru.betterend.blocks.basis.BlockBaseNotFull;
|
import ru.betterend.blocks.basis.BlockBaseNotFull;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
import ru.betterend.registry.EndParticles;
|
||||||
|
|
||||||
public class BlockSulphuricGeyser extends BlockBaseNotFull implements FluidFillable, Waterloggable {
|
public class BlockHydrothermalVent extends BlockBaseNotFull implements FluidFillable, Waterloggable {
|
||||||
public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED;
|
public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED;
|
||||||
private static final VoxelShape SHAPE = Block.createCuboidShape(1, 1, 1, 15, 16, 15);
|
private static final VoxelShape SHAPE = Block.createCuboidShape(1, 1, 1, 15, 16, 15);
|
||||||
|
|
||||||
public BlockSulphuricGeyser() {
|
public BlockHydrothermalVent() {
|
||||||
super(FabricBlockSettings.of(Material.STONE)
|
super(FabricBlockSettings.of(Material.STONE)
|
||||||
.breakByTool(FabricToolTags.PICKAXES)
|
.breakByTool(FabricToolTags.PICKAXES)
|
||||||
.sounds(BlockSoundGroup.STONE)
|
.sounds(BlockSoundGroup.STONE)
|
||||||
|
@ -99,6 +100,11 @@ public class BlockSulphuricGeyser extends BlockBaseNotFull implements FluidFilla
|
||||||
double x = pos.getX() + random.nextDouble();
|
double x = pos.getX() + random.nextDouble();
|
||||||
double y = pos.getY() + 0.9 + random.nextDouble() * 0.3;
|
double y = pos.getY() + 0.9 + random.nextDouble() * 0.3;
|
||||||
double z = pos.getZ() + random.nextDouble();
|
double z = pos.getZ() + random.nextDouble();
|
||||||
world.addParticle(ParticleTypes.CAMPFIRE_SIGNAL_SMOKE, x, y, z, 0, 0, 0);
|
if (state.get(WATERLOGGED)) {
|
||||||
|
world.addParticle(EndParticles.GEYSER_PARTICLE, x, y, z, 0, 0, 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
world.addParticle(ParticleTypes.BUBBLE, x, y, z, 0, 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -48,10 +48,10 @@ public class InfusionParticle extends SpriteBillboardParticle {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public static class DefaultFactory implements ParticleFactory<InfusionParticleType> {
|
public static class InfusionFactory implements ParticleFactory<InfusionParticleType> {
|
||||||
private final SpriteProvider spriteProvider;
|
private final SpriteProvider spriteProvider;
|
||||||
|
|
||||||
public DefaultFactory(SpriteProvider spriteProvider) {
|
public InfusionFactory(SpriteProvider spriteProvider) {
|
||||||
this.spriteProvider = spriteProvider;
|
this.spriteProvider = spriteProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
56
src/main/java/ru/betterend/particle/ParticleGeyser.java
Normal file
56
src/main/java/ru/betterend/particle/ParticleGeyser.java
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
package ru.betterend.particle;
|
||||||
|
|
||||||
|
import net.fabricmc.api.EnvType;
|
||||||
|
import net.fabricmc.api.Environment;
|
||||||
|
import net.minecraft.client.particle.Particle;
|
||||||
|
import net.minecraft.client.particle.ParticleFactory;
|
||||||
|
import net.minecraft.client.particle.ParticleTextureSheet;
|
||||||
|
import net.minecraft.client.particle.SpriteBillboardParticle;
|
||||||
|
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 ParticleGeyser extends SpriteBillboardParticle {
|
||||||
|
protected ParticleGeyser(ClientWorld world, double x, double y, double z, double vx, double vy, double vz, SpriteProvider sprites) {
|
||||||
|
super(world, x, y, z, vx, vy, vz);
|
||||||
|
setSprite(sprites);
|
||||||
|
this.maxAge = MHelper.randRange(600, 1200, random);
|
||||||
|
this.scale = MHelper.randRange(0.5F, 1.0F, random);
|
||||||
|
this.velocityX = vx;
|
||||||
|
this.velocityY = vy;
|
||||||
|
this.velocityY = vz;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void tick() {
|
||||||
|
if (this.age >= this.maxAge + 40) {
|
||||||
|
this.setColorAlpha((this.maxAge - this.age) / 40F);
|
||||||
|
}
|
||||||
|
this.velocityX = 0;
|
||||||
|
this.velocityZ = 0;
|
||||||
|
this.velocityY = 0.125;
|
||||||
|
super.tick();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ParticleTextureSheet getType() {
|
||||||
|
return ParticleTextureSheet.PARTICLE_SHEET_TRANSLUCENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Environment(EnvType.CLIENT)
|
||||||
|
public static class FactoryGeyser implements ParticleFactory<DefaultParticleType> {
|
||||||
|
|
||||||
|
private final SpriteProvider sprites;
|
||||||
|
|
||||||
|
public FactoryGeyser(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 ParticleGeyser(world, x, y, z, 0, 0.125, 0, sprites);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -39,7 +39,7 @@ import ru.betterend.blocks.BlockPythadendronSapling;
|
||||||
import ru.betterend.blocks.BlockShadowBerry;
|
import ru.betterend.blocks.BlockShadowBerry;
|
||||||
import ru.betterend.blocks.BlockShadowGrass;
|
import ru.betterend.blocks.BlockShadowGrass;
|
||||||
import ru.betterend.blocks.BlockSulphurCrystal;
|
import ru.betterend.blocks.BlockSulphurCrystal;
|
||||||
import ru.betterend.blocks.BlockSulphuricGeyser;
|
import ru.betterend.blocks.BlockHydrothermalVent;
|
||||||
import ru.betterend.blocks.BlockTenaneaFlowers;
|
import ru.betterend.blocks.BlockTenaneaFlowers;
|
||||||
import ru.betterend.blocks.BlockTenaneaSapling;
|
import ru.betterend.blocks.BlockTenaneaSapling;
|
||||||
import ru.betterend.blocks.BlockTerrain;
|
import ru.betterend.blocks.BlockTerrain;
|
||||||
|
@ -112,7 +112,7 @@ public class EndBlocks {
|
||||||
public static final Block QUARTZ_PEDESTAL = registerBlock("quartz_pedestal", new PedestalVanilla(Blocks.QUARTZ_BLOCK));
|
public static final Block QUARTZ_PEDESTAL = registerBlock("quartz_pedestal", new PedestalVanilla(Blocks.QUARTZ_BLOCK));
|
||||||
public static final Block PURPUR_PEDESTAL = registerBlock("purpur_pedestal", new PedestalVanilla(Blocks.PURPUR_BLOCK));
|
public static final Block PURPUR_PEDESTAL = registerBlock("purpur_pedestal", new PedestalVanilla(Blocks.PURPUR_BLOCK));
|
||||||
|
|
||||||
public static final Block SULPHURIC_GEYSER = registerBlock("sulphuric_geyser", new BlockSulphuricGeyser());
|
public static final Block HYDROTHERMAL_VENT = registerBlock("hydrothermal_vent", new BlockHydrothermalVent());
|
||||||
|
|
||||||
// Wooden Materials And Trees //
|
// Wooden Materials And Trees //
|
||||||
public static final Block MOSSY_GLOWSHROOM_SAPLING = registerBlock("mossy_glowshroom_sapling", new BlockMossyGlowshroomSapling());
|
public static final Block MOSSY_GLOWSHROOM_SAPLING = registerBlock("mossy_glowshroom_sapling", new BlockMossyGlowshroomSapling());
|
||||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.util.registry.Registry;
|
||||||
import ru.betterend.BetterEnd;
|
import ru.betterend.BetterEnd;
|
||||||
import ru.betterend.particle.InfusionParticle;
|
import ru.betterend.particle.InfusionParticle;
|
||||||
import ru.betterend.particle.InfusionParticleType;
|
import ru.betterend.particle.InfusionParticleType;
|
||||||
|
import ru.betterend.particle.ParticleGeyser;
|
||||||
import ru.betterend.particle.ParticleGlowingSphere;
|
import ru.betterend.particle.ParticleGlowingSphere;
|
||||||
import ru.betterend.particle.ParticleSulphur;
|
import ru.betterend.particle.ParticleSulphur;
|
||||||
import ru.betterend.particle.PaticlePortalSphere;
|
import ru.betterend.particle.PaticlePortalSphere;
|
||||||
|
@ -18,18 +19,24 @@ public class EndParticles {
|
||||||
public static final DefaultParticleType PORTAL_SPHERE = register("portal_sphere");
|
public static final DefaultParticleType PORTAL_SPHERE = register("portal_sphere");
|
||||||
public static final ParticleType<InfusionParticleType> INFUSION = register("infusion", FabricParticleTypes.complex(InfusionParticleType.PARAMETERS_FACTORY));
|
public static final ParticleType<InfusionParticleType> INFUSION = register("infusion", FabricParticleTypes.complex(InfusionParticleType.PARAMETERS_FACTORY));
|
||||||
public static final DefaultParticleType SULPHUR_PARTICLE = register("sulphur_particle");
|
public static final DefaultParticleType SULPHUR_PARTICLE = register("sulphur_particle");
|
||||||
|
public static final DefaultParticleType GEYSER_PARTICLE = registerFar("geyser_particle");
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
ParticleFactoryRegistry.getInstance().register(GLOWING_SPHERE, ParticleGlowingSphere.FactoryGlowingSphere::new);
|
ParticleFactoryRegistry.getInstance().register(GLOWING_SPHERE, ParticleGlowingSphere.FactoryGlowingSphere::new);
|
||||||
ParticleFactoryRegistry.getInstance().register(PORTAL_SPHERE, PaticlePortalSphere.FactoryPortalSphere::new);
|
ParticleFactoryRegistry.getInstance().register(PORTAL_SPHERE, PaticlePortalSphere.FactoryPortalSphere::new);
|
||||||
ParticleFactoryRegistry.getInstance().register(INFUSION, InfusionParticle.DefaultFactory::new);
|
ParticleFactoryRegistry.getInstance().register(INFUSION, InfusionParticle.InfusionFactory::new);
|
||||||
ParticleFactoryRegistry.getInstance().register(SULPHUR_PARTICLE, ParticleSulphur.FactorySulphur::new);
|
ParticleFactoryRegistry.getInstance().register(SULPHUR_PARTICLE, ParticleSulphur.FactorySulphur::new);
|
||||||
|
ParticleFactoryRegistry.getInstance().register(GEYSER_PARTICLE, ParticleGeyser.FactoryGeyser::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static DefaultParticleType register(String name) {
|
private static DefaultParticleType register(String name) {
|
||||||
return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), FabricParticleTypes.simple());
|
return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), FabricParticleTypes.simple());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static DefaultParticleType registerFar(String name) {
|
||||||
|
return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), FabricParticleTypes.simple(true));
|
||||||
|
}
|
||||||
|
|
||||||
private static <T extends ParticleEffect> ParticleType<T> register(String name, ParticleType<T> type) {
|
private static <T extends ParticleEffect> ParticleType<T> register(String name, ParticleType<T> type) {
|
||||||
return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), type);
|
return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": [
|
||||||
|
{ "model": "betterend:block/hydrothermal_vent" },
|
||||||
|
{ "model": "betterend:block/hydrothermal_vent", "y": 90 },
|
||||||
|
{ "model": "betterend:block/hydrothermal_vent", "y": 180 },
|
||||||
|
{ "model": "betterend:block/hydrothermal_vent", "y": 270 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"variants": {
|
|
||||||
"": [
|
|
||||||
{ "model": "betterend:block/sulphuric_geyser" },
|
|
||||||
{ "model": "betterend:block/sulphuric_geyser", "y": 90 },
|
|
||||||
{ "model": "betterend:block/sulphuric_geyser", "y": 180 },
|
|
||||||
{ "model": "betterend:block/sulphuric_geyser", "y": 270 }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"parent": "betterend:block/hydrothermal_vent"
|
||||||
|
}
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
"parent": "betterend:block/sulphuric_geyser"
|
|
||||||
}
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"textures": [
|
||||||
|
"minecraft:big_smoke_0",
|
||||||
|
"minecraft:big_smoke_1",
|
||||||
|
"minecraft:big_smoke_2",
|
||||||
|
"minecraft:big_smoke_3",
|
||||||
|
"minecraft:big_smoke_4",
|
||||||
|
"minecraft:big_smoke_5",
|
||||||
|
"minecraft:big_smoke_6"
|
||||||
|
]
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue