Package codechicken.microblock.api
Class BlockMicroMaterial
java.lang.Object
codechicken.microblock.api.MicroMaterial
codechicken.microblock.api.BlockMicroMaterial
Created by covers1624 on 26/6/22.
-
Field Summary
FieldsFields inherited from class codechicken.microblock.api.MicroMaterial
CODEC, MULTIPART_TYPES, REGISTRY, STREAM_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionBlockMicroMaterial(net.minecraft.world.level.block.Block block) BlockMicroMaterial(net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionfloatgetExplosionResistance(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.net.minecraft.world.item.ItemStackgetItem()GetsItemStackthis material can be cut from.intGets the light level emitted by this micro material.net.minecraft.network.chat.ComponentGets the localized name for this material.net.minecraft.world.level.block.SoundTypegetSound()Get the breaking/waking sound.floatgetStrength(net.minecraft.world.entity.player.Player player) Gets the Strength of this material when being broken by the given player.voidInitialize any client-side properties for this MicroMaterial.booleanstatic net.minecraft.resources.ResourceLocationmakeMaterialKey(net.minecraft.world.level.block.state.BlockState state) Builds aBlockMicroMaterialregistry name for the givenBlockState.Methods inherited from class codechicken.microblock.api.MicroMaterial
getRegistryName
-
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:
isTransparentin classMicroMaterial- Returns:
- If this material is not opaque. (Glass, Ice, etc.)
-
getLightEmission
public int getLightEmission()Description copied from class:MicroMaterialGets the light level emitted by this micro material.- Specified by:
getLightEmissionin classMicroMaterial- Returns:
- The light emission.
-
getStrength
public float getStrength(net.minecraft.world.entity.player.Player player) Description copied from class:MicroMaterialGets the Strength of this material when being broken by the given player.- Specified by:
getStrengthin classMicroMaterial- Parameters:
player- The player.- Returns:
- The strength value.
-
getLocalizedName
public net.minecraft.network.chat.Component getLocalizedName()Description copied from class:MicroMaterialGets the localized name for this material.- Specified by:
getLocalizedNamein classMicroMaterial- Returns:
- The localized name.
-
getItem
public net.minecraft.world.item.ItemStack getItem()Description copied from class:MicroMaterialGetsItemStackthis material can be cut from.- Specified by:
getItemin classMicroMaterial- Returns:
- The
ItemStack.
-
getSound
public net.minecraft.world.level.block.SoundType getSound()Description copied from class:MicroMaterialGet the breaking/waking sound.- Specified by:
getSoundin classMicroMaterial- 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:MicroMaterialGet the resistance of this material for the given explosion.- Specified by:
getExplosionResistancein classMicroMaterial- Parameters:
level- The level.pos- The position.explosion- The explosion.- Returns:
- The resistance.
-
initializeClient
Description copied from class:MicroMaterialInitialize any client-side properties for this MicroMaterial.- Overrides:
initializeClientin classMicroMaterial- Parameters:
cons- Consumer to set this material'sMicroMaterialClient.
-
makeMaterialKey
public static net.minecraft.resources.ResourceLocation makeMaterialKey(net.minecraft.world.level.block.state.BlockState state) Builds aBlockMicroMaterialregistry name for the givenBlockState.Due to the restrictions imposed by
ResourceLocation, the following format is used:
mod_id:block_name//property1.value1/property2.value2/property3.value3- Parameters:
state- TheBlockStateto create a name for.- Returns:
- The name.
-