Пример #1
0
 public void addServerTypeToSnooper(PlayerUsageSnooper playerSnooper) {
   playerSnooper.addStatToSnooper("singleplayer", Boolean.valueOf(this.isSinglePlayer()));
   playerSnooper.addStatToSnooper("server_brand", this.getServerModName());
   playerSnooper.addStatToSnooper(
       "gui_supported", GraphicsEnvironment.isHeadless() ? "headless" : "supported");
   playerSnooper.addStatToSnooper("dedicated", Boolean.valueOf(this.isDedicatedServer()));
 }
Пример #2
0
  public void addServerStatsToSnooper(PlayerUsageSnooper playerSnooper) {
    playerSnooper.addClientStat("whitelist_enabled", Boolean.valueOf(false));
    playerSnooper.addClientStat("whitelist_count", Integer.valueOf(0));

    if (this.serverConfigManager != null) {
      playerSnooper.addClientStat("players_current", Integer.valueOf(this.getCurrentPlayerCount()));
      playerSnooper.addClientStat("players_max", Integer.valueOf(this.getMaxPlayers()));
      playerSnooper.addClientStat(
          "players_seen", Integer.valueOf(this.serverConfigManager.getAvailablePlayerDat().length));
    }

    playerSnooper.addClientStat("uses_auth", Boolean.valueOf(this.onlineMode));
    playerSnooper.addClientStat("gui_state", this.getGuiEnabled() ? "enabled" : "disabled");
    playerSnooper.addClientStat(
        "run_time",
        Long.valueOf(
            (getCurrentTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L));
    playerSnooper.addClientStat(
        "avg_tick_ms", Integer.valueOf((int) (MathHelper.average(this.tickTimeArray) * 1.0E-6D)));
    int var2 = 0;

    if (this.worldServers != null) {
      for (int var3 = 0; var3 < this.worldServers.length; ++var3) {
        if (this.worldServers[var3] != null) {
          WorldServer var4 = this.worldServers[var3];
          WorldInfo var5 = var4.getWorldInfo();
          playerSnooper.addClientStat(
              "world[" + var2 + "][dimension]", Integer.valueOf(var4.provider.getDimensionId()));
          playerSnooper.addClientStat("world[" + var2 + "][mode]", var5.getGameType());
          playerSnooper.addClientStat("world[" + var2 + "][difficulty]", var4.getDifficulty());
          playerSnooper.addClientStat(
              "world[" + var2 + "][hardcore]", Boolean.valueOf(var5.isHardcoreModeEnabled()));
          playerSnooper.addClientStat(
              "world[" + var2 + "][generator_name]", var5.getTerrainType().getWorldTypeName());
          playerSnooper.addClientStat(
              "world[" + var2 + "][generator_version]",
              Integer.valueOf(var5.getTerrainType().getGeneratorVersion()));
          playerSnooper.addClientStat(
              "world[" + var2 + "][height]", Integer.valueOf(this.buildLimit));
          playerSnooper.addClientStat(
              "world[" + var2 + "][chunks_loaded]",
              Integer.valueOf(var4.getChunkProvider().getLoadedChunkCount()));
          ++var2;
        }
      }
    }

    playerSnooper.addClientStat("worlds", Integer.valueOf(var2));
  }
Пример #3
0
  @Override
  public boolean onBlockActivated(
      World worldIn,
      BlockPos pos,
      IBlockState state,
      EntityPlayer playerIn,
      EnumFacing side,
      float hitX,
      float hitY,
      float hitZ) {
    if (playerIn.getCurrentEquippedItem() != null) {
      Item item = playerIn.getCurrentEquippedItem().getItem();

      if (item == Items.flint_and_steel || item == Items.fire_charge) {
        this.explode(worldIn, pos, state.withProperty(EXPLODE, Boolean.valueOf(true)), playerIn);
        worldIn.setBlockToAir(pos);

        if (item == Items.flint_and_steel) {
          playerIn.getCurrentEquippedItem().damageItem(1, playerIn);
        } else if (!playerIn.capabilities.isCreativeMode) {
          --playerIn.getCurrentEquippedItem().stackSize;
        }

        return true;
      }
    }

    return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ);
  }
Пример #4
0
 @Override
 public void onNeighborBlockChange(
     World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) {
   if (worldIn.isBlockPowered(pos)) {
     this.onBlockDestroyedByPlayer(
         worldIn, pos, state.withProperty(EXPLODE, Boolean.valueOf(true)));
     worldIn.setBlockToAir(pos);
   }
 }
Пример #5
0
  @Override
  public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) {
    super.onBlockAdded(worldIn, pos, state);

    if (worldIn.isBlockPowered(pos)) {
      this.onBlockDestroyedByPlayer(
          worldIn, pos, state.withProperty(EXPLODE, Boolean.valueOf(true)));
      worldIn.setBlockToAir(pos);
    }
  }
Пример #6
0
  @Override
  public void onEntityCollidedWithBlock(
      World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
    if (!worldIn.isRemote && entityIn instanceof EntityArrow) {
      EntityArrow entityarrow = (EntityArrow) entityIn;

      if (entityarrow.isBurning()) {
        this.explode(
            worldIn,
            pos,
            worldIn.getBlockState(pos).withProperty(EXPLODE, Boolean.valueOf(true)),
            entityarrow.shootingEntity instanceof EntityLivingBase
                ? (EntityLivingBase) entityarrow.shootingEntity
                : null);
        worldIn.setBlockToAir(pos);
      }
    }
  }
Пример #7
0
  public IChatComponent C() {
    ChatComponentText chatcomponenttext = new ChatComponentText(this.q());

    if (this.s()) {
      chatcomponenttext.b().b(Boolean.valueOf(true));
    }

    IChatComponent ichatcomponent = (new ChatComponentText("[")).a(chatcomponenttext).a("]");

    if (this.d != null) {
      NBTTagCompound nbttagcompound = new NBTTagCompound();

      this.b(nbttagcompound);
      ichatcomponent
          .b()
          .a(
              new HoverEvent(
                  HoverEvent.Action.SHOW_ITEM, new ChatComponentText(nbttagcompound.toString())));
      ichatcomponent.b().a(this.u().e);
    }

    return ichatcomponent;
  }
Пример #8
0
 public BlockNuke() {
   super(Material.tnt);
   this.setDefaultState(
       this.blockState.getBaseState().withProperty(EXPLODE, Boolean.valueOf(false)));
   this.setCreativeTab(UReference.things);
 }
Пример #9
0
 @Override
 public IBlockState getStateFromMeta(int meta) {
   return this.getDefaultState().withProperty(EXPLODE, Boolean.valueOf((meta & 1) > 0));
 }