Class MicroMaterial

java.lang.Object
codechicken.microblock.api.MicroMaterial
Direct Known Subclasses:
BlockMicroMaterial

public abstract class MicroMaterial extends Object
Created by covers1624 on 26/6/22.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<MicroMaterial>
     
    static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<MicroMaterial>>
    The registry name used by MicroMaterial.
    static final net.minecraft.core.Registry<MicroMaterial>
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,MicroMaterial>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract float
    getExplosionResistance(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.Explosion explosion)
    Get the resistance of this material for the given explosion.
    abstract net.minecraft.world.item.ItemStack
    Gets ItemStack this material can be cut from.
    abstract int
    Gets the light level emitted by this micro material.
    abstract net.minecraft.network.chat.Component
    Gets the localized name for this material.
    net.minecraft.resources.ResourceLocation
     
    abstract @Nullable net.minecraft.world.level.block.SoundType
    Get the breaking/waking sound.
    abstract float
    getStrength(net.minecraft.world.entity.player.Player player)
    Gets the Strength of this material when being broken by the given player.
    void
    Initialize any client-side properties for this MicroMaterial.
    abstract boolean
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MULTIPART_TYPES

      public static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<MicroMaterial>> MULTIPART_TYPES
      The registry name used by MicroMaterial.
    • REGISTRY

      public static final net.minecraft.core.Registry<MicroMaterial> REGISTRY
    • CODEC

      public static final com.mojang.serialization.Codec<MicroMaterial> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,MicroMaterial> STREAM_CODEC
  • Constructor Details

    • MicroMaterial

      public MicroMaterial()
  • Method Details

    • getRegistryName

      public net.minecraft.resources.ResourceLocation getRegistryName()
      Returns:
      Key this material is registered under
    • isTransparent

      public abstract boolean isTransparent()
      Returns:
      If this material is not opaque. (Glass, Ice, etc.)
    • getLightEmission

      public abstract int getLightEmission()
      Gets the light level emitted by this micro material.
      Returns:
      The light emission.
    • getStrength

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

      public abstract net.minecraft.network.chat.Component getLocalizedName()
      Gets the localized name for this material.
      Returns:
      The localized name.
    • getItem

      public abstract net.minecraft.world.item.ItemStack getItem()
      Gets ItemStack this material can be cut from.
      Returns:
      The ItemStack.
    • getSound

      @Nullable public abstract @Nullable net.minecraft.world.level.block.SoundType getSound()
      Get the breaking/waking sound.
      Returns:
      The SoundType.
    • getExplosionResistance

      public abstract float getExplosionResistance(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.Explosion explosion)
      Get the resistance of this material for the given explosion.
      Parameters:
      level - The level.
      pos - The position.
      explosion - The explosion.
      Returns:
      The resistance.
    • initializeClient

      public void initializeClient(Consumer<MicroMaterialClient> cons)
      Initialize any client-side properties for this MicroMaterial.
      Parameters:
      cons - Consumer to set this material's MicroMaterialClient.