github.com/df-mc/dragonfly@v0.9.13/server/world/particle/block.go (about)

     1  package particle
     2  
     3  import (
     4  	"github.com/df-mc/dragonfly/server/block/cube"
     5  	"github.com/df-mc/dragonfly/server/world"
     6  	"github.com/df-mc/dragonfly/server/world/sound"
     7  	"github.com/go-gl/mathgl/mgl64"
     8  	"image/color"
     9  )
    10  
    11  // Flame is a particle shown around torches. It can have any colour specified with the Colour field.
    12  // If the colour is not specified, it will default to the normal flame particle.
    13  type Flame struct {
    14  	particle
    15  	// Colour is the colour of the Flame particle.
    16  	Colour color.RGBA
    17  }
    18  
    19  // Dust is a particle shown for redstone. It can have any colour specified with the Colour field.
    20  // If the colour is not specified, it will default to black.
    21  type Dust struct {
    22  	particle
    23  
    24  	// Colour is the colour of the Dust particle.
    25  	Colour color.RGBA
    26  }
    27  
    28  // BlockBreak is a particle sent when a block is broken. It represents a bunch of particles that are textured
    29  // like the block that the particle holds.
    30  type BlockBreak struct {
    31  	particle
    32  	// Block is the block of which particles should be shown. The particles will change depending on what
    33  	// block is held.
    34  	Block world.Block
    35  }
    36  
    37  // PunchBlock is a particle shown when a player is punching a block. It shows particles of a specific block
    38  // type at a particular face of a block.
    39  type PunchBlock struct {
    40  	particle
    41  	// Block is the block of which particles should be shown. The particles will change depending on what
    42  	// block is punched.
    43  	Block world.Block
    44  	// Face is the face of the block that was punched. It is here that the particles will be shown.
    45  	Face cube.Face
    46  }
    47  
    48  // BlockForceField is a particle that shows up as a block that turns invisible from an opaque black colour.
    49  type BlockForceField struct{ particle }
    50  
    51  // BoneMeal is a particle that shows up on bone meal usage.
    52  type BoneMeal struct{ particle }
    53  
    54  // Note is a particle that shows up on note block interactions.
    55  type Note struct {
    56  	particle
    57  
    58  	// Instrument is the instrument of the note block.
    59  	Instrument sound.Instrument
    60  	// Pitch is the pitch of the note.
    61  	Pitch int
    62  }
    63  
    64  // DragonEggTeleport is a particle that shows up when a dragon egg teleports.
    65  type DragonEggTeleport struct {
    66  	particle
    67  
    68  	// Diff is a Pos with the values being the difference from the original position to the new position.
    69  	Diff cube.Pos
    70  }
    71  
    72  // Evaporate is a particle that shows up when a water block evaporates
    73  type Evaporate struct{ particle }
    74  
    75  // WaterDrip is a particle that shows up when there is water above a block and it looks like a dripping effect.
    76  type WaterDrip struct{ particle }
    77  
    78  // LavaDrip is a particle that shows up when there is lava above a block and it looks like a dripping effect.
    79  type LavaDrip struct{ particle }
    80  
    81  // Lava is a particle that shows up randomly above lava.
    82  type Lava struct{ particle }
    83  
    84  // particle serves as a base for all particles in this package.
    85  type particle struct{}
    86  
    87  // Spawn ...
    88  func (particle) Spawn(*world.World, mgl64.Vec3) {}