Class OnyxBlockImpl
java.lang.Object
com.zombienw.onyxlib.impl.block.OnyxBlockImpl
- All Implemented Interfaces:
OnyxBlock, OnyxElement
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDefines the underlying vanilla Minecraft block underneath this custom block.blockDisplay(Consumer<OnyxBlockDisplay> builder) Configures the visual faces of the custom block using a block display builder.create()Creates a single ItemStack of this element.create(int amount) Creates an ItemStack of this element with the specified amount.displayName(String name) Sets the display name using a legacy string with no italics.displayName(net.kyori.adventure.text.Component component) Sets the display name using an Adventure Component.getId()getKey()Sets the relative path to the developer made JSON item model.Places an OnyxBlock at a given location.rotates(boolean rotates) Determines if the custom block should rotate to face the player upon placement.
-
Constructor Details
-
OnyxBlockImpl
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceOnyxElement- Returns:
- The string identifier of this element (e.g., "marble")
-
getBlockDisplay
-
getCustomModelPath
-
getBaseBlock
-
getKey
- Specified by:
getKeyin interfaceOnyxElement- Returns:
- The underlying Bukkit NamespacedKey for this element
-
baseBlock
Description copied from interface:OnyxBlockDefines the underlying vanilla Minecraft block underneath this custom block. -
displayName
Description copied from interface:OnyxBlockSets the display name using a legacy string with no italics.- Specified by:
displayNamein interfaceOnyxBlock- Parameters:
name- The display name.- Returns:
- This OnyxBlock instance.
-
displayName
Description copied from interface:OnyxBlockSets the display name using an Adventure Component.- Specified by:
displayNamein interfaceOnyxBlock- Parameters:
component- The display name component.- Returns:
- This OnyxBlock instance.
-
model
Description copied from interface:OnyxBlockSets the relative path to the developer made JSON item model. The path is relative to assets//models/ in your plugin jar. -
blockDisplay
Description copied from interface:OnyxBlockConfigures the visual faces of the custom block using a block display builder. Note: If this method is invoked, all relevant faces of the block must be explicitly defined, otherwise an error will be thrown during resource pack generation.- Specified by:
blockDisplayin interfaceOnyxBlock- Parameters:
builder- A consumer managing the texture mappings for the block's faces.- Returns:
- This OnyxBlock instance.
-
rotates
Description copied from interface:OnyxBlockDetermines if the custom block should rotate to face the player upon placement. -
create
Description copied from interface:OnyxElementCreates a single ItemStack of this element. Automatically applies CustomModelData and PDC tags.- Specified by:
createin interfaceOnyxElement- Returns:
- The generated ItemStack.
-
create
Description copied from interface:OnyxElementCreates an ItemStack of this element with the specified amount. Automatically applies CustomModelData and PDC tags.- Specified by:
createin interfaceOnyxElement- Parameters:
amount- The stack size.- Returns:
- The generated ItemStack.
-
place
-