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