mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
bad eclipse doesnt want to use tabs
This commit is contained in:
parent
3f40c4f9be
commit
cba1879947
11 changed files with 58 additions and 58 deletions
|
|
@ -71,8 +71,8 @@ class PocketMinecraftServer{
|
|||
$this->extraprops = new Config(DATA_PATH . "extra.properties", CONFIG_PROPERTIES, [
|
||||
"version" => "5",
|
||||
"experemental-mob-features" => true,
|
||||
"enable-mob-ai" => false,
|
||||
"enable-nether-reactor" => true,
|
||||
"enable-mob-ai" => false,
|
||||
"enable-nether-reactor" => true,
|
||||
"enable-explosions" => true,
|
||||
"enable-rail-connection" => false,
|
||||
"save-player-data" => true,
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ abstract class Creature extends Living{
|
|||
$this->inPanic = false; //force for now
|
||||
parent::__construct($level, $eid, $class, $type, $data);
|
||||
$this->setHealth(isset($this->data["Health"]) ? $this->data["Health"] : 1, "generic");
|
||||
// $this->setName((isset($mobs[$this->type]) ? $mobs[$this->type]:$this->type));
|
||||
$this->ai->addTask(new TaskLookAround());
|
||||
$this->ai->addTask(new TaskRandomWalk());
|
||||
$this->ai->addTask(new TaskLookAtPlayer());
|
||||
// $this->setName((isset($mobs[$this->type]) ? $mobs[$this->type]:$this->type));
|
||||
$this->ai->addTask(new TaskLookAround());
|
||||
$this->ai->addTask(new TaskRandomWalk());
|
||||
$this->ai->addTask(new TaskLookAtPlayer());
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
<?php
|
||||
|
||||
class EntityList{
|
||||
public function getEntities(){
|
||||
return $this->entities;
|
||||
}
|
||||
public function addEntity(PropertyEntity $property){
|
||||
$this->entities[$property->getEntityType()] = $property;
|
||||
}
|
||||
public function getEntityFromTypeAndClass($type, $class){
|
||||
return isset($this->entities[$type]) && $this->entities[$type]->getEntityClass() === $class ? $this->entities[$type] : 0;
|
||||
}
|
||||
private $entities = [];
|
||||
public function getEntities(){
|
||||
return $this->entities;
|
||||
}
|
||||
public function addEntity(PropertyEntity $property){
|
||||
$this->entities[$property->getEntityType()] = $property;
|
||||
}
|
||||
public function getEntityFromTypeAndClass($type, $class){
|
||||
return isset($this->entities[$type]) && $this->entities[$type]->getEntityClass() === $class ? $this->entities[$type] : 0;
|
||||
}
|
||||
private $entities = [];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
<?php
|
||||
|
||||
class PropertyEntity{
|
||||
private $class,$type,$name;
|
||||
|
||||
function __construct($class, $type, $name){
|
||||
$this->class = $class;
|
||||
$this->type = $type;
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
public function getEntityClass(){
|
||||
return $this->class;
|
||||
}
|
||||
public function getEntityType(){
|
||||
return $this->type;
|
||||
}
|
||||
public function getEntityName(){
|
||||
return $this->name;
|
||||
}
|
||||
private $class,$type,$name;
|
||||
|
||||
function __construct($class, $type, $name){
|
||||
$this->class = $class;
|
||||
$this->type = $type;
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
public function getEntityClass(){
|
||||
return $this->class;
|
||||
}
|
||||
public function getEntityType(){
|
||||
return $this->type;
|
||||
}
|
||||
public function getEntityName(){
|
||||
return $this->name;
|
||||
}
|
||||
}
|
||||
|
|
@ -188,7 +188,7 @@ class NetherReactorBlock extends SolidBlock{
|
|||
foreach($this->core as $yOffset => $layer){
|
||||
foreach($layer as $line){
|
||||
foreach(str_split($line) as $char){
|
||||
$b = $this->level->getBlockWithoutVector(new Vector3($x + $offsetX, $y + $yOffset, $z + $offsetZ));
|
||||
$b = $this->level->getBlockWithoutVector(new Vector3($x + $offsetX, $y + $yOffset, $z + $offsetZ));
|
||||
switch($char){
|
||||
case "G":
|
||||
if($b === GOLD_BLOCK){ //TODO make it use structure class
|
||||
|
|
@ -196,17 +196,17 @@ class NetherReactorBlock extends SolidBlock{
|
|||
}
|
||||
return false;
|
||||
case "C":
|
||||
if($b === COBBLESTONE){
|
||||
if($b === COBBLESTONE){
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
case "R":
|
||||
if($b === NETHER_REACTOR){
|
||||
if($b === NETHER_REACTOR){
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
case " ":
|
||||
if($b->getID() === 0){
|
||||
if($b->getID() === 0){
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ abstract class RakNetDataPacket extends stdClass{
|
|||
public function getBuffer(){
|
||||
return $this->buffer;
|
||||
}
|
||||
|
||||
|
||||
public function getOffset(){
|
||||
return $this->offset;
|
||||
return $this->offset;
|
||||
}
|
||||
|
||||
public function setBuffer($buffer = ""){
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
|
||||
class DummyPlugin implements Plugin{
|
||||
|
||||
public function __construct(ServerAPI $api, $server = false){
|
||||
}
|
||||
|
||||
public function init(){
|
||||
}
|
||||
|
||||
public function __destruct(){
|
||||
}
|
||||
|
||||
public function __construct(ServerAPI $api, $server = false){
|
||||
}
|
||||
|
||||
public function init(){
|
||||
}
|
||||
|
||||
public function __destruct(){
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
interface OtherPluginRequirement{
|
||||
public function getRequiredPlugins();
|
||||
public function getRequiredPlugins();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
interface Plugin{
|
||||
|
||||
public function __construct(ServerAPI $api, $server = false);
|
||||
|
||||
public function init();
|
||||
|
||||
//public function __destruct(); useless
|
||||
|
||||
public function __construct(ServerAPI $api, $server = false);
|
||||
|
||||
public function init();
|
||||
|
||||
//public function __destruct(); useless
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class Utils{
|
|||
}
|
||||
|
||||
public static function endsWith($str, $check) {
|
||||
return substr($str, -strlen($check)) === $check;
|
||||
return substr($str, -strlen($check)) === $check;
|
||||
}
|
||||
|
||||
public static function hasEmoji($s){
|
||||
|
|
@ -638,7 +638,7 @@ class Utils{
|
|||
}
|
||||
|
||||
public static function readInt($str){
|
||||
if(strlen($str) <= 0) return;
|
||||
if(strlen($str) <= 0) return;
|
||||
if(PHP_INT_SIZE === 8){
|
||||
return @unpack("N", $str)[1] << 32 >> 32;
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class SuperflatGenerator implements LevelGenerator{
|
|||
$this->populators[] = new MineshaftPopulator(isset($this->options["mineshaft"]["chance"]) ? floatval($this->options["mineshaft"]["chance"]) : 0.01);
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
public function parsePreset($preset){
|
||||
$this->preset = $preset;
|
||||
$preset = explode(";", $preset);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue