mojira.dev
MC-165510

Water and lava can't be placed on redstone ore

The bug

Right-clicking a redstone ore with a water/lava/fish bucket activates the redstone ore, but does not place the water or lava.

Code Analysis

Code analysis provided by @unknown

Currently the interaction on redstone ore is always a success. We can fix this by adding a check if the redstone ore is lit and if it is lit then fail the interaction

Current Code

net/minecraft/world/level/block/RedStoneOreBlock.java

public InteractionResult use(BlockState p_55472_, Level p_55473_, BlockPos p_55474_, Player p_55475_, InteractionHand p_55476_, BlockHitResult p_55477_) {
         if (p_55473_.isClientSide) {
            spawnParticles(p_55473_, p_55474_);
         } else {
            interact(p_55472_, p_55473_, p_55474_);
         }

      ItemStack itemstack = p_55475_.getItemInHand(p_55476_);
      return itemstack.getItem() instanceof BlockItem && (new BlockPlaceContext(p_55475_, p_55476_, itemstack, p_55477_)).canPlace() ? InteractionResult.PASS : InteractionResult.SUCCESS;
   }

Fixed Code

net/minecraft/world/level/block/RedStoneOreBlock.java

public InteractionResult use(BlockState p_55472_, Level p_55473_, BlockPos p_55474_, Player p_55475_, InteractionHand p_55476_, BlockHitResult p_55477_) {
       //Checking if its already lit then failing the result if it is lit fixes MC-165510 & MC-195094
      if(!p_55472_.getValue(LIT)) {
         if (p_55473_.isClientSide) {
            spawnParticles(p_55473_, p_55474_);
         } else {
            interact(p_55472_, p_55473_, p_55474_);
         }
      }
      else
      {
         return InteractionResult.FAIL;
      }

      ItemStack itemstack = p_55475_.getItemInHand(p_55476_);
      return itemstack.getItem() instanceof BlockItem && (new BlockPlaceContext(p_55475_, p_55476_, itemstack, p_55477_)).canPlace() ? InteractionResult.PASS : InteractionResult.SUCCESS;
   }

Linked issues

Attachments

Comments 46

[MOD] Greymagic27

Can confirm. It happens to me also

Confirmed for 1.15-pre2.

Confirmed for me too - 1.15-pre1 & pre2

Confirmed 19w42a, 19w44a, 19w45b

@unknown, please don't comment for confirming outdated versions. Usually, only the latest release and the latest snapshot/pre-release can be added to Affected Versions.

36 more comments

Can confirm in 1.19.2 and 22w42a.

Can confirm in 1.20.1

The suggested fix and current code actually makes part of the code (the code after the else) unused, it should be removed from the fix suggestion.

Related to MC-149663

himazinn_Japan

Can confirm in 1.21.4.

skztr

(Unassigned)

Confirmed

Gameplay

Low

Player

redstone_ore

19w45b, 19w46b, 1.15 Pre-Release 2, 1.15 Pre-release 3, 1.15 Pre-release 4, ..., 22w42a, 1.20.1, 1.21, 1.21.4, 1.21.7

Retrieved