github.com/df-mc/dragonfly@v0.9.13/server/block/action.go (about) 1 package block 2 3 import "time" 4 5 // OpenAction is a world.BlockAction to open a block at a position. It is sent for blocks such as chests. 6 type OpenAction struct{ action } 7 8 // CloseAction is a world.BlockAction to close a block at a position, complementary to the OpenAction action. 9 type CloseAction struct{ action } 10 11 // StartCrackAction is a world.BlockAction to make the cracks in a block start forming, following the break time set in 12 // the action. 13 type StartCrackAction struct { 14 action 15 BreakTime time.Duration 16 } 17 18 // ContinueCrackAction is a world.BlockAction sent every so often to continue the cracking process of the block. It is 19 // only ever sent after a StartCrackAction action, and may have an altered break time if the player is not on the 20 // ground, submerged or is using a different item than at first. 21 type ContinueCrackAction struct { 22 action 23 BreakTime time.Duration 24 } 25 26 // StopCrackAction is a world.BlockAction to make the cracks forming in a block stop and disappear. 27 type StopCrackAction struct{ action } 28 29 // action implements the Action interface. Structures in this package may embed it to gets its functionality 30 // out of the box. 31 type action struct{} 32 33 // BlockAction serves to implement the world.BlockAction interface. 34 func (action) BlockAction() {}