<commit_before>package net.moltendorf.Bukkit.IntelliDoors.controller

import org.bukkit.Material
import org.bukkit.Sound
import org.bukkit.block.Block
import org.bukkit.block.BlockFace

/**
 * Created by moltendorf on 15/05/23.

 * @author moltendorf
 */
class DoubleDoor(val left: SingleDoor, val right: SingleDoor, open: Boolean) : Door() {
  override val location = left.location.toVector().getMidpoint(right.location.toVector()).toLocation(left.location.world)
  override val type = left.type

  override val facing: BlockFace
    get() = left.facing

  override var open = open
    set(value) {
      left.open = value
      right.open = value
      field = value
    }

  override fun onInteract(onDoor: Door) {
    val isOpen = !open

    when (type) {
      Material.WOODEN_DOOR -> onDoor.overrideOpen(isOpen)
      else -> location.world.playSound(location, sound(isOpen), 1f, 1f)
    }

    open = isOpen
  }

  override fun overrideOpen(value: Boolean) {
    left.overrideOpen(value)
    right.overrideOpen(value)
    open = value
  }

  override fun sound(open: Boolean): Sound {
    return when (type) {
      Material.IRON_DOOR_BLOCK -> {
        if (open) Sound.BLOCK_IRON_DOOR_OPEN else Sound.BLOCK_IRON_DOOR_CLOSE
      }
      Material.ACACIA_DOOR,<commit_msg>Fix other wooden doors not working as intended<commit_after>package net.moltendorf.Bukkit.IntelliDoors.controller

import org.bukkit.Material
import org.bukkit.Sound
import org.bukkit.block.Block
import org.bukkit.block.BlockFace

/**
 * Created by moltendorf on 15/05/23.

 * @author moltendorf
 */
class DoubleDoor(val left: SingleDoor, val right: SingleDoor, open: Boolean) : Door() {
  override val location = left.location.toVector().getMidpoint(right.location.toVector()).toLocation(left.location.world)
  override val type = left.type

  override val facing: BlockFace
    get() = left.facing

  override var open = open
    set(value) {
      left.open = value
      right.open = value
      field = value
    }

  override fun onInteract(onDoor: Door) {
    val isOpen = !open

    when (type) {
      Material.IRON_DOOR_BLOCK, Material.IRON_TRAPDOOR -> location.world.playSound(location, sound(isOpen), 1f, 1f)
      else -> onDoor.overrideOpen(isOpen)
    }

    open = isOpen
  }

  override fun overrideOpen(value: Boolean) {
    left.overrideOpen(value)
    right.overrideOpen(value)
    open = value
  }

  override fun sound(open: Boolean): Sound {
    return when (type) {
      Material.IRON_DOOR_BLOCK -> {
        if (open) Sound.BLOCK_IRON_DOOR_OPEN else Sound.BLOCK_IRON_DOOR_CLOSE
      }
      Material.ACACIA_DOOR,
{'fraction_non_alphanumeric': 0.10240733664501338, 'fraction_numerical': 0.00611387084447841, 'mean_word_length': 3.32013201320132, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3230738', 'n_tokens_mistral': 891, 'n_tokens_neox': 850, 'n_words': 193}