Biomes O' Plenty

Biomes O' Plenty

151M Downloads

BoP Causing Duplication Glitches with Thaumcraft

RyanP1991 opened this issue ยท 2 comments

commented

Playing on a multiplayer server. When placing an auxiliary venting port or slurry pump on a essentia smeltery, it appears to be removed from your inventory, but updating that slot by right clicking on something else or moving an item into it causes it to reappear, effectively duplicating the venting port or slurry pump.

This doesnt dupe the item when BOP isnt installed but only happens when BOP is installed.
(Azanor/thaumcraft-5#443)

commented

I'm inclined to think that this is some kind of issue with inventory metadata and Thaumcraft, given that this appears in the log http://hastebin.com/inekajusic.avrasm
and this is the code responsible:

@SubscribeEvent
public void onBlockPlaced(BlockEvent.PlaceEvent event)
{
    ItemStack stack = event.itemInHand;

    //Blocks can be placed by things other than players
    if (stack != null)
    {
        Item item = stack.getItem();
        Block block = Block.getBlockFromItem(item);
        IBlockState state = block != null ? block.getStateFromMeta(stack.getItemDamage()) : null;

        //Yggdrasil
        if (state == BlockBOPSapling.paging.getVariantState(BOPTrees.SACRED_OAK))
        {
            event.player.triggerAchievement(BOPAchievements.grow_sacred_oak);
        }
    }
}

From our end, it is possible to just ignore the problem and stick it in a try catch, but I don't think it's unreasonable to assume that the metadata of an ItemBlock in the inventory at least matches up to a valid state.

commented

It's also worth mentioning, block.getStateFromMeta(item.getMetadata(stack.getItemDamage())) (which actually should fix this) appears to have no impact on the outcome here. So perhaps Thaumcraft needs to implement getMetadata() properly on its itemblocks