Skip to content

Commit

Permalink
Fix crash when lighting unlit wall torches
Browse files Browse the repository at this point in the history
  • Loading branch information
realguyman committed Jun 3, 2022
1 parent 386d5a2 commit e986272
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import net.minecraft.block.WallTorchBlock;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.particle.ParticleEffect;
import net.minecraft.state.property.Properties;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
Expand All @@ -29,7 +28,7 @@ public Block getLitBlock() {

@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult result) {
if (player.getStackInHand(hand).isIn(TagRegistry.TORCH_IGNITER_ITEMS) && world.setBlockState(pos, litBlock.getDefaultState().with(Properties.FACING, state.get(Properties.FACING)))) {
if (player.getStackInHand(hand).isIn(TagRegistry.TORCH_IGNITER_ITEMS) && world.setBlockState(pos, litBlock.getDefaultState().with(WallTorchBlock.FACING, state.get(WallTorchBlock.FACING)))) {
// TODO: Add a quiet flame sound.
return ActionResult.SUCCESS;
}
Expand Down

0 comments on commit e986272

Please sign in to comment.