These rules are based on #mcdevs rules. They are pretty straightforward and for the most part are just common etiquette.
You want to override the tell
command, that has also the w
and msg
aliases by default.
The class that will override these commands is MyTellCommand (extends PluginCommand).
To do this, you've to set the original command in a state that allows it to be overriden. Also, aliases will be registered directly, but since all the work was done for the first registration, it's pretty simple.
//We are in the context of a plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$world = $this->getServer()->getDefaultLevel(); | |
$radius = 136; | |
$total = (($radius * 2) + 1) ** 2; | |
$count = 0; | |
$bList = clone \pocketmine\block\Block::$list; | |
$search = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# v2 pbzx stream handler | |
# My personal writeup on the differences here: https://gist.github.com/pudquick/29fcfe09c326a9b96cf5 | |
# | |
# Pure python reimplementation of .cpio.xz content extraction from pbzx file payload originally here: | |
# http://www.tonymacx86.com/general-help/135458-pbzx-stream-parser.html | |
# | |
# Cleaned up C version (as the basis for my code) here, thanks to Pepijn Bruienne / @bruienne | |
# https://gist.github.com/bruienne/029494bbcfb358098b41 | |
import struct, sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace shoghicp\MinecraftSimulator\task; | |
use pocketmine\Player; | |
use pocketmine\scheduler\PluginTask; | |
use shoghicp\MinecraftSimulator\Loader; | |
class MarqueeTask extends PluginTask{ |
Because pointers can be ugh
To understand a pointer, let's review "regular" variables first. If you're familiar with a programming language without pointers like JavaScript, this is what you think when you hear "variable".
When declaring a variable by identifier (or name), the variable is synonymous with its value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param number $x the X coordinate of the center of the circle | |
* @param number $y the Y coordinate to place particles at | |
* @param number $z the Z coordinate of the center of the circle | |
* @param number $radius the distance for each dot from the center | |
* @param number $step the angle per step, in degrees | |
* @param callable $callback the function to call for each dot, with parameters $x, $y, $z representing the coordinates of the dot | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USER="root" | |
PASSWORD="" | |
FILES="/Users/tenold/Backups/MySQL/*" | |
for f in $FILES | |
do | |
echo "Processing $f file..." |
OlderNewer