Chisels & Bits - For Fabric

Chisels & Bits - For Fabric

2M Downloads

C&B Not checking isNormalCube(...)

Discomanco opened this issue ยท 8 comments

commented

Can't make bits out of Sky Stone blocks.
Would love to see support for those (mainly Sky Stone Block)

C&B 12.7
Applied Energistics rv4 alpha build 6 (no mention of this in newer builds)

commented

@shartte or @yueh WIll probobly need to white list them, the classes override too many things to detect them properly.

FMLInterModComms.sendMessage( "chiselsandbits", "ignoreblocklogic", "myBlockName" );

commented

Is there a list of requirements blocks have to meet? Most of the overrides are probably useless for the basic blocks and just delegate it back to super. Thus I might prefer to look at them and split the class hierarchy for simple blocks and the more advanced ones.

commented

The following methods cannot be overridden
quantityDropped - both methods
quantityDroppedWithBonus
onEntityCollidedWithBlock

And the following conditions must be met
isFullBlock(state) must be true
hasTileEntity(state) must be false
getTickRandomly() must be false
block.hardness must be 0 or higher
the block must return a valid item for Item.getItemFromBlock( block )

I believe this is the full list of requirements,

commented

Hm, none of them are overridden and it should met these conditions. Not 100% certain about the isFullBlock as it goes through a couple of layers, have to check it.

commented

Looked at it and there are essentially 2 issues.

The first one being isFullBlock() being false for our blocks as minecraft itself initialises it way too early.
The other is using isFullBlock() as it is deprecated and looks the be replaced by isNormalCube(), which we actually override.

Not sure what the best option would be. We could also override isFullBlock(), but it is still marked as deprecated. The other option would be using isNormalCube() for C&B. It falls back to Block#isFullBlock(), so it should be fine. But no idea when it was added in regards to backward compatibility.

commented

isNormalCube is probably usable...

the easiest solution is to just simply set 'isFullBlock' later

https://github.com/AlgorithmX2/FlatColoredBlocks/blob/1.11/src/main/java/mod/flatcoloredblocks/block/BlockFlatColoredTranslucent.java#L23

commented

Yeah, but it is still a bit hacky to have multiple sources of truth for the same property...

commented

True, I could should probably check both of these.