KubeJS-Mods / KubeJS

https://kubejs.com
GNU Lesser General Public License v3.0
306 stars 90 forks source link

Buckets do not work on custom waterloggable blocks #462

Closed ChiefArug closed 2 years ago

ChiefArug commented 2 years ago

Minecraft Version

1.18.2

KubeJS Version

Built from dev 6e63cfa

Rhino Version

1802.1.14-build.192

Architectury Version

4.7.78

Forge/Fabric Version

Forge. Smthn 1.18.2. IntelliJ is refusing to say

Describe your issue

You cannot use buckets on custom blocks set to be waterlogged. This is because the object returned by the builder doesnt implement SimpleWaterloggedBlock.

This would be solved by either making waterlogging a custom type or implementing SimpleWaterloggedBlock in BasicBlockJS and just overriding all the methods to do nothing when not set to be waterlogged.

Basic recreation script (startup). The different box size is so that minecraft allows water to flow from it.

onEvent('block.registry', event => {
    event.create('watery').defaultCutout().box(0,0,0,16,5,16).waterlogged()
})

Crash report/logs

No response

artemisSystem commented 2 years ago

I was just about to report this as well. I fixed it for my custom block by making a MaybeWaterloggedBlock interface and extending that in my block class, which just adds a blockState.hasProperty(BlockStateProperties.WATERLOGGED) && before everything that checks the waterlogged blockstate. I think that something along those lines is the cleanest solution.

ChiefArug commented 2 years ago

Fixed by https://github.com/KubeJS-Mods/KubeJS/pull/464