Package codechicken.microblock.api
Class MicroMaterial
java.lang.Object
codechicken.microblock.api.MicroMaterial
- Direct Known Subclasses:
BlockMicroMaterial
Created by covers1624 on 26/6/22.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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 -
Method Summary
Modifier and TypeMethodDescriptionabstract floatgetExplosionResistance(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.ItemStackgetItem()GetsItemStackthis material can be cut from.abstract intGets the light level emitted by this micro material.abstract net.minecraft.network.chat.ComponentGets the localized name for this material.net.minecraft.resources.ResourceLocationabstract @Nullable net.minecraft.world.level.block.SoundTypegetSound()Get the breaking/waking sound.abstract 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.abstract boolean
-
Field Details
-
MULTIPART_TYPES
public static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<MicroMaterial>> MULTIPART_TYPESThe registry name used by MicroMaterial. -
REGISTRY
-
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()GetsItemStackthis 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
Initialize any client-side properties for this MicroMaterial.- Parameters:
cons- Consumer to set this material'sMicroMaterialClient.
-