mojira.dev
MC-10369

Server side particle spawning does not create particles for client

The bug

Particle creation triggered for the server does not send a particle packets to the client.

Affected situations

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

Iron and snow Golem creation
  • Affected method: net.minecraft.block.BlockPumpkin.trySpawnGolem(World, BlockPos)

  • Suggested fix: See comment

Wither boss creation
  • Affected method: net.minecraft.block.BlockSkull.checkWitherSpawn(World, BlockPos, TileEntitySkull)

  • Suggested fix: See comment

Water and lava colliding
  • Affected method: net.minecraft.block.BlockLiquid.triggerMixEffects(World, BlockPos)

  • Suggested fix: See comment

Redstone torch burning out
  • Affected method: net.minecraft.block.BlockRedstoneTorch.updateTick(World, BlockPos, IBlockState, Random)

  • Suggested fix: See comment

Armor breaking on mob
  • Affected method: net.minecraft.entity.EntityLivingBase.renderBrokenItemStack(ItemStack)

  • How to reproduce: See description of MC-96974

Placing eye of ender in end portal frame
  • Affected method: net.minecraft.item.ItemEnderEye.onItemUse(ItemStack, EntityPlayer, World, BlockPos, EnumHand, EnumFacing, float, float, float)

  • Suggested fix: See comment

Animal being born
  • Affected method: net.minecraft.entity.ai.EntityAIMate.spawnBaby()

Ender dragon destroying blocks
  • Affected method: net.minecraft.entity.boss.EntityDragon.destroyBlocksInAABB(AxisAlignedBB)

Explosion particles for EntityLiving spawned by spawner
  • Affected method: net.minecraft.tileentity.MobSpawnerBaseLogic.updateSpawner()

The reason

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

The reason why this is happening is because the abstract method net.minecraft.world.IWorldEventListener.spawnParticle(int, boolean, double, double, double, double, double, double, int...) is called for particle creation. Calling this method calls for the client the net.minecraft.client.renderer.RenderGlobal.spawnParticle(int, boolean, double, double, double, double, double, double, int...) method which creates the particle. However, for the server it calls the net.minecraft.world.WorldManager.spawnParticle(int, boolean, double, double, double, double, double, double, int...) method which does nothing. The change of using an integrated server for the client might have caused this bug.
It is probably not a good decision to fix this by having the net.minecraft.world.WorldManager class sending particle packets every time the method is called because this method does not support a count parameter, which means that for example for the creation of an iron or snow golem 120 packets are being sent. Instead the method net.minecraft.world.WorldServer.spawnParticle(EnumParticleTypes, double, double, double, int, double, double, double, double, int...) should be used which has a particle count parameter and uses the value for creating the particle packet.

Comparing with old behaviour

If you would like to test how it was in 1.2.5, you can download the 1.2.5 jar file from here:

http://www.minecraftwiki.net/wiki/Version_history/Development_versions#Minecraft_1.2_Snapshots_.26_Pre-releases
Or you can create a new profile in the launcher with the version "release 1.2.5"
Replace your current jar file with the 1.2.5 one and spawn each Golem to see the particles.

Linked issues

Attachments

Comments 13

Chumbanotz, did you test every single issue against 13w09c in 2 minutes or do you blindly bulk-setting the version ?

Confirmed.

you don't have to download the minecraft.jar for MC 1.2.5 you can use the launcher.

Confirmed for 1.8/1.8.1-pre2.

Affects 15w47c & 1.8.8

3 more comments

Can someone of the mods please mark all reports currently marked as "relates to" as duplicate?
I will update the report after that accordingly

Affects version 1.9 and 1.9.1-pre3.

Snow golem particles seem to be back in 17w47b, maybe earlier, though it's possible it's just a side effect of the snow blocks breaking.

EDIT: yes it is, see MC-123338.

So, a new item got added to the list in 1.9 : chorus fruit. When eaten, it calls Item#onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase entityLiving). That method then performs a !world.isRemote check and proceeds to call EntityLivingBase#attemptTeleport(double x, double y, double z) a couple of times. In the latter, the code generates PORTAL particles using the client-side spawnParticles method. But because of the server-side check earlier, nothing happens on the client and no packet is sent.

Which of the examples are still an issue in 1.15.2?

Chumbanotz

marcono1234

boq

Confirmed

(Unassigned)

12w18a, iron_golem, particles, snow_golem, villager_golem

Snapshot 13w09a, Snapshot 13w09b, Snapshot 13w09c, Snapshot 13w10a, Snapshot 13w10b, ..., Minecraft 18w08b, Minecraft 18w11a, Minecraft 1.13-pre1, Minecraft 1.13-pre6, Minecraft 1.13.1

Minecraft 19w14a

Retrieved