diff --git a/src/pocketmine/entity/Living.php b/src/pocketmine/entity/Living.php index 79e4cfabc..b0468f000 100644 --- a/src/pocketmine/entity/Living.php +++ b/src/pocketmine/entity/Living.php @@ -557,13 +557,6 @@ abstract class Living extends Entity implements Damageable{ } if($e !== null){ - if(( - $source->getCause() === EntityDamageEvent::CAUSE_PROJECTILE or - $source->getCause() === EntityDamageEvent::CAUSE_ENTITY_ATTACK - ) and $e->isOnFire()){ - $this->setOnFire(2 * $this->level->getDifficulty()); - } - $deltaX = $this->x - $e->x; $deltaZ = $this->z - $e->z; $this->knockBack($e, $source->getBaseDamage(), $deltaX, $deltaZ, $source->getKnockBack()); diff --git a/src/pocketmine/item/Bow.php b/src/pocketmine/item/Bow.php index c904afb5e..a8074f893 100644 --- a/src/pocketmine/item/Bow.php +++ b/src/pocketmine/item/Bow.php @@ -59,7 +59,6 @@ class Bow extends Tool{ ($player->yaw > 180 ? 360 : 0) - $player->yaw, -$player->pitch ); - $nbt->setShort("Fire", $player->isOnFire() ? 45 * 60 : 0); $diff = $player->getItemUseDuration(); $p = $diff / 20; diff --git a/src/pocketmine/plugin/PluginBase.php b/src/pocketmine/plugin/PluginBase.php index aa98afd77..a15a7db9b 100644 --- a/src/pocketmine/plugin/PluginBase.php +++ b/src/pocketmine/plugin/PluginBase.php @@ -79,8 +79,8 @@ abstract class PluginBase implements Plugin{ $this->loader = $loader; $this->server = $server; $this->description = $description; - $this->dataFolder = rtrim($dataFolder, "\\/") . "/"; - $this->file = rtrim($file, "\\/") . "/"; + $this->dataFolder = rtrim($dataFolder, "/" . DIRECTORY_SEPARATOR) . "/"; + $this->file = rtrim($file, "/" . DIRECTORY_SEPARATOR) . "/"; $this->configFile = $this->dataFolder . "config.yml"; $this->logger = new PluginLogger($this); $this->scheduler = new TaskScheduler($this->logger, $this->getFullName()); @@ -170,7 +170,7 @@ abstract class PluginBase implements Plugin{ * @return null|resource Resource data, or null */ public function getResource(string $filename){ - $filename = rtrim(str_replace("\\", "/", $filename), "/"); + $filename = rtrim(str_replace(DIRECTORY_SEPARATOR, "/", $filename), "/"); if(file_exists($this->file . "resources/" . $filename)){ $resource = fopen($this->file . "resources/" . $filename, "rb"); if($resource === false) throw new AssumptionFailedError("fopen() should not fail on a file which exists"); diff --git a/src/pocketmine/utils/Utils.php b/src/pocketmine/utils/Utils.php index 533e49be7..6312d56ce 100644 --- a/src/pocketmine/utils/Utils.php +++ b/src/pocketmine/utils/Utils.php @@ -86,6 +86,7 @@ use function sys_get_temp_dir; use function trim; use function unlink; use function xdebug_get_function_stack; +use const DIRECTORY_SEPARATOR; use const PHP_EOL; use const PHP_INT_MAX; use const PHP_INT_SIZE; @@ -591,7 +592,7 @@ class Utils{ * @return string */ public static function cleanPath($path){ - $result = str_replace(["\\", ".php", "phar://"], ["/", "", ""], $path); + $result = str_replace([DIRECTORY_SEPARATOR, ".php", "phar://"], ["/", "", ""], $path); //remove relative paths //TODO: make these paths dynamic so they can be unit-tested against @@ -600,7 +601,7 @@ class Utils{ \pocketmine\PATH => "" ]; foreach($cleanPaths as $cleanPath => $replacement){ - $cleanPath = rtrim(str_replace(["\\", "phar://"], ["/", ""], $cleanPath), "/"); + $cleanPath = rtrim(str_replace([DIRECTORY_SEPARATOR, "phar://"], ["/", ""], $cleanPath), "/"); if(strpos($result, $cleanPath) === 0){ $result = ltrim(str_replace($cleanPath, $replacement, $result), "/"); }