Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-165510

Water and lava can't be placed on redstone ore

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 19w45b, 19w46b, 1.15 Pre-Release 2, 1.15 Pre-release 3, 1.15 Pre-release 4, 1.15 Pre-release 5, 1.15 Pre-release 6, 1.15 Pre-release 7, 1.15, 1.15.1, 1.15.2 Pre-Release 1, 1.15.2, 20w06a, 20w13a, 20w16a, 20w19a, 20w21a, 20w22a, 1.16 Pre-release 3, 1.16 Pre-release 7, 1.16, 1.16.1, 1.16.2 Pre-release 1, 1.16.2 Pre-release 3, 1.16.2 Release Candidate 1, 1.16.3, 1.16.4 Pre-release 2, 1.16.4, 20w46a, 21w03a, 21w05b, 21w13a, 21w14a, 21w17a, 21w19a, 1.17, 1.17.1, 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 22w42a, 1.20.1, 1.21
    • Confirmed
    • Player
    • Low
    • Gameplay

      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 Thumpbacker

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

            Unassigned Unassigned
            skztr skztr
            Votes:
            57 Vote for this issue
            Watchers:
            22 Start watching this issue

              Created:
              Updated:
              CHK: