Skip to content

Instantly share code, notes, and snippets.

// Copyright (c) <2013 - 2014> Michael Cummings <michael.cummings.97@outlook.com>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
static void DragonHandler(Player player, Command cmd)
{
string DragonCMD = cmd.Next();
switch (DragonCMD.toLower())
{
case "on":
if (!player.Info.isDragon)
{
//Great dragon is off
//Turns Dragon On until the user turns it off
public static void NewVote()
{
VoteIsOn = true;
}
public static void takeVote()
{
VoteThread = new Thread(new ThreadStart(delegate
{
NewVote();
if ((tempAttr = el.Attribute("prop-hunt")) != null)
{
bool isPropHunt;
if (Boolean.TryParse(tempAttr.Value, out isPropHunt))
{
world.IsPropHunt = isPropHunt;
PropHuntWorlds.Add(world);
}
else
{
// Modifications Copyright (c) <2013 - 2014> Michael Cummings <michael.cummings.97@outlook.com>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// Checks if the seeker tagged a player, after they broke the block form
public static void PlayerMoved(object sender, fCraft.Events.PlayerMovingEventArgs e)
{
if (e.Player.isPropHuntSeeker)
{
Vector3I oldPos = new Vector3I(e.OldPosition.X / 32, e.OldPosition.Y / 32, e.OldPosition.Z / 32); // Get the position of the player
Vector3I newPos = new Vector3I(e.NewPosition.X / 32, e.NewPosition.Y / 32, e.NewPosition.Z / 32);
if (oldPos.X != newPos.X || oldPos.Y != newPos.Y || oldPos.Z != newPos.Z) // Check if the positions are not the same (player moved)
{
java.lang.ArrayIndexOutOfBoundsException: -1
at com.mojang.minecraft.level.Level.netSetTileNoNeighborChange(Level.java:923)
at com.mojang.minecraft.level.Level.netSetTile(Level.java:897)
at com.mojang.minecraft.Minecraft.tick(Minecraft.java:2417)
at com.mojang.minecraft.Minecraft.run(Minecraft.java:815)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at com.mojang.minecraft.Minecraft.tick(Minecraft.java:2615)
at com.mojang.minecraft.Minecraft.run(Minecraft.java:815)
at java.lang.Thread.run(Unknown Source)
string targetName = cmd.Next();
if( targetName == null ) {
//Displays Usage if the Player Does not Properly Write the Command
CdNuke.PrintUsage( player );
return;
}
PlayerInfo target = PlayerDB.FindPlayerInfoOrPrintMatches( player, targetName );
string reason = cmd.NextAll();
foreach (Player p in PropHunt._world.Players)
{
Block[] blockNames = { Block.Stone, Block.Grass, Block.Dirt, Block.Cobblestone, Block.Plank, Block.Bedrock, Block.Sand, Block.Gravel, Block.Log, Block.Sponge, Block.Crate, Block.StoneBrick };
if (map.GetBlock(p.prophuntLastSolidPos) == blockNames)
{
//Remove the players block
Block airBlock = Block.Air;
BlockUpdate blockUpdate = new BlockUpdate(null, this.prophuntLastSolidPos, airBlock);
this.World.Map.QueueUpdate(blockUpdate);
// Modifications Copyright (c) 2013 Michael Cummings <michael.cummings.97@outlook.com>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.