<commit_before>package net.resonious.sburb.commands

import net.resonious.sburb.Sburb
import net.resonious.sburb.Structure
import net.resonious.sburb.abstracts.ActiveCommand
import net.resonious.sburb.abstracts.SburbException
import net.resonious.sburb.commands.SburbCommand.PlayerWithChat
import scala.collection.JavaConverters.seqAsJavaListConverter
import net.minecraft.command.ICommandSender
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.block.Block
import net.minecraft.server.MinecraftServer
import net.minecraft.server.management.ServerConfigurationManager
import net.minecraft.util.RegistryNamespaced
import net.minecraft.util.RegistrySimple
import net.minecraft.util.ObjectIntIdentityMap
import scala.collection.JavaConversions._
import scala.collection.mutable.HashMap
import scala.math

object StructCommand extends ActiveCommand {
  val underlyingIntegerMap = try {
      classOf[RegistryNamespaced].getDeclaredField("field_148759_a")
    } catch {
      case e: java.lang.NoSuchFieldException =>
        classOf[RegistryNamespaced].getDeclaredField("underlyingIntegerMap")
    }
  underlyingIntegerMap.setAccessible(true)

  val blockMap = classOf[ObjectIntIdentityMap].getDeclaredField("field_148749_a")
  blockMap.setAccessible(true)

  val registryObjects = try {
      classOf[RegistrySimple].getDeclaredField("field_82596_a")
    } catch {
      case e: java.lang.NoSuchFieldException =>
        classOf[RegistrySimple].getDeclaredField("registryObjects")
    }
  registryObjects.setAccessible(true)

  class PlayerState {
    var corner1: (Int,Int,Int) = (0,0,0)
    var gotCorner1 = false
    var corner2: (Int,Int,Int) = (0,0,0)
    var gotCorner2 = false

    var lastStruct: Structure = null
  }

  val states = new HashMap[String, PlayerState]

  override def getCommandName() = "struct"
  override def getCommandUsage(sender: ICommandSender) = "uhhh"
  override def getCommandAliases() = List("struct", "structure").asJava

  override def canCommandSenderUseCommand(sender: ICommandSender) = {
    sender match {
      case player: EntityPlayer =>
        // MinecraftServer.getServer.getConfigurationManager.isPlayerOpped(player.getCommandSenderName)
        // TODO WTF? I don't know why the above line won't compile
        true
      case _ => false
    }<commit_msg>Update StructCommand.scala<commit_after>package net.resonious.sburb.commands

import net.resonious.sburb.Sburb
import net.resonious.sburb.Structure
import net.resonious.sburb.abstracts.ActiveCommand
import net.resonious.sburb.abstracts.SburbException
import net.resonious.sburb.commands.SburbCommand.PlayerWithChat
import scala.collection.JavaConverters.seqAsJavaListConverter
import net.minecraft.command.ICommandSender
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.block.Block
import net.minecraft.server.MinecraftServer
import net.minecraft.server.management.ServerConfigurationManager
import net.minecraft.util.RegistryNamespaced
import net.minecraft.util.RegistrySimple
import net.minecraft.util.ObjectIntIdentityMap
import scala.collection.JavaConversions._
import scala.collection.mutable.HashMap
import scala.math

object StructCommand extends ActiveCommand {
  val underlyingIntegerMap = try {
      classOf[RegistryNamespaced].getDeclaredField("field_148759_a")
    } catch {
      case e: java.lang.NoSuchFieldException =>
        classOf[RegistryNamespaced].getDeclaredField("underlyingIntegerMap")
    }
  underlyingIntegerMap.setAccessible(true)

  val blockMap = classOf[ObjectIntIdentityMap].getDeclaredField("field_148749_a")
  blockMap.setAccessible(true)

  val registryObjects = try {
      classOf[RegistrySimple].getDeclaredField("field_82596_a")
    } catch {
      case e: java.lang.NoSuchFieldException =>
        classOf[RegistrySimple].getDeclaredField("registryObjects")
    }
  registryObjects.setAccessible(true)

  class PlayerState {
    var corner1: (Int,Int,Int) = (0,0,0)
    var gotCorner1 = false
    var corner2: (Int,Int,Int) = (0,0,0)
    var gotCorner2 = false

    var lastStruct: Structure = null
  }

  val states = new HashMap[String, PlayerState]

  override def getCommandName() = "struct"
  override def getCommandUsage(sender: ICommandSender) = "uhhh"
  override def getCommandAliases() = List("struct", "structure").asJava

  override def canCommandSenderUseCommand(sender: ICommandSender) = {
    sender match {
      case player: EntityPlayer =>
        // MinecraftServer.getServer.getConfigurationManager.isPlayerOpped(player.getCommandSenderName)
        // TODO WTF? I don't know why the above line won't compile
        player.getCommandSenderName() == "Metreck"
      case _ => false
    }
{'fraction_non_alphanumeric': 0.08871827681808488, 'fraction_numerical': 0.011516314779270634, 'mean_word_length': 4.906801007556675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '3139302', 'n_tokens_mistral': 1403, 'n_tokens_neox': 1372, 'n_words': 256}