Chisels & Bits - For Fabric

Chisels & Bits - For Fabric

2M Downloads

swaping wand - chisels and bits blocks swapped out, become invisible in inventory

rahangar opened this issue ยท 8 comments

commented

Not sure if this is a Chisels & Bits issue or a NotEnoughWands issue, so I'm posting in both places. If there is a better way of doing this so that both mod authors become aware of the issue, please advise.

It looks like I've pushed my graphics card beyond the number of chiseled blocks that it can support, So I'm using the Swapping Wand to replace some C&B blocks with non-C&B blocks. The blocks get replaced, but the C&B blocks that are swapped out and end up in my inventory are invisible! - the number of blocks is visible, but not the block itself. I can move those invisible blocks within my inventory, but I cannot place the invisible blocks.

In terms of swapping, in the image below, the new block is in slot 1, the old block is in slot 2. I expect to see an image of the old block, in slot 4, but as you can see it is invisible.

Can you please have a look at this?

Here are is the version information:
Minecraft: 1.10.2
Forge: 12.18.2.2124
Modpack: FTB presents HermitPack version 1.4.0
Chisels & Bits: 12.7
NotEnoughWands: 1.10-1.4.0

image

The tool tip for the invisible blocks:
image

The tool tip for the expected blocks:
image

commented

Seems to me that Not Enough Wands is failing to get the NBT data for the block.

commented

It is as Algo says: https://github.com/romelo333/notenoughwands1.8.8/blob/1.10/src/main/java/romelo333/notenoughwands/Items/SwappingWand.java#L101

It's the same root cause of romelo333/notenoughwands1.8.8#15 (opened 5 days ago).

Also, you opened the issue in the wrong NEW repo for MC 1.10. You want the one linked above.

commented

Great. Thanks for the reply.

About your comment regarding me having opened the issue in the wrong NEW repo... I don't quite understand.... I'm new to gitHub... and would appreciate some clarification if you don't mind.

Also, will the ticket romelo333/notenoughwands1.8.8#15 sufficiently track my 1.10 issue? or do you think I should raise a new issue specific to 1.10?

thanks

commented

I mean that you opened the issue in the Not Enough Wands (NEW) repo for MC 1.7 (notenoughwands) instead of the one for MC 1.8+ (notenoughwands1.8.8).

Although the root cause is the same, I would open one (in notenoughwands1.8.8 after closing the one in notenoughwands) to further illustrate the possible outcomes of the oversight of failing to save NBT data.

commented

For placement you need to place the block, use it on the proper place, for mining you need to get the ItemStacks for the block.

Just plopping states and reading states is only valid for extremely simple blocks.

commented

"Seems to me that Not Enough Wands is failing to get the NBT data for the block."

So, how do we get the NBT data from the itemstack and write it into the block? I have machines and tools that take valid chiseled blocks harvested as normal and try to place them but its not working, what exactly do we do for this? i just do world.setBlockState() on it currently. Lothrazar/Cyclic#186

commented

"use it on the proper place" Use what on the proper place?

I assume i have to get the blockstate from the item stack, which is what im doing here :

block.getStateFromMeta(stack.getMetadata())

I cant find any other method to detect Looking through the entire Block class, i dont see a getStateFromItemStack method. Also have been browsing the forums too.

As I was typing this i realized, do you mean that this is the way:

onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)

UPDATE: Yes for anyone reading this later this works perfectly 100%, just do itemstack.onItemUse, do not use the metadata method. Feel free to look at the code in the commit linked in cyclic issue 186 linked above if help is needed.

commented

I believe so, I don't have time to actually plug though the code at the moment, but generally speaking, using the item is the intended method of placement.