mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-24 05:29:44 +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, [
|
$this->extraprops = new Config(DATA_PATH . "extra.properties", CONFIG_PROPERTIES, [
|
||||||
"version" => "5",
|
"version" => "5",
|
||||||
"experemental-mob-features" => true,
|
"experemental-mob-features" => true,
|
||||||
"enable-mob-ai" => false,
|
"enable-mob-ai" => false,
|
||||||
"enable-nether-reactor" => true,
|
"enable-nether-reactor" => true,
|
||||||
"enable-explosions" => true,
|
"enable-explosions" => true,
|
||||||
"enable-rail-connection" => false,
|
"enable-rail-connection" => false,
|
||||||
"save-player-data" => true,
|
"save-player-data" => true,
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,10 @@ abstract class Creature extends Living{
|
||||||
$this->inPanic = false; //force for now
|
$this->inPanic = false; //force for now
|
||||||
parent::__construct($level, $eid, $class, $type, $data);
|
parent::__construct($level, $eid, $class, $type, $data);
|
||||||
$this->setHealth(isset($this->data["Health"]) ? $this->data["Health"] : 1, "generic");
|
$this->setHealth(isset($this->data["Health"]) ? $this->data["Health"] : 1, "generic");
|
||||||
// $this->setName((isset($mobs[$this->type]) ? $mobs[$this->type]:$this->type));
|
// $this->setName((isset($mobs[$this->type]) ? $mobs[$this->type]:$this->type));
|
||||||
$this->ai->addTask(new TaskLookAround());
|
$this->ai->addTask(new TaskLookAround());
|
||||||
$this->ai->addTask(new TaskRandomWalk());
|
$this->ai->addTask(new TaskRandomWalk());
|
||||||
$this->ai->addTask(new TaskLookAtPlayer());
|
$this->ai->addTask(new TaskLookAtPlayer());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class EntityList{
|
class EntityList{
|
||||||
public function getEntities(){
|
public function getEntities(){
|
||||||
return $this->entities;
|
return $this->entities;
|
||||||
}
|
}
|
||||||
public function addEntity(PropertyEntity $property){
|
public function addEntity(PropertyEntity $property){
|
||||||
$this->entities[$property->getEntityType()] = $property;
|
$this->entities[$property->getEntityType()] = $property;
|
||||||
}
|
}
|
||||||
public function getEntityFromTypeAndClass($type, $class){
|
public function getEntityFromTypeAndClass($type, $class){
|
||||||
return isset($this->entities[$type]) && $this->entities[$type]->getEntityClass() === $class ? $this->entities[$type] : 0;
|
return isset($this->entities[$type]) && $this->entities[$type]->getEntityClass() === $class ? $this->entities[$type] : 0;
|
||||||
}
|
}
|
||||||
private $entities = [];
|
private $entities = [];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,21 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class PropertyEntity{
|
class PropertyEntity{
|
||||||
private $class,$type,$name;
|
private $class,$type,$name;
|
||||||
|
|
||||||
function __construct($class, $type, $name){
|
function __construct($class, $type, $name){
|
||||||
$this->class = $class;
|
$this->class = $class;
|
||||||
$this->type = $type;
|
$this->type = $type;
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEntityClass(){
|
public function getEntityClass(){
|
||||||
return $this->class;
|
return $this->class;
|
||||||
}
|
}
|
||||||
public function getEntityType(){
|
public function getEntityType(){
|
||||||
return $this->type;
|
return $this->type;
|
||||||
}
|
}
|
||||||
public function getEntityName(){
|
public function getEntityName(){
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -188,7 +188,7 @@ class NetherReactorBlock extends SolidBlock{
|
||||||
foreach($this->core as $yOffset => $layer){
|
foreach($this->core as $yOffset => $layer){
|
||||||
foreach($layer as $line){
|
foreach($layer as $line){
|
||||||
foreach(str_split($line) as $char){
|
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){
|
switch($char){
|
||||||
case "G":
|
case "G":
|
||||||
if($b === GOLD_BLOCK){ //TODO make it use structure class
|
if($b === GOLD_BLOCK){ //TODO make it use structure class
|
||||||
|
|
@ -196,17 +196,17 @@ class NetherReactorBlock extends SolidBlock{
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case "C":
|
case "C":
|
||||||
if($b === COBBLESTONE){
|
if($b === COBBLESTONE){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case "R":
|
case "R":
|
||||||
if($b === NETHER_REACTOR){
|
if($b === NETHER_REACTOR){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case " ":
|
case " ":
|
||||||
if($b->getID() === 0){
|
if($b->getID() === 0){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ abstract class RakNetDataPacket extends stdClass{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOffset(){
|
public function getOffset(){
|
||||||
return $this->offset;
|
return $this->offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setBuffer($buffer = ""){
|
public function setBuffer($buffer = ""){
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@
|
||||||
|
|
||||||
class DummyPlugin implements Plugin{
|
class DummyPlugin implements Plugin{
|
||||||
|
|
||||||
public function __construct(ServerAPI $api, $server = false){
|
public function __construct(ServerAPI $api, $server = false){
|
||||||
}
|
}
|
||||||
|
|
||||||
public function init(){
|
public function init(){
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __destruct(){
|
public function __destruct(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
interface OtherPluginRequirement{
|
interface OtherPluginRequirement{
|
||||||
public function getRequiredPlugins();
|
public function getRequiredPlugins();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
interface Plugin{
|
interface Plugin{
|
||||||
|
|
||||||
public function __construct(ServerAPI $api, $server = false);
|
public function __construct(ServerAPI $api, $server = false);
|
||||||
|
|
||||||
public function init();
|
public function init();
|
||||||
|
|
||||||
//public function __destruct(); useless
|
//public function __destruct(); useless
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ class Utils{
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function endsWith($str, $check) {
|
public static function endsWith($str, $check) {
|
||||||
return substr($str, -strlen($check)) === $check;
|
return substr($str, -strlen($check)) === $check;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function hasEmoji($s){
|
public static function hasEmoji($s){
|
||||||
|
|
@ -638,7 +638,7 @@ class Utils{
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function readInt($str){
|
public static function readInt($str){
|
||||||
if(strlen($str) <= 0) return;
|
if(strlen($str) <= 0) return;
|
||||||
if(PHP_INT_SIZE === 8){
|
if(PHP_INT_SIZE === 8){
|
||||||
return @unpack("N", $str)[1] << 32 >> 32;
|
return @unpack("N", $str)[1] << 32 >> 32;
|
||||||
}else{
|
}else{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue