diff --git a/PocketMine-MP.php b/PocketMine-MP.php index bdf1cfd11..c47e627fd 100644 --- a/PocketMine-MP.php +++ b/PocketMine-MP.php @@ -19,9 +19,12 @@ * */ - /***REM_START***/ require_once(dirname(__FILE__)."/src/config.php"); + +//Language Support +require_once(FILE_PATH . "/src/lang/en_us.php"); + require_once(FILE_PATH."/src/functions.php"); require_once(FILE_PATH."/src/dependencies.php"); /***REM_END***/ diff --git a/src/API/BanAPI.php b/src/API/BanAPI.php index 88874fafb..290c54833 100644 --- a/src/API/BanAPI.php +++ b/src/API/BanAPI.php @@ -35,13 +35,13 @@ class BanAPI{ $this->bannedIPs = new Config(DATA_PATH."banned-ips.txt", CONFIG_LIST);//Open Banned IPs list file $this->banned = new Config(DATA_PATH."banned.txt", CONFIG_LIST);//Open Banned Usernames list file $this->ops = new Config(DATA_PATH."ops.txt", CONFIG_LIST);//Open list of OPs - $this->server->api->console->register("banip", " [IP|player]", array($this, "commandHandler")); - $this->server->api->console->register("ban", " [username]", array($this, "commandHandler")); - $this->server->api->console->register("kick", " [reason ...]", array($this, "commandHandler")); - $this->server->api->console->register("whitelist", " [username]", array($this, "commandHandler")); - $this->server->api->console->register("op", "", array($this, "commandHandler")); - $this->server->api->console->register("deop", "", array($this, "commandHandler")); - $this->server->api->console->register("sudo", "", array($this, "commandHandler")); + $this->server->api->console->register("banip", CMD_BANIP_DESC, array($this, "commandHandler")); + $this->server->api->console->register("ban", CMD_BAN_DESC, array($this, "commandHandler")); + $this->server->api->console->register("kick", CMD_KICK_DESC, array($this, "commandHandler")); + $this->server->api->console->register("whitelist", CMD_WHITELIST_DESC, array($this, "commandHandler")); + $this->server->api->console->register("op", CMD_OP_DESC, array($this, "commandHandler")); + $this->server->api->console->register("deop", CMD_DEOP_DESC, array($this, "commandHandler")); + $this->server->api->console->register("sudo", CMD_SUDO_DESC, array($this, "commandHandler")); $this->server->api->console->alias("ban-ip", "banip add"); $this->server->api->console->alias("banlist", "ban list"); $this->server->api->console->alias("pardon", "ban remove"); @@ -108,11 +108,11 @@ class BanAPI{ $target = strtolower(array_shift($params)); $player = $this->server->api->player->get($target); if(!($player instanceof Player)){ - $output .= "Player not connected.\n"; + $output .= API_BAN_PLAYER_NOT_CONNECTED . "\n"; break; } $this->server->api->console->run(implode(" ", $params), $player); - $output .= "Command ran as ".$player->username.".\n"; + $output .= str_replace( "{player}", $player->username, API_BAN_CMD_RUN_AS ) . ".\n"; break; case "op": $user = strtolower($params[0]); @@ -120,13 +120,13 @@ class BanAPI{ if(!($player instanceof Player)){ $this->ops->set($user); $this->ops->save($user); - $output .= $user." is now op\n"; + $output .= str_replace( "{player}", $user, API_BAN_NOW_OP) . "\n"; break; } $this->ops->set($player->iusername); $this->ops->save(); - $output .= $player->iusername." is now op\n"; - $this->server->api->chat->sendTo(false, "You are now op.", $player->iusername); + $output .= str_replace( "{player}", $player->iusername, API_BAN_NOW_OP) . "\n"; + $this->server->api->chat->sendTo(false, API_BAN_YOU_NOW_OP, $player->iusername); break; case "deop": $user = strtolower($params[0]); diff --git a/src/language/en_us.php b/src/language/en_us.php new file mode 100644 index 000000000..dbfe5ac66 --- /dev/null +++ b/src/language/en_us.php @@ -0,0 +1,38 @@ + [IP|player]"; +const CMD_BAN_DESC = " [username]"; +const CMD_KICK_DESC = " [reason ...]"; +const CMD_WHITELIST_DESC = " [username]"; +const CMD_OP_DESC = ""; +const CMD_DEOP_DESC = ""; +const CMD_SUDO_DESC = ""; + +//Ban API Language +const API_BAN_PLAYER_NOT_CONNECTED = "Player not connected."; +const API_BAN_CMD_RUN_AS = "Command ran as {player}"; +const API_BAN_NOW_OP = "{player} is now op"; +const API_BAN_YOU_NOW_OP = "you are now op."; +const API_BAN_NOW_DEOP = "{player} is no longer op"; + +?> \ No newline at end of file diff --git a/src/material/block/liquid/Lava.php b/src/material/block/liquid/Lava.php index 5f38b6d36..154f4bcbb 100644 --- a/src/material/block/liquid/Lava.php +++ b/src/material/block/liquid/Lava.php @@ -101,7 +101,6 @@ class LavaBlock extends LiquidBlock{ $down = $this->getSide(0); $from = $this->getFrom(); - //출처가 있거나 이 자체가 출처이면 if($from !== null || $level == 0x00) { if($level !== 0x07) @@ -131,30 +130,14 @@ class LavaBlock extends LiquidBlock{ } else { - //Extend Remove for Left Lavas + //Extend Request for Left Lavas for($side = 2; $side <= 5; ++$side) { $sb = $this->getSide($side); - if($sb instanceof LavaBlock) - { - $tlevel = $sb->meta & 0x07; - if($tlevel != 0x00) - { - $this->level->setBlock($sb, new AirBlock(), false, false, true); - } - } $b = $this->getSide(0)->getSide($side); - if($b instanceof LavaBlock) - { - $tlevel = $b->meta & 0x07; - if($tlevel != 0x00) - { - $this->level->setBlock($b, new AirBlock(), false, false, true); - } - } - //ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL); + ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($sb, 0, 0, $this->level), 40, BLOCK_UPDATE_NORMAL); + ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 40, BLOCK_UPDATE_NORMAL); } - //출처가 제거된 경우 이 블록 제거 $this->level->setBlock($this, new AirBlock(), false, false, true); } return false; diff --git a/src/material/block/liquid/Water.php b/src/material/block/liquid/Water.php index 215978f2b..8aa36470c 100644 --- a/src/material/block/liquid/Water.php +++ b/src/material/block/liquid/Water.php @@ -121,7 +121,7 @@ class WaterBlock extends LiquidBlock{ $b = $this->getSide($side); if($b instanceof WaterBlock) { - if( $this->getSourceCount() >= 2) + if( $this->getSourceCount() >= 2 && $level != 0x00) { $this->level->setBlock($this, new WaterBlock(0), false, false, true); } @@ -141,24 +141,9 @@ class WaterBlock extends LiquidBlock{ for($side = 2; $side <= 5; ++$side) { $sb = $this->getSide($side); - if($sb instanceof WaterBlock) - { - $tlevel = $sb->meta & 0x07; - if($tlevel != 0x00) - { - $this->level->setBlock($sb, new AirBlock(), false, false, true); - } - } $b = $this->getSide(0)->getSide($side); - if($b instanceof WaterBlock) - { - $tlevel = $b->meta & 0x07; - if($tlevel != 0x00) - { - $this->level->setBlock($b, new AirBlock(), false, false, true); - } - } - //ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL); + ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($sb, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL); + ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL); } $this->level->setBlock($this, new AirBlock(), false, false, true); } diff --git a/src/pmf/Level.php b/src/pmf/Level.php index 73091db12..56f035fcc 100644 --- a/src/pmf/Level.php +++ b/src/pmf/Level.php @@ -469,11 +469,14 @@ class PMFLevel extends PMF{ ++$this->chunkChange[$index][$Y]; } $this->chunkChange[$index][-1] = true; - $pos = new Position($x, $y, $z, $this->level); - for($side = 0; $side <= 5; ++$side) + if($old_b instanceof LiquidBlock) { - $b = $pos->getSide($side); - ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL); + $pos = new Position($x, $y, $z, $this->level); + for($side = 0; $side <= 5; ++$side) + { + $b = $pos->getSide($side); + ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL); + } } return true; }