• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Martomate / Hexacraft / 4212765122

pending completion
4212765122

push

github

Martin Jakobsson
Moved block specs from json files to code

51 of 51 new or added lines in 9 files covered. (100.0%)

1609 of 4743 relevant lines covered (33.92%)

0.34 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.33
/src/main/scala/com/martomate/hexacraft/world/block/Block.scala
1
package com.martomate.hexacraft.world.block
2

3
import com.martomate.hexacraft.util.CylinderSize
4
import com.martomate.hexacraft.world.coord.integer.BlockRelWorld
5

6
object Block {
7
  private val maxBlocks = 256
8

1✔
9
  private val blocks = new Array[Block](maxBlocks)
1✔
10
  def byId(id: Byte): Block = blocks(id)
11
}
12

13
class Block(val id: Byte, val name: String, val displayName: String) {
1✔
14
  Block.blocks(id) = this
15

1✔
16
  def bounds(metadata: Byte) = new HexBox(0.5f, 0, 0.5f * blockHeight(metadata))
17

×
18
  def canBeRendered: Boolean = true
19

×
20
  def isTransparent(metadata: Byte, side: Int): Boolean = false
21

1✔
22
  def lightEmitted: Byte = 0
23

1✔
24
  def blockHeight(metadata: Byte): Float = 1.0f
25

1✔
26
  protected val behaviour: BlockBehaviour = new BlockBehaviourNothing
1✔
27
  final def doUpdate(coords: BlockRelWorld, world: BlockSetAndGet)(using
28
      CylinderSize,
29
      Blocks
1✔
30
  ): Unit = behaviour.onUpdated(coords, world)
31

1✔
32
  override def equals(o: Any): Boolean = o match {
1✔
33
    case other: Block =>
34
      id == other.id
×
35
    case _ => false
36
  }
37

×
38
  override def toString: String = displayName
39
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc