Skip to content

Instantly share code, notes, and snippets.

View mstefarov's full-sized avatar

Matvei Stefarov mstefarov

View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<fCraftAutoRank>
<!-- Each <Criterion> tag is a rule. Either short or fully-qualified rank names can be used.
This example automatically promotes players from builder to veteran rank if
they meet either of the two condition sets. -->
<Criterion fromRank="builder#mTaSFlmnBk1QYVqN" toRank="veteran#yuSfyiJ7AvuE0nc8">
<!-- Tags like <OR>, <AND>, <NOR>, and <NAND> logically combine conditions.
In this example, two alternative sets of conditions are grouped with <AND>.
These groups are then combined by <OR>, which will trigger the promotion
if either of the condition sets is met. -->
// Copyright 2013 Matvei Stefarov <me@matvei.org>
using System;
using JetBrains.Annotations;
using RgbColor = System.Drawing.Color;
namespace fCraft.Drawing {
/// <summary> Represents a palette of Minecraft blocks,
/// that allows matching RGB colors to their closest block equivalents. </summary>
public class BlockPalette {
var op = new SphereDrawOperation(player);
op.Brush = new NormalBrush(new Block[]{ fillBlockHere });
op.Prepare(marksArrayHere);
op.Begin();
public static void DoBan( [NotNull] Player player, string nameOrIP, [NotNull] string reason,
bool banIP, bool banAll, bool unban ) {
if( player == null ) throw new ArgumentNullException( "player" );
if( nameOrIP == null ) {
player.Message( "Please specify player name or IP to ban." );
return;
}
if( reason == null ) throw new ArgumentNullException( "reason" );
// Copyright 2009, 2010, 2011 Matvei Stefarov <me@matvei.org>
using System;
using System.Linq;
using System.Net;
using fCraft.Events;
using JetBrains.Annotations;
namespace fCraft {
// TODO: Move logic to the relevant classes (PlayerInfo and IPBanList), when stable
public static class BanHelper {
@mstefarov
mstefarov / gist:3768570
Created September 23, 2012 02:16 — forked from Jonty800/gist:3768171
4 scootiepie xxxxxxxxxx
#region Emotes
public struct EmoteData //Contains all data needed for the emotes. Emote is the trigger word,
//example (bullet). ID is the byte value of the char
{
public string Emote;
public byte ID;
}
//this list will be loaded with the list of emotes and their replacement values
static List<EmoteData> EmoteTriggers = null;
@mstefarov
mstefarov / test.cs
Created November 15, 2012 23:19 — forked from anonymous/test.cs
Newest Version of the harder one
using System;
namespace ConsoleApplication1 //this is from Deitel Exercises 6.9 – 6.12, 6.19, 6.21, 6.26
{ //To be specific, it's number 6.11
class Program
{
public static void Main( string[] args )
{
Console.WriteLine( "Enter however many integers out of which you would like the smallest divined:" );
int howManyInts = Convert.ToInt32( Console.ReadLine() );
@mstefarov
mstefarov / salarycounter.cs
Created November 30, 2012 04:01 — forked from anonymous/salarycounter.cs
Counts the amount of pay grades in each category.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
const double percentIncrease = 0.09;
@mstefarov
mstefarov / diceroll.cs
Created November 30, 2012 06:14 — forked from anonymous/diceroll.cs
Dicerolling!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DiceRoll
{
class Program
{
static void Main(string[] args)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
namespace ShipGame
{
class MiniBoss : EnemyShip
{