mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
Merge pull request #15 from GameHerobrine/test
enable-explosions option(allows you to turn off tnt explosions)
This commit is contained in:
commit
7b12bc749c
2 changed files with 6 additions and 0 deletions
|
|
@ -74,6 +74,7 @@ class PocketMinecraftServer{
|
|||
console("[INFO] Loading extra.properties...");
|
||||
$this->extraprops = new Config(DATA_PATH . "extra.properties", CONFIG_PROPERTIES, array(
|
||||
"version" => "3",
|
||||
"enable-explosions" => true,
|
||||
"enable-rail-connection" => false,
|
||||
"save-player-data" => true,
|
||||
"save-console-data" => true,
|
||||
|
|
@ -82,6 +83,7 @@ class PocketMinecraftServer{
|
|||
"discord-webhook-url" => "none",
|
||||
"discord-bot-name" => "NostalgiaCore Logger"
|
||||
));
|
||||
Explosion::$enableExplosions = $this->extraprops->get("enable-explosions");
|
||||
RailBlock::$shouldconnectrails = $this->extraprops->get("enable-rail-connection"); //Rail connection in config
|
||||
if($this->extraprops->get("discord-msg") == true){
|
||||
if($this->extraprops->get("discord-webhook-url") !== "none"){
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class Explosion{
|
|||
DIAMOND_ORE => DIAMOND,
|
||||
REDSTONE_ORE => REDSTONE,
|
||||
);
|
||||
public static $enableExplosions = true;
|
||||
private $rays = 16; //Rays
|
||||
public $level;
|
||||
public $source;
|
||||
|
|
@ -64,6 +65,9 @@ class Explosion{
|
|||
return $send;
|
||||
}
|
||||
public function explode(){
|
||||
if(!Explosion::$enableExplosions){ /*Disable Explosions*/
|
||||
return;
|
||||
}
|
||||
$server = ServerAPI::request();
|
||||
if($this->size < 0.1 or $server->api->dhandle("entity.explosion", array(
|
||||
"level" => $this->level,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue