class Rosegold::MCData

Overview

Version-selecting facade over the minecraft-data shard: picks the right Minecraft::Data for the active protocol and converts its collision shapes into rosegold's AABBf geometry.

Defined in:

rosegold/world/mcdata.cr

Constant Summary

DEFAULT = for(Client::LATEST_PROTOCOL)

DEPRECATED Use MCData.default instead for version-aware data

SUPPORTED_VERSIONS = {% if true %}[ {% enabled = Rosegold::ENABLED_PROTOCOLS %}{% for proto in enabled.keys.sort %}{{ enabled[proto] }},{% end %} ]{% end %}

Constructors

Instance Method Summary

Constructor Detail

def self.default : MCData #

[View source]
def self.for(protocol : UInt32) : MCData #

[View source]
def self.new(mc_version : String) #

[View source]

Instance Method Detail

def air_states(*args, **options) #

[View source]
def air_states(*args, **options, &) #

[View source]
def block_state_collision_shapes : Array(Array(AABBf)) #

block state nr -> array of AABBs that combine to make up that block state shape


[View source]
def block_state_names(*args, **options) #

[View source]
def block_state_names(*args, **options, &) #

[View source]
def block_state_outline_offsets : Hash(UInt16, Tuple(Float64, Float64)) #

state nr -> {max horizontal, max vertical} position offset. Outline boxes of these states are stored neutral and shifted by #outline_offset at use.


[View source]
def block_state_outline_shapes : Array(Array(AABBf)) #

block state nr -> boxes of the block's outline (the selection/targeting shape), independent of collision. States share one array per shape ID.


[View source]
def blocks(*args, **options) #

[View source]
def blocks(*args, **options, &) #

[View source]
def data : Minecraft::Data #

[View source]
def enchantments(*args, **options) #

[View source]
def enchantments(*args, **options, &) #

[View source]
def held_outline_shapes : Hash(UInt16, Hash(UInt32, Array(AABBf))) #

[View source]
def items(*args, **options) #

[View source]
def items(*args, **options, &) #

[View source]
def materials(*args, **options) #

[View source]
def materials(*args, **options, &) #

[View source]
def outline_offset(state : UInt16, x : Int32, z : Int32) : Tuple(Float64, Float64, Float64) | Nil #

Vanilla Mth.getSeed(x, 0, z) based position offset for the block at x, z.


[View source]