Mojira Archive
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 [Mod] Anthony Cicinelli

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;
   }