mojira.dev
MC-73857

Redstone torches no longer produce particles when burning out

In old versions, smoke particles spawn when a redstone torch burns out. They do not spawn in any version since 1.3.1 (the sound still plays).

Code analysis: https://bugs.mojang.com/browse/MC-73857?focusedCommentId=284666&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-284666 and https://bugs.mojang.com/browse/MC-10369?focusedCommentId=284639&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-284639

Linked issues

Attachments

Comments

marcono1234

Confirmed for

  • 16w06a

marcono1234

Please link to this comment and the comment on MC-10369 in the description of this report

The following is based on decompiled version of Minecraft 1.8 using MCP. All method and class names are the names used in the decompiled version.

Displaying the smoke particles should happen in the public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) method of the net.minecraft.block.BlockRedstoneTorch class. This method calls the method private boolean func_176598_a(World worldIn, BlockPos p_176598_2_, boolean p_176598_3_) to test if particles and the sound should be displayed, but it seems that this never succeeds. I am unsure about this because I do not understand the use of this function either.

The main problem here is the same as for MC-10369. I changed the method in a way that it imitates the method which creates the normal reddust particles.

How to fix the bug

Instead of having the for loops to create the particles, the following could / should be used:

  • Affected class: net.minecraft.block.BlockRedstoneTorch

  • Affected method: public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)

  • New code:
    pos - The BlockPos of the redstone torch

    EnumFacing facing = (EnumFacing) worldIn.getBlockState(pos).getValue(FACING_PROP); 
    double posX = pos.getX() + 0.5D;
    double posY = pos.getY() + 0.7D;
    double posZ = pos.getZ() + 0.5D;
    
    if (facing.getAxis().isHorizontal())
    {
    	facing = facing.getOpposite();
    	posX += 0.27000001072883606D * (double)facing.getFrontOffsetX();
    	posY += 0.2199999988079071D;
    	posZ += 0.27000001072883606D * (double)facing.getFrontOffsetZ();
    }
    
    double maxParticleOffset = 0.2D / 2;
    ((WorldServer) worldIn).func_175739_a(EnumParticleTypes.SMOKE_NORMAL, posX, posY, posZ, 5, maxParticleOffset, maxParticleOffset, maxParticleOffset, 0D, new int[0]);

Note: It would be better to have the smoke and the reddust particles be rendered based on the block boundaries

Ccosenza

(Unassigned)

Unconfirmed

Minecraft 1.8, Minecraft 1.8.1-pre3, Minecraft 1.8.1-pre4, Minecraft 1.8.1-pre5, Minecraft 1.8.1, ..., Minecraft 16w03a, Minecraft 16w06a, Minecraft 1.9 Pre-Release 1, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 2

Retrieved