Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I_IS_PAYTON STOLE Junyi00's CODE

Comments in 'Plugin Development' started by Legomite, Mar 18, 2014.

?

dO YOU AGREE?

  1. YES

    2 vote(s)
    40.0%
  2. NO

    3 vote(s)
    60.0%
  1. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    POCKETCAL is actually a copy of Juny's code "Calculator.
    Need proof?
    Juny's plugin
    https://raw.github.com/junyi00/Calculator/master/Calculator.php
    The copied plugin is a modified version.


    This was the original code present in the first version of pocketcalc.
    IN HER PLUGIN IT DIDN'T MENTION ANYTHING ABOUT GETTING JUNYI00 CODE.


    Payton's Plugin

    <?php

    /*
    __PocketMine Plugin__
    name=PocketCalc
    description=Does math. (Just basic like + - / and *)
    version=0.0.1
    author=I_Is_Payton_
    class=Math
    apiversion=10,11,12,13,14,15,16,17,18,19,20
    */


    class Math implements Plugin{
    private $api, $path, $config;
    public function __construct(ServerAPI $api, $server = false){
    $this->api = $api;
    }

    public function init(){
    $this->api->console->register("calc", "does your math homework! xD", array($this, "Calculator"));
    }

    public function __destruct(){}

    public function Calculator($cmd, $arg, $issuer) {

    switch($cmd) {

    case "calc":

    $firstValue = $arg[0];
    $operator = $arg[1];
    $secondValue = $arg[2];

    if (empty($arg[0]) || empty($arg[1]) || empty($arg[2])) {
    if (($issuer instanceof Player)) {
    $output = "[Calc] Usage: /calc <number one> <operation> <number two>";
    return $output;
    }
    else{
    $this->api->chat->sendTo(false, "[Calc] Usage: /calc <number one> <operation> <number two>", $issuer);
    break;
    }
    }

    elseif(!is_numeric($firstValue) || !is_numeric($secondValue)) {
    if (($issuer instanceof Player)) {
    $this->api->chat->sendTo(false, "[Calculator] Usage: /calc <number one> <operation> <number two>", $issuer->username);
    break;
    }
    else{
    console("[Calc] Usage: /calc <number one> <operation> <number two>");
    break;
    }

    }
    else {

    switch($operator) {

    case "+":
    $result = $firstValue + $secondValue;
    if (($issuer instanceof Player)) {
    $issuer->sendChat("The result is: $result");
    break;
    }
    else {
    console("The result is: $result");
    break;
    } //done with +
    break;

    case "-":
    $result = $firstValue - $secondValue;
    if (($issuer instanceof Player)) {
    $issuer->sendChat("The result is: $result");
    break;
    }
    else {
    console("The result is: $result");
    break;
    } //done with -

    case "*":
    $result = $firstValue * $secondValue;
    if (($issuer instanceof Player)) {
    $issuer->sendChat("The result is: $result");
    break;
    }
    else {
    console("The result is: $result");
    break;
    } //done with *

    case "/":
    $result = $firstValue / $secondValue;
    if (($issuer instanceof Player)) {
    $issuer->sendChat("The result is: $result");
    break;
    }
    else {
    console("The result is: $result");
    break;
    } //done with /

    default:
    if (($issuer instanceof Player)) {
    $this->api->chat->sendTo(false, "[Calc] Usage: /calc <number one> <operation> <number two>", $issuer->username);
    break;
    }
    else{
    console("[Calc] Usage: /calc <number one> <operation> <number two>");
    break;
    }
    }

    }

    }

    }

    }

    ?>
  2. IRON
    Offline

    IRON Ban Evader

    Joined:
    Mar 17, 2014
    Posts:
    7
    Minecraft User:
    DimondHunter
    she is!
  3. Jail222222
    Offline

    Jail222222 New Member

    Joined:
    Mar 25, 2014
    Posts:
    1
    Minecraft User:
    Cake_Slayer
    With a plugin like this, The code is going to look simular. Plus look at the functions included in both.
  4. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    Explain the comments and the organization of it then.
  5. KnownUnown
    Offline

    KnownUnown Active Member Plugin Developer

    Joined:
    Aug 22, 2013
    Posts:
    65
    Plugins:
    1
    Minecraft User:
    KnownUnown
    Hmm, I agree with @Legomite, sort of. It SORT of looks similar.
  6. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    Look at the comments tag. //

Share This Page

Advertisement