Class BlockConfig
java.lang.Object
org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfig<C,I>
org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfigForge<BlockConfig,net.minecraft.world.level.block.Block>
org.cyclops.cyclopscore.config.extendedconfig.BlockConfig
- All Implemented Interfaces:
Comparable<ExtendedConfig<BlockConfig,
,net.minecraft.world.level.block.Block>> IModelProviderConfig
public abstract class BlockConfig
extends ExtendedConfigForge<BlockConfig,net.minecraft.world.level.block.Block>
implements IModelProviderConfig
Config for blocks.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionnet.minecraft.client.resources.model.ModelResourceLocation
net.minecraft.client.resources.model.ModelResourceLocation
Fields inherited from class org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfig
configProperties
-
Constructor Summary
ConstructorDescriptionBlockConfig
(ModBase mod, String namedId, Function<BlockConfig, ? extends net.minecraft.world.level.block.Block> blockConstructor, BiFunction<BlockConfig, net.minecraft.world.level.block.Block, ? extends net.minecraft.world.item.Item> itemConstructor) -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<net.minecraft.world.item.ItemStack>
net.minecraft.client.color.block.BlockColor
Return the configurable type for which this config holds dataprotected static BiFunction<BlockConfig,
net.minecraft.world.level.block.Block, ? extends net.minecraft.world.item.BlockItem> protected static BiFunction<BlockConfig,
net.minecraft.world.level.block.Block, ? extends net.minecraft.world.item.BlockItem> getDefaultItemConstructor
(ModBase mod, Function<net.minecraft.world.item.Item.Properties, net.minecraft.world.item.Item.Properties> itemPropertiesModifier) Get the full unlocalized name for this configurable.BiFunction<BlockConfig,
net.minecraft.world.level.block.Block, ? extends net.minecraft.world.item.Item> net.minecraft.world.item.Item
getModelName
(net.minecraft.world.item.ItemStack itemStack) Get the model name for the given itemstack.net.minecraftforge.registries.IForgeRegistry<net.minecraft.world.level.block.Block>
Get the unlocalized name (must be unique!) for this configurable.void
Overridable method that is immediately called after this element has been registered into a Forge registry.void
Overridable method that is called after the element of this config is fully registered, after theFMLCommonSetupEvent
.org.apache.commons.lang3.tuple.Pair<net.minecraft.client.resources.model.ModelResourceLocation,
net.minecraft.client.resources.model.ModelResourceLocation> Register default block and item models for this block.void
setItemInstance
(net.minecraft.world.item.Item itemInstance) Methods inherited from class org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfigForge
getResourceKey
Methods inherited from class org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfig
compareTo, downCast, getConfigPropertyPrefix, getInstance, getSubUniqueName, initializeInstance, onConfigPropertyReload, save, showDoubleInitError
-
Field Details
-
dynamicBlockVariantLocation
public net.minecraft.client.resources.model.ModelResourceLocation dynamicBlockVariantLocation -
dynamicItemVariantLocation
public net.minecraft.client.resources.model.ModelResourceLocation dynamicItemVariantLocation
-
-
Constructor Details
-
BlockConfig
public BlockConfig(ModBase mod, String namedId, Function<BlockConfig, ? extends net.minecraft.world.level.block.Block> blockConstructor, @Nullable BiFunction<BlockConfig, net.minecraft.world.level.block.Block, ? extends net.minecraft.world.item.Item> itemConstructor)
-
-
Method Details
-
getDefaultItemConstructor
protected static BiFunction<BlockConfig,net.minecraft.world.level.block.Block, getDefaultItemConstructor? extends net.minecraft.world.item.BlockItem> (ModBase mod) -
getDefaultItemConstructor
protected static BiFunction<BlockConfig,net.minecraft.world.level.block.Block, getDefaultItemConstructor? extends net.minecraft.world.item.BlockItem> (ModBase mod, @Nullable Function<net.minecraft.world.item.Item.Properties, net.minecraft.world.item.Item.Properties> itemPropertiesModifier) -
getItemConstructor
@Nullable public BiFunction<BlockConfig,net.minecraft.world.level.block.Block, getItemConstructor()? extends net.minecraft.world.item.Item> -
getItemInstance
@Nullable public net.minecraft.world.item.Item getItemInstance() -
setItemInstance
public void setItemInstance(@Nullable net.minecraft.world.item.Item itemInstance) -
getModelName
Description copied from interface:IModelProviderConfig
Get the model name for the given itemstack.- Specified by:
getModelName
in interfaceIModelProviderConfig
- Parameters:
itemStack
- The item stack- Returns:
- The model name.
-
getTranslationKey
Description copied from class:ExtendedConfig
Get the unlocalized name (must be unique!) for this configurable.- Specified by:
getTranslationKey
in classExtendedConfig<BlockConfig,
net.minecraft.world.level.block.Block> - Returns:
- The unlocalized name.
-
getFullTranslationKey
Description copied from class:ExtendedConfig
Get the full unlocalized name for this configurable.- Overrides:
getFullTranslationKey
in classExtendedConfig<BlockConfig,
net.minecraft.world.level.block.Block> - Returns:
- The unlocalized name.
-
getConfigurableType
Description copied from class:ExtendedConfig
Return the configurable type for which this config holds data- Specified by:
getConfigurableType
in classExtendedConfig<BlockConfig,
net.minecraft.world.level.block.Block> - Returns:
- the type of the configurable to where the config belongs
-
registerDynamicModel
public org.apache.commons.lang3.tuple.Pair<net.minecraft.client.resources.model.ModelResourceLocation,net.minecraft.client.resources.model.ModelResourceLocation> registerDynamicModel()Register default block and item models for this block. This should only be used when registering dynamic models.- Returns:
- The pair of block resource location and item resource location.
-
onRegistered
public void onRegistered()Description copied from class:ExtendedConfig
Overridable method that is called after the element of this config is fully registered, after theFMLCommonSetupEvent
.- Overrides:
onRegistered
in classExtendedConfig<BlockConfig,
net.minecraft.world.level.block.Block>
-
defaultCreativeTabEntries
-
onForgeRegistered
public void onForgeRegistered()Description copied from class:ExtendedConfig
Overridable method that is immediately called after this element has been registered into a Forge registry.- Overrides:
onForgeRegistered
in classExtendedConfig<BlockConfig,
net.minecraft.world.level.block.Block>
-
getRegistry
public net.minecraftforge.registries.IForgeRegistry<net.minecraft.world.level.block.Block> getRegistry()- Specified by:
getRegistry
in classExtendedConfigForge<BlockConfig,
net.minecraft.world.level.block.Block> - Returns:
- The registry in which this should be registered.
-
getBlockColorHandler
@Nullable public net.minecraft.client.color.block.BlockColor getBlockColorHandler()- Returns:
- An optional color handler for the block instance.
-