Class BlockMicroMaterial

java.lang.Object
codechicken.microblock.api.MicroMaterial
codechicken.microblock.api.BlockMicroMaterial

public class BlockMicroMaterial extends MicroMaterial
Created by covers1624 on 26/6/22.
  • Field Details

    • state

      public final net.minecraft.world.level.block.state.BlockState state
  • Constructor Details

    • BlockMicroMaterial

      public BlockMicroMaterial(net.minecraft.world.level.block.Block block)
    • BlockMicroMaterial

      public BlockMicroMaterial(net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • isTransparent

      public boolean isTransparent()
      Specified by:
      isTransparent in class MicroMaterial
      Returns:
      If this material is not opaque. (Glass, Ice, etc.)
    • getLightEmission

      public int getLightEmission()
      Description copied from class: MicroMaterial
      Gets the light level emitted by this micro material.
      Specified by:
      getLightEmission in class MicroMaterial
      Returns:
      The light emission.
    • getStrength

      public float getStrength(net.minecraft.world.entity.player.Player player)
      Description copied from class: MicroMaterial
      Gets the Strength of this material when being broken by the given player.
      Specified by:
      getStrength in class MicroMaterial
      Parameters:
      player - The player.
      Returns:
      The strength value.
    • getLocalizedName

      public net.minecraft.network.chat.Component getLocalizedName()
      Description copied from class: MicroMaterial
      Gets the localized name for this material.
      Specified by:
      getLocalizedName in class MicroMaterial
      Returns:
      The localized name.
    • getItem

      public net.minecraft.world.item.ItemStack getItem()
      Description copied from class: MicroMaterial
      Gets ItemStack this material can be cut from.
      Specified by:
      getItem in class MicroMaterial
      Returns:
      The ItemStack.
    • getSound

      public net.minecraft.world.level.block.SoundType getSound()
      Description copied from class: MicroMaterial
      Get the breaking/waking sound.
      Specified by:
      getSound in class MicroMaterial
      Returns:
      The SoundType.
    • getExplosionResistance

      public float getExplosionResistance(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.Explosion explosion)
      Description copied from class: MicroMaterial
      Get the resistance of this material for the given explosion.
      Specified by:
      getExplosionResistance in class MicroMaterial
      Parameters:
      level - The level.
      pos - The position.
      explosion - The explosion.
      Returns:
      The resistance.
    • initializeClient

      public void initializeClient(Consumer<MicroMaterialClient> cons)
      Description copied from class: MicroMaterial
      Initialize any client-side properties for this MicroMaterial.
      Overrides:
      initializeClient in class MicroMaterial
      Parameters:
      cons - Consumer to set this material's MicroMaterialClient.
    • makeMaterialKey

      public static net.minecraft.resources.ResourceLocation makeMaterialKey(net.minecraft.world.level.block.state.BlockState state)
      Builds a BlockMicroMaterial registry name for the given BlockState.

      Due to the restrictions imposed by ResourceLocation, the following format is used:
      mod_id:block_name//property1.value1/property2.value2/property3.value3

      Parameters:
      state - The BlockState to create a name for.
      Returns:
      The name.