Skip to content

Instantly share code, notes, and snippets.

View haniokasai's full-sized avatar
📈
Studying Econometrics

haniokasai haniokasai

📈
Studying Econometrics
View GitHub Profile
@haniokasai
haniokasai / ci.php
Created December 22, 2016 07:54
pocketmine ci
<?php
// import from clearsky/ci-test
$time = time();
$port = rand(1000,60000);
while(system("lsof -i:".$port) != null){
$port = rand(1000,60000);
}
echo "port is ".$port.PHP_EOL;
system("echo \"server-port=".$port."\" > server.properties");
$server = proc_open(PHP_BINARY . " src/pocketmine/PocketMine.php --no-wizard --disable-readline", [
@haniokasai
haniokasai / minet.cs
Last active December 15, 2016 16:08
minetexample
using MiNET.Plugins;
using MiNET.Plugins.Attributes;
using System;
namespace ExamplePlugin
{
[Plugin(PluginName = "ExamplePlugin", Description = "", PluginVersion = "1.0", Author = "haniokasai")]
public class Class1 : Plugin
{
protected override void OnEnable()
@haniokasai
haniokasai / PluginManager.php
Last active October 27, 2016 10:29
PluginManager.php without version check
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
@haniokasai
haniokasai / Main.java
Created February 14, 2016 10:57
nukkit
package my.test.plugin.tutorialplugin;
import cn.nukkit.Player;
import cn.nukkit.block.Block;
import cn.nukkit.command.Command;
import cn.nukkit.command.CommandSender;
import cn.nukkit.event.EventHandler;
import cn.nukkit.event.Listener;
import cn.nukkit.event.player.PlayerInteractEvent;
import cn.nukkit.plugin.PluginBase;
@haniokasai
haniokasai / plugin.yml
Last active February 14, 2016 10:47
nukkit plugin.yml
name: TutorialPlugin
main: my.test.plugin.tutorialplugin.Main
version: 0.0.1
author: haniokasai
api: ["1.0.0"]
commands:
ip:
description: ipcheck
usage: /ip [player]
@haniokasai
haniokasai / pom.xml
Last active February 14, 2016 10:10
//copied from onebone's minecombat nukkit
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>my.test.plugin</groupId>
<artifactId>TutorialPlugin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
@haniokasai
haniokasai / team
Last active October 19, 2015 10:26
チーム分け
pocketmine-mpのプラグインのサンプルコード集です。
ここのソースは肉なり焼くなり好きにしてください。
http://blog.haniokasai.com/2015/10/pocketmine-mp.html
チーム分けのphpのコードです。
このコードはコアがのhpが0になったチームには入らないはずです。
チームの人数も確認できます。
この例では4チームですが、いくらでもふやせます。
参考 
http://blog.g34.co/auto_team_join/
pocketmine-mpのプラグインのサンプルコード集です。
http://blog.haniokasai.com/2015/10/pocketmine-mp.html
ここのソースは肉なり焼くなり好きにしてください。
プレイヤーが殺した時お金をもらう。