Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add New Entities. (EnderDragon, Guardian, EnderCrystal, Shulker and Wither) #20

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/slapper/Main.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@
use slapper\entities\SlapperCow;
use slapper\entities\SlapperCreeper;
use slapper\entities\SlapperEnderman;
use slapper\entities\SlapperEnderCrystal;
use slapper\entities\SlapperEnderDragon;
use slapper\entities\SlapperEntity;
use slapper\entities\SlapperGhast;
use slapper\entities\SlapperGuardian;
use slapper\entities\SlapperHuman;
use slapper\entities\SlapperIronGolem;
use slapper\entities\SlapperLavaSlime;
Expand All @@ -47,6 +50,7 @@
use slapper\entities\SlapperPig;
use slapper\entities\SlapperPigZombie;
use slapper\entities\SlapperSheep;
use slapper\entities\SlapperShulker;
use slapper\entities\SlapperSilverfish;
use slapper\entities\SlapperSkeleton;
use slapper\entities\SlapperSlime;
Expand All @@ -55,6 +59,7 @@
use slapper\entities\SlapperSquid;
use slapper\entities\SlapperVillager;
use slapper\entities\SlapperWolf;
use slapper\entities\SlapperWither;
use slapper\entities\SlapperZombie;
use slapper\entities\SlapperZombieVillager;
use slapper\entities\SlapperHorse;
Expand Down Expand Up @@ -85,7 +90,8 @@ class Main extends PluginBase implements Listener {
"Horse", "Donkey", "Mule", "SkeletonHorse",
"ZombieHorse", "Witch", "Rabbit", "Stray",
"Husk", "WitherSkeleton", "IronGolem", "Snowman",
"MagmaCube", "Squid"
"MagmaCube", "Squid", "Wither", "Guardian", "EnderCrystal",
"Shulker", "EnderDragon"
];

const ENTITY_ALIASES = [
Expand All @@ -97,6 +103,9 @@ class Main extends PluginBase implements Listener {
"FallingBlock" => "FallingSand",
"FakeBlock" => "FallingSand",
"VillagerGolem" => "IronGolem",
"EnderCrystal" => "Crystal",
"PrimedTNT" => "TNT",
"EnderDragon" => "Dragon",
];

public $hitSessions = [];
Expand Down Expand Up @@ -176,6 +185,11 @@ public function onEnable() {
Entity::registerEntity(SlapperStray::class, true);
Entity::registerEntity(SlapperHusk::class, true);
Entity::registerEntity(SlapperWitherSkeleton::class, true);
Entity::registerEntity(SlapperWither::class, true);
Entity::registerEntity(SlapperShulker::class, true);
Entity::registerEntity(SlapperEnderCrystal::class, true);
Entity::registerEntity(SlapperGuardian::class, true);
Entity::registerEntity(SlapperEnderDragon::class, true);
Entity::registerEntity(SlapperFallingSand::class, true);
$this->getServer()->getPluginManager()->registerEvents($this, $this);
}
Expand Down
10 changes: 10 additions & 0 deletions src/slapper/entities/SlapperEnderCrystal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
namespace slapper\entities;

use slapper\entities\SlapperEntity;

class SlapperEnderCrystal extends SlapperEntity {

public $entityId = 71;

}
10 changes: 10 additions & 0 deletions src/slapper/entities/SlapperEnderDragon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
namespace slapper\entities;

use slapper\entities\SlapperEntity;

class SlapperEnderDragon extends SlapperEntity {

public $entityId = 53;

}
10 changes: 10 additions & 0 deletions src/slapper/entities/SlapperGuardian.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
namespace slapper\entities;

use slapper\entities\SlapperEntity;

class SlapperGuardian extends SlapperEntity {

public $entityId = 49;

}
10 changes: 10 additions & 0 deletions src/slapper/entities/SlapperShulker.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
namespace slapper\entities;

use slapper\entities\SlapperEntity;

class SlapperShulker extends SlapperEntity {

public $entityId = 54;

}
8 changes: 8 additions & 0 deletions src/slapper/entities/SlapperWither.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
namespace slapper\entities;

use slapper\entities\SlapperEntity;

class SlapperWither extends SlapperEntity {
public $entityId = 52;
}