Skip to content

Instantly share code, notes, and snippets.

View jasonw4331's full-sized avatar

Jason Wynn jasonw4331

View GitHub Profile
<?php
use pocketmine\plugin\PluginBase;
use pocketmine\Server;
/**
* This class is deliberately meant to be silly
* Class SpoonDetector
*/
class SpoonDetector{
@falkirks
falkirks / SpoonDetector.php
Last active June 17, 2019 21:11
SpoonDetector
<?php
use pocketmine\plugin\PluginBase;
use pocketmine\Server;
/**
* This class is deliberately meant to be silly
* Class SpoonDetector
*/
class SpoonDetector{
<?php
class ReadOnlyFileStreamWrapper{
const SCHEME_RAW = "pmmpreadonly";
const SCHEME = self::SCHEME_RAW . "://";
private $realPointer;
public function stream_open($path, $mode){
assert(substr($path, 0, strlen(self::SCHEME)) === self::SCHEME);
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active June 7, 2024 04:59
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@jasonw4331
jasonw4331 / plugin.yml
Last active September 6, 2018 17:03
Test - Auto-generated gist plugin stub by pmt.mcpe.me InstaPlugin
name: Temp
author: "jasonwynn10"
version: 0.1.0
api:
- 2.1.0
- 3.0.0-ALPHA1
- 3.0.0-ALPHA2
- 3.0.0-ALPHA3
- 3.0.0-ALPHA4
- 3.0.0-ALPHA5
@shoghicp
shoghicp / commands.md
Last active October 29, 2023 18:16
Some interesting commands to play with the new NBT support for items.

Items with custom name

give sho stick 1 {display:{Name:"§r§6§lNormal stick"}}

Items with enchantments

give sho gold_sword 1 {ench:[{id:9s,lvl:2s}]}
@shoghicp
shoghicp / MyPlugin.php
Created May 9, 2015 20:16
Example of new plugin format aimed for easy scripting.
<?php
/**
* This file is an example of a compressed plaintext plugin format for PocketMine
* It's aimed towards easy scripting, but not for normal plugin development.
*
* This kind of plugin won't be able to embed/load resources,
* nor have access to some features like fast permission/command integration.
*
* This first comment is used to define the properties like on plugin.yml,
@discordier
discordier / gist:ed4b9cba14652e7212f5
Created December 4, 2014 06:23
options for phpStorm @noinspection annotation
javascript
ES6ValidationInspection
JSAccessibilityCheckInspection
JSBitwiseOperatorUsageInspection
JSCheckFunctionSignaturesInspection
JSClosureCompilerSyntaxInspection
JSCommentMatchesSignatureInspection
JSComparisonWithNaNInspection
JSConsecutiveCommasInArrayLiteralInspection
@shoghicp
shoghicp / worldFixer.php
Last active July 4, 2018 12:16
This code will: Recreate lost signs, furnaces and chests, and remove invalid or corrupt tile entities from a world.
<?php
$world = $this->getServer()->getDefaultLevel();
$radius = 80;
$total = (($radius * 2) + 1) ** 2;
$count = 0;
for($chunkX = -$radius; $chunkX <= $radius; ++$chunkX){
for($chunkZ = -$radius; $chunkZ <= $radius; ++$chunkZ){
$chunk = $world->getChunk($chunkX, $chunkZ, false);
if($chunk instanceof \pocketmine\level\format\FullChunk and $chunk->isPopulated()){
$tiles = [];
@MinecrafterJPN
MinecrafterJPN / BlockItemList.md
Last active February 1, 2019 12:47
Minecraft PE Block / Item List

Block List

ID => BlockName

		0 => "Air"
		1 => "Stone"
		2 => "Grass"
		3 => "Dirt"
		4 => "Cobblestone"

5 => "WoodenPlank"