Skip to content

API for registering custom block-state transform rules #3024

Description

@SShakusora

The Problem

WorldEdit handles block rotation and flipping through BlockTransformExtent.

This works well for block states whose spatial semantics are already understood by WorldEdit, such as facing, axis, rails, stairs, directional connection properties, etc.

However, modded blocks may contain custom block-state properties whose spatial meaning cannot be inferred by WorldEdit.

For example:

example:machine[orientation=front_left]

The mod may know how this property should behave under a 90° rotation or mirror operation, but currently there does not appear to be a public API for supplying that transformation logic to WorldEdit.

A Solution

It would be useful to expose a public API allowing mods/plugins to register transformation logic for custom block states or properties.

Or use net.minecraft.world.level.block.state.BlockBehaviour#rotate and net.minecraft.world.level.block.state.BlockBehaviour#mirror instead.

Alternatives

No response

Anything Else?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:acceptedWill be fixed / added to WorldEdit, eventuallytype:feature-requestRequest for something new

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions