-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block Extension QSL #100
base: 1.18
Are you sure you want to change the base?
Block Extension QSL #100
Conversation
… a property from a block with proxies, without crashing the game if the peroperty doesn't exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some notes:
- we use
<Class>Mixin
and notMixin<Class>
- I feel like copyProperty should do checks to avoid copying something that cannot be copied
- getProxyDefaultState probably should be replaced with a more generic method called
mergeStates(BlockState source, BlockState target)
.
Also don't forget to run the applyLicenses
task!
...ry/block/block_extensions/src/main/java/org/quiltmc/qsl/block/extensions/api/QuiltBlock.java
Outdated
Show resolved
Hide resolved
.../block/block_extensions/src/main/java/org/quiltmc/qsl/block/extensions/mixin/MixinBlock.java
Outdated
Show resolved
Hide resolved
|
||
@Override | ||
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { | ||
var prop = QuiltBlock.getProperty(state, StairsBlock.HALF); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This usage of getProperty doesn't sound useful?
If the stuff that was merged were merged properly, it should already include the property.
Co-authored-by: LambdAurora <[email protected]>
…ions. Sorry, I didn't know 😔 Co-authored-by: LambdAurora <[email protected]>
How would you generify I struggle to see any ways to 100% generify this method in particular, as it's currently not possible to target a single Proxy and it needs to get all of them in a loop to gather teh default states. Unless I create a new method to |
Fix Block Mixin name to fit naming conventions
This PR contains the base for a QuiltBlock Utility, which currently only has Property proxying (i.e creating blocks that "extend" multiple blocks, thus inheriting their blockstate properties)
To create a block proxy, you simply call
QuiltBlock.createProxy()
in its constructor, asTestBlock
for the example mod shows.QuiltBlock.createProxy()
takes the block's settings, and an array of already registered blocks, the block settings are only used to be able to call the method itself, as this needs to happen at thesuper()
call