CustomBlock class
This Module allows you to create infinite new blocks in the game. It works by providing a block and an item that acts as a model for the new block.
- Inheritance
-
- Object
- Widget
- RestActionAble
- Module
- CustomBlock
Constructors
-
CustomBlock(String id, Item item, {required Block block, Item? blockModel, Item? breakItem, Widget? main, Widget? onBreak, Widget? onPlaced, List<
String> tags = const [], bool generatePack = true, bool fire = false, String? name, bool useItemFrame = false, double yOffset = 1}) -
This Module allows you to create infinite new blocks in the game. It works by providing a
block
and anitem
that acts as a model for the new block.
Properties
- block ↔ Block
-
getter/setter pair
- blockModel ↔ Item?
-
getter/setter pair
- breakItem ↔ Item
-
getter/setter pair
- called ↔ bool
-
Contains the Information, if this RestAction is already called (and can't be called again)
getter/setter pairinherited
- fire ↔ bool
-
getter/setter pair
- generatePack ↔ bool
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String
-
getter/setter pair
- item ↔ Item
-
getter/setter pair
- main ↔ Widget?
-
getter/setter pair
- name ↔ String?
-
getter/setter pair
- onBreak ↔ Widget?
-
getter/setter pair
- onPlaced ↔ Widget?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
getter/setter pair
- useItemFrame ↔ bool
-
getter/setter pair
-
writable
↔ List<
Widget> ? -
The writable list the RestAction writes it's contents on
getter/setter pairinherited
- yOffset ↔ double
-
getter/setter pair
Methods
-
generate(
Context context) → Widget -
override
-
getItem(
) → Item -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
queue(
[List< Widget> ? writable]) → void -
Execute this method to add this to the WidgetList (can use default list or as parameter given list)
This method can only be executed once, if it is executed multiple times you will get an Error. You can read out if it is already executed in the boolean Called
Example for a queue method:
inherited
-
registerFiles(
) → List< File> -
override
-
toMap(
) → dynamic -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited