Use EntityTypes for living entities (#1533)

Dieser Commit ist enthalten in:
BillyGalbreath 2018-10-24 15:26:00 -05:00 committet von Zach
Ursprung c6f7877de6
Commit db9e33489b

Datei anzeigen

@ -0,0 +1,919 @@
From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Thu, 4 Oct 2018 10:08:02 -0500
Subject: [PATCH] Use EntityTypes for living entities
diff --git a/src/main/java/net/minecraft/server/BlockMonsterEggs.java b/src/main/java/net/minecraft/server/BlockMonsterEggs.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/BlockMonsterEggs.java
+++ b/src/main/java/net/minecraft/server/BlockMonsterEggs.java
@@ -35,7 +35,7 @@ public class BlockMonsterEggs extends Block {
public void dropNaturally(IBlockData iblockdata, World world, BlockPosition blockposition, float f, int i) {
if (!world.isClientSide && world.getGameRules().getBoolean("doTileDrops")) {
- EntitySilverfish entitysilverfish = new EntitySilverfish(world);
+ EntitySilverfish entitysilverfish = EntityTypes.SILVERFISH.create(world); // Paper
entitysilverfish.setPositionRotation((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, 0.0F, 0.0F);
world.addEntity(entitysilverfish, SpawnReason.SILVERFISH_BLOCK); // CraftBukkit - add SpawnReason
diff --git a/src/main/java/net/minecraft/server/BlockPumpkinCarved.java b/src/main/java/net/minecraft/server/BlockPumpkinCarved.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/BlockPumpkinCarved.java
+++ b/src/main/java/net/minecraft/server/BlockPumpkinCarved.java
@@ -52,7 +52,7 @@ public class BlockPumpkinCarved extends BlockFacingHorizontal {
blockList.setTypeAndData(shapedetectorblock1.getPosition(), Blocks.AIR.getBlockData(), 2); // CraftBukkit
}
- EntitySnowman entitysnowman = new EntitySnowman(world);
+ EntitySnowman entitysnowman = EntityTypes.SNOW_GOLEM.create(world); // Paper
BlockPosition blockposition1 = shapedetector_shapedetectorcollection.a(0, 2, 0).getPosition();
entitysnowman.setPositionRotation((double) blockposition1.getX() + 0.5D, (double) blockposition1.getY() + 0.05D, (double) blockposition1.getZ() + 0.5D, 0.0F, 0.0F);
@@ -87,7 +87,7 @@ public class BlockPumpkinCarved extends BlockFacingHorizontal {
}
BlockPosition blockposition2 = shapedetector_shapedetectorcollection.a(1, 2, 0).getPosition();
- EntityIronGolem entityirongolem = new EntityIronGolem(world);
+ EntityIronGolem entityirongolem = EntityTypes.IRON_GOLEM.create(world); // Paper
entityirongolem.setPlayerCreated(true);
entityirongolem.setPositionRotation((double) blockposition2.getX() + 0.5D, (double) blockposition2.getY() + 0.05D, (double) blockposition2.getZ() + 0.5D, 0.0F, 0.0F);
diff --git a/src/main/java/net/minecraft/server/BlockTurtleEgg.java b/src/main/java/net/minecraft/server/BlockTurtleEgg.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/BlockTurtleEgg.java
+++ b/src/main/java/net/minecraft/server/BlockTurtleEgg.java
@@ -84,7 +84,7 @@ public class BlockTurtleEgg extends Block {
if (!world.isClientSide) {
for (int j = 0; j < ((Integer) iblockdata.get(BlockTurtleEgg.b)).intValue(); ++j) {
world.triggerEffect(2001, blockposition, Block.getCombinedId(iblockdata));
- EntityTurtle entityturtle = new EntityTurtle(world);
+ EntityTurtle entityturtle = EntityTypes.TURTLE.create(world); // Paper
entityturtle.setAgeRaw(-24000);
entityturtle.g(blockposition);
diff --git a/src/main/java/net/minecraft/server/BlockWitherSkull.java b/src/main/java/net/minecraft/server/BlockWitherSkull.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/BlockWitherSkull.java
+++ b/src/main/java/net/minecraft/server/BlockWitherSkull.java
@@ -52,7 +52,7 @@ public class BlockWitherSkull extends BlockSkull {
}
BlockPosition blockposition1 = shapedetector_shapedetectorcollection.a(1, 0, 0).getPosition();
- EntityWither entitywither = new EntityWither(world);
+ EntityWither entitywither = EntityTypes.WITHER.create(world); // Paper
BlockPosition blockposition2 = shapedetector_shapedetectorcollection.a(1, 2, 0).getPosition();
entitywither.setPositionRotation((double) blockposition2.getX() + 0.5D, (double) blockposition2.getY() + 0.55D, (double) blockposition2.getZ() + 0.5D, shapedetector_shapedetectorcollection.getFacing().k() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F, 0.0F);
diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EnderDragonBattle.java
+++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java
@@ -361,7 +361,7 @@ public class EnderDragonBattle {
private EntityEnderDragon n() {
this.d.getChunkAtWorldCoords(new BlockPosition(0, 128, 0));
- EntityEnderDragon entityenderdragon = new EntityEnderDragon(this.d);
+ EntityEnderDragon entityenderdragon = EntityTypes.ENDER_DRAGON.create(this.d); // Paper
entityenderdragon.getDragonControllerManager().setControllerPhase(DragonControllerPhase.a);
entityenderdragon.setPositionRotation(0.0D, 128.0D, 0.0D, this.d.random.nextFloat() * 360.0F, 0.0F);
this.d.addEntity(entityenderdragon);
diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityChicken.java
+++ b/src/main/java/net/minecraft/server/EntityChicken.java
@@ -96,7 +96,7 @@ public class EntityChicken extends EntityAnimal {
}
public EntityChicken b(EntityAgeable entityageable) {
- return new EntityChicken(this.world);
+ return EntityTypes.CHICKEN.create(world); // Paper
}
public boolean f(ItemStack itemstack) {
diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityCow.java
+++ b/src/main/java/net/minecraft/server/EntityCow.java
@@ -88,7 +88,7 @@ public class EntityCow extends EntityAnimal {
}
public EntityCow b(EntityAgeable entityageable) {
- return new EntityCow(this.world);
+ return EntityTypes.COW.create(world); // Paper
}
public float getHeadHeight() {
diff --git a/src/main/java/net/minecraft/server/EntityEnderPearl.java b/src/main/java/net/minecraft/server/EntityEnderPearl.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityEnderPearl.java
+++ b/src/main/java/net/minecraft/server/EntityEnderPearl.java
@@ -74,7 +74,7 @@ public class EntityEnderPearl extends EntityProjectile {
if (!teleEvent.isCancelled() && !entityplayer.playerConnection.isDisconnected()) {
if (this.random.nextFloat() < 0.05F && this.world.getGameRules().getBoolean("doMobSpawning")) {
- EntityEndermite entityendermite = new EntityEndermite(this.world);
+ EntityEndermite entityendermite = EntityTypes.ENDERMITE.create(world); // Paper
entityendermite.a(true);
entityendermite.setPositionRotation(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch);
diff --git a/src/main/java/net/minecraft/server/EntityEvoker.java b/src/main/java/net/minecraft/server/EntityEvoker.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityEvoker.java
+++ b/src/main/java/net/minecraft/server/EntityEvoker.java
@@ -221,7 +221,7 @@ public class EntityEvoker extends EntityIllagerWizard {
protected void j() {
for(int i = 0; i < 3; ++i) {
BlockPosition blockposition = (new BlockPosition(EntityEvoker.this)).a(-2 + EntityEvoker.this.random.nextInt(5), 1, -2 + EntityEvoker.this.random.nextInt(5));
- EntityVex entityvex = new EntityVex(EntityEvoker.this.world);
+ EntityVex entityvex = EntityTypes.VEX.create(EntityEvoker.this.world); // Paper
entityvex.setPositionRotation(blockposition, 0.0F, 0.0F);
entityvex.prepare(EntityEvoker.this.world.getDamageScaler(blockposition), (GroupDataEntity)null, (NBTTagCompound)null);
entityvex.a(EntityEvoker.this);
diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityHorse.java
+++ b/src/main/java/net/minecraft/server/EntityHorse.java
@@ -205,10 +205,10 @@ public class EntityHorse extends EntityHorseAbstract {
public EntityAgeable createChild(EntityAgeable entityageable) {
Object object;
if (entityageable instanceof EntityHorseDonkey) {
- object = new EntityHorseMule(this.world);
+ object = EntityTypes.MULE.create(world); // Paper
} else {
EntityHorse entityhorse1 = (EntityHorse)entityageable;
- object = new EntityHorse(this.world);
+ object = EntityTypes.HORSE.create(world); // Paper
int j = this.random.nextInt(9);
int i;
if (j < 4) {
diff --git a/src/main/java/net/minecraft/server/EntityHorseDonkey.java b/src/main/java/net/minecraft/server/EntityHorseDonkey.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityHorseDonkey.java
+++ b/src/main/java/net/minecraft/server/EntityHorseDonkey.java
@@ -38,7 +38,7 @@ public class EntityHorseDonkey extends EntityHorseChestedAbstract {
}
public EntityAgeable createChild(EntityAgeable entityageable) {
- Object object = entityageable instanceof EntityHorse ? new EntityHorseMule(this.world) : new EntityHorseDonkey(this.world);
+ Object object = entityageable instanceof EntityHorse ? EntityTypes.MULE.create(world) : EntityTypes.DONKEY.create(world); // Paper
this.a(entityageable, (EntityHorseAbstract)object);
return (EntityAgeable)object;
}
diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
+++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
@@ -134,7 +134,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract {
@Nullable
public EntityAgeable createChild(EntityAgeable var1) {
- return new EntityHorseSkeleton(this.world);
+ return EntityTypes.SKELETON_HORSE.create(world); // Paper
}
public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
diff --git a/src/main/java/net/minecraft/server/EntityHorseZombie.java b/src/main/java/net/minecraft/server/EntityHorseZombie.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityHorseZombie.java
+++ b/src/main/java/net/minecraft/server/EntityHorseZombie.java
@@ -40,7 +40,7 @@ public class EntityHorseZombie extends EntityHorseAbstract {
@Nullable
public EntityAgeable createChild(EntityAgeable var1) {
- return new EntityHorseZombie(this.world);
+ return EntityTypes.ZOMBIE_HORSE.create(world); // Paper
}
public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityLlama.java
+++ b/src/main/java/net/minecraft/server/EntityLlama.java
@@ -272,7 +272,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
}
public EntityLlama b(EntityAgeable entityageable) {
- EntityLlama entityllama1 = new EntityLlama(this.world);
+ EntityLlama entityllama1 = EntityTypes.LLAMA.create(world); // Paper
this.a(entityageable, entityllama1);
EntityLlama entityllama2 = (EntityLlama)entityageable;
int i = this.random.nextInt(Math.max(this.getStrength(), entityllama2.getStrength())) + 1;
diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityMushroomCow.java
+++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java
@@ -35,7 +35,7 @@ public class EntityMushroomCow extends EntityCow {
this.world.addParticle(Particles.u, this.locX, this.locY + (double) (this.length / 2.0F), this.locZ, 0.0D, 0.0D, 0.0D);
if (!this.world.isClientSide) {
this.die();
- EntityCow entitycow = new EntityCow(this.world);
+ EntityCow entitycow = EntityTypes.COW.create(world); // Paper
entitycow.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
entitycow.setHealth(this.getHealth());
@@ -61,7 +61,7 @@ public class EntityMushroomCow extends EntityCow {
}
public EntityMushroomCow c(EntityAgeable entityageable) {
- return new EntityMushroomCow(this.world);
+ return EntityTypes.MOOSHROOM.create(world); // Paper
}
@Nullable
diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityOcelot.java
+++ b/src/main/java/net/minecraft/server/EntityOcelot.java
@@ -154,7 +154,7 @@ public class EntityOcelot extends EntityTameableAnimal {
}
public EntityOcelot b(EntityAgeable entityageable) {
- EntityOcelot entityocelot = new EntityOcelot(this.world);
+ EntityOcelot entityocelot = EntityTypes.OCELOT.create(world); // Paper
if (this.isTamed()) {
entityocelot.setOwnerUUID(this.getOwnerUUID());
@@ -237,7 +237,7 @@ public class EntityOcelot extends EntityTameableAnimal {
groupdataentity = super.prepare(difficultydamagescaler, groupdataentity, nbttagcompound);
if (spawnBonus && this.getCatType() == 0 && this.world.random.nextInt(7) == 0) { // Spigot
for (int i = 0; i < 2; ++i) {
- EntityOcelot entityocelot = new EntityOcelot(this.world);
+ EntityOcelot entityocelot = EntityTypes.OCELOT.create(world); // Paper
entityocelot.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F);
entityocelot.setAgeRaw(-24000);
diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityPig.java
+++ b/src/main/java/net/minecraft/server/EntityPig.java
@@ -150,7 +150,7 @@ public class EntityPig extends EntityAnimal {
public void onLightningStrike(EntityLightning entitylightning) {
if (!this.world.isClientSide && !this.dead) {
- EntityPigZombie entitypigzombie = new EntityPigZombie(this.world);
+ EntityPigZombie entitypigzombie = EntityTypes.ZOMBIE_PIGMAN.create(world); // Paper
// Paper start
if (CraftEventFactory.callEntityZapEvent(this, entitylightning, entitypigzombie).isCancelled()) {
@@ -240,7 +240,7 @@ public class EntityPig extends EntityAnimal {
}
public EntityPig b(EntityAgeable entityageable) {
- return new EntityPig(this.world);
+ return EntityTypes.PIG.create(world); // Paper
}
public boolean f(ItemStack itemstack) {
diff --git a/src/main/java/net/minecraft/server/EntityPolarBear.java b/src/main/java/net/minecraft/server/EntityPolarBear.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityPolarBear.java
+++ b/src/main/java/net/minecraft/server/EntityPolarBear.java
@@ -15,7 +15,7 @@ public class EntityPolarBear extends EntityAnimal {
}
public EntityAgeable createChild(EntityAgeable var1) {
- return new EntityPolarBear(this.world);
+ return EntityTypes.POLAR_BEAR.create(world); // Paper
}
public boolean f(ItemStack var1) {
diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityRabbit.java
+++ b/src/main/java/net/minecraft/server/EntityRabbit.java
@@ -251,7 +251,7 @@ public class EntityRabbit extends EntityAnimal {
}
public EntityRabbit b(EntityAgeable entityageable) {
- EntityRabbit entityrabbit = new EntityRabbit(this.world);
+ EntityRabbit entityrabbit = EntityTypes.RABBIT.create(world); // Paper
int i = this.dJ();
if (this.random.nextInt(20) != 0) {
diff --git a/src/main/java/net/minecraft/server/EntitySheep.java b/src/main/java/net/minecraft/server/EntitySheep.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntitySheep.java
+++ b/src/main/java/net/minecraft/server/EntitySheep.java
@@ -264,7 +264,7 @@ public class EntitySheep extends EntityAnimal {
public EntitySheep b(EntityAgeable entityageable) {
EntitySheep entitysheep = (EntitySheep) entityageable;
- EntitySheep entitysheep1 = new EntitySheep(this.world);
+ EntitySheep entitysheep1 = EntityTypes.SHEEP.create(world); // Paper
entitysheep1.setColor(this.a((EntityAnimal) this, (EntityAnimal) entitysheep));
return entitysheep1;
diff --git a/src/main/java/net/minecraft/server/EntitySpider.java b/src/main/java/net/minecraft/server/EntitySpider.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntitySpider.java
+++ b/src/main/java/net/minecraft/server/EntitySpider.java
@@ -111,7 +111,7 @@ public class EntitySpider extends EntityMonster {
Object object = super.prepare(difficultydamagescaler, groupdataentity, nbttagcompound);
if (this.world.random.nextInt(100) == 0) {
- EntitySkeleton entityskeleton = new EntitySkeleton(this.world);
+ EntitySkeleton entityskeleton = EntityTypes.SKELETON.create(world); // Paper
entityskeleton.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F);
entityskeleton.prepare(difficultydamagescaler, (GroupDataEntity) null, (NBTTagCompound) null);
diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityTurtle.java
+++ b/src/main/java/net/minecraft/server/EntityTurtle.java
@@ -218,7 +218,7 @@ public class EntityTurtle extends EntityAnimal {
@Nullable
public EntityAgeable createChild(EntityAgeable entityageable) {
- return new EntityTurtle(this.world);
+ return EntityTypes.TURTLE.create(world); // Paper
}
public boolean f(ItemStack itemstack) {
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
@@ -269,6 +269,7 @@ public class EntityTypes<T extends Entity> {
return this.aX;
}
+ @Nullable public T create(World world) { return a(world); } // Paper - OBFHELPER
@Nullable
public T a(World world) {
return this.aT.apply(world); // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityVillager.java
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
@@ -596,7 +596,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant {
}
public EntityVillager b(EntityAgeable entityageable) {
- EntityVillager entityvillager = new EntityVillager(this.world);
+ EntityVillager entityvillager = EntityTypes.VILLAGER.create(world); // Paper
entityvillager.prepare(this.world.getDamageScaler(new BlockPosition(entityvillager)), (GroupDataEntity) null, (NBTTagCompound) null);
return entityvillager;
@@ -608,7 +608,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant {
public void onLightningStrike(EntityLightning entitylightning) {
if (!this.world.isClientSide && !this.dead) {
- EntityWitch entitywitch = new EntityWitch(this.world);
+ EntityWitch entitywitch = EntityTypes.WITCH.create(world); // Paper
// Paper start
if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityZapEvent(this, entitylightning, entitywitch).isCancelled()) {
diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityWolf.java
+++ b/src/main/java/net/minecraft/server/EntityWolf.java
@@ -343,7 +343,7 @@ public class EntityWolf extends EntityTameableAnimal {
}
public EntityWolf b(EntityAgeable entityageable) {
- EntityWolf entitywolf = new EntityWolf(this.world);
+ EntityWolf entitywolf = EntityTypes.WOLF.create(world); // Paper
UUID uuid = this.getOwnerUUID();
if (uuid != null) {
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -209,7 +209,7 @@ public class EntityZombie extends EntityMonster {
}
protected void dE() {
- this.a((EntityZombie) (new EntityDrowned(this.world)));
+ this.a((EntityZombie) EntityTypes.DROWNED.create(world)); // Paper
this.world.a((EntityHuman) null, 1040, new BlockPosition((int) this.locX, (int) this.locY, (int) this.locZ), 0);
}
@@ -256,7 +256,7 @@ public class EntityZombie extends EntityMonster {
int i = MathHelper.floor(this.locX);
int j = MathHelper.floor(this.locY);
int k = MathHelper.floor(this.locZ);
- EntityZombie entityzombie = new EntityZombie(this.world);
+ EntityZombie entityzombie = EntityTypes.ZOMBIE.create(world); // Paper
for (int l = 0; l < 50; ++l) {
int i1 = i + MathHelper.nextInt(this.random, 7, 40) * MathHelper.nextInt(this.random, -1, 1);
@@ -380,7 +380,7 @@ public class EntityZombie extends EntityMonster {
}
EntityVillager entityvillager = (EntityVillager) entityliving;
- EntityZombieVillager entityzombievillager = new EntityZombieVillager(this.world);
+ EntityZombieVillager entityzombievillager = EntityTypes.ZOMBIE_VILLAGER.create(world); // Paper
entityzombievillager.u(entityvillager);
this.world.kill(entityvillager);
@@ -439,7 +439,7 @@ public class EntityZombie extends EntityMonster {
this.startRiding(entitychicken);
}
} else if ((double) this.world.random.nextFloat() < 0.05D) {
- EntityChicken entitychicken1 = new EntityChicken(this.world);
+ EntityChicken entitychicken1 = EntityTypes.CHICKEN.create(world); // Paper
entitychicken1.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F);
entitychicken1.prepare(difficultydamagescaler, (GroupDataEntity) null, (NBTTagCompound) null);
diff --git a/src/main/java/net/minecraft/server/EntityZombieHusk.java b/src/main/java/net/minecraft/server/EntityZombieHusk.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityZombieHusk.java
+++ b/src/main/java/net/minecraft/server/EntityZombieHusk.java
@@ -54,7 +54,7 @@ public class EntityZombieHusk extends EntityZombie {
}
protected void dE() {
- this.a(new EntityZombie(this.world));
+ this.a(EntityTypes.ZOMBIE.create(world)); // Paper
this.world.a((EntityHuman) null, 1041, new BlockPosition((int) this.locX, (int) this.locY, (int) this.locZ), 0);
}
diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/EntityZombieVillager.java
+++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java
@@ -114,7 +114,7 @@ public class EntityZombieVillager extends EntityZombie {
}
protected void dJ() {
- EntityVillager entityvillager = new EntityVillager(this.world);
+ EntityVillager entityvillager = EntityTypes.VILLAGER.create(world); // Paper
entityvillager.u(this);
entityvillager.setProfession(this.getProfession());
diff --git a/src/main/java/net/minecraft/server/ItemArmorStand.java b/src/main/java/net/minecraft/server/ItemArmorStand.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/ItemArmorStand.java
+++ b/src/main/java/net/minecraft/server/ItemArmorStand.java
@@ -34,7 +34,7 @@ public class ItemArmorStand extends Item {
if (!world.isClientSide) {
world.setAir(blockposition);
world.setAir(blockposition1);
- EntityArmorStand entityarmorstand = new EntityArmorStand(world, d0 + 0.5D, d1, d2 + 0.5D);
+ EntityArmorStand entityarmorstand = EntityTypes.ARMOR_STAND.create(world); // Paper
float f = (float) MathHelper.d((MathHelper.g(itemactioncontext.h() - 180.0F) + 22.5F) / 45.0F) * 45.0F;
entityarmorstand.setPositionRotation(d0 + 0.5D, d1, d2 + 0.5D, f, 0.0F);
diff --git a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java
@@ -59,7 +59,7 @@ public class MobSpawnerPhantom {
continue;
}
// Paper end
- EntityPhantom entityphantom = new EntityPhantom(world);
+ EntityPhantom entityphantom = EntityTypes.PHANTOM.create(world); // Paper
entityphantom.spawningEntity = entityhuman.uniqueID; // Paper
entityphantom.setPositionRotation(blockposition1, 0.0F, 0.0F);
groupdataentity = entityphantom.prepare(difficultydamagescaler, groupdataentity, (NBTTagCompound) null);
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java
@@ -36,7 +36,7 @@ public class PathfinderGoalHorseTrap extends PathfinderGoal {
}
private EntityHorseAbstract a(DifficultyDamageScaler difficultydamagescaler) {
- EntityHorseSkeleton entityhorseskeleton = new EntityHorseSkeleton(this.a.world);
+ EntityHorseSkeleton entityhorseskeleton = EntityTypes.SKELETON_HORSE.create(a.world); // Paper
entityhorseskeleton.prepare(difficultydamagescaler, (GroupDataEntity) null, (NBTTagCompound) null);
entityhorseskeleton.setPosition(this.a.locX, this.a.locY, this.a.locZ);
@@ -49,7 +49,7 @@ public class PathfinderGoalHorseTrap extends PathfinderGoal {
}
private EntitySkeleton a(DifficultyDamageScaler difficultydamagescaler, EntityHorseAbstract entityhorseabstract) {
- EntitySkeleton entityskeleton = new EntitySkeleton(entityhorseabstract.world);
+ EntitySkeleton entityskeleton = EntityTypes.SKELETON.create(entityhorseabstract.world); // Paper
entityskeleton.prepare(difficultydamagescaler, (GroupDataEntity) null, (NBTTagCompound) null);
entityskeleton.setPosition(entityhorseabstract.locX, entityhorseabstract.locY, entityhorseabstract.locZ);
diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/VillageSiege.java
+++ b/src/main/java/net/minecraft/server/VillageSiege.java
@@ -134,7 +134,7 @@ public class VillageSiege {
EntityZombie entityzombie;
try {
- entityzombie = new EntityZombie(this.a);
+ entityzombie = EntityTypes.ZOMBIE.create(this.a); // Paper
entityzombie.prepare(this.a.getDamageScaler(new BlockPosition(entityzombie)), (GroupDataEntity) null, (NBTTagCompound) null);
} catch (Exception exception) {
exception.printStackTrace();
diff --git a/src/main/java/net/minecraft/server/WorldGenEndCityPieces.java b/src/main/java/net/minecraft/server/WorldGenEndCityPieces.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/WorldGenEndCityPieces.java
+++ b/src/main/java/net/minecraft/server/WorldGenEndCityPieces.java
@@ -174,7 +174,7 @@ public class WorldGenEndCityPieces {
if (i > 8) {
return false;
} else {
- ArrayList arraylist = Lists.newArrayList();
+ ArrayList<StructurePiece> arraylist = Lists.newArrayList(); // Paper - decompile error
if (worldgenendcitypieces$piecegenerator.a(definedstructuremanager, i, worldgenendcitypieces$piece, blockposition, arraylist, random)) {
boolean flag = false;
int j = random.nextInt();
@@ -243,7 +243,7 @@ public class WorldGenEndCityPieces {
TileEntityLootable.a(generatoraccess, random, blockposition1, LootTables.c);
}
} else if (s.startsWith("Sentry")) {
- EntityShulker entityshulker = new EntityShulker(generatoraccess.getMinecraftWorld());
+ EntityShulker entityshulker = EntityTypes.SHULKER.create(generatoraccess.getMinecraftWorld()); // Paper
entityshulker.setPosition((double)blockposition.getX() + 0.5D, (double)blockposition.getY() + 0.5D, (double)blockposition.getZ() + 0.5D);
entityshulker.g(blockposition);
generatoraccess.addEntity(entityshulker);
diff --git a/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java b/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java
+++ b/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java
@@ -146,7 +146,7 @@ public class WorldGenFeatureOceanRuinPieces {
((TileEntityChest)tileentity).setLootTable(this.h ? LootTables.q : LootTables.p, random.nextLong());
}
} else if ("drowned".equals(s)) {
- EntityDrowned entitydrowned = new EntityDrowned(generatoraccess.getMinecraftWorld());
+ EntityDrowned entitydrowned = EntityTypes.DROWNED.create(generatoraccess.getMinecraftWorld()); // Paper
entitydrowned.di();
entitydrowned.setPositionRotation(blockposition, 0.0F, 0.0F);
entitydrowned.prepare(generatoraccess.getDamageScaler(blockposition), (GroupDataEntity)null, (NBTTagCompound)null);
diff --git a/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java b/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java
+++ b/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java
@@ -37,7 +37,7 @@ public class WorldGenMonumentPieces {
protected static final IBlockData d = b;
protected static final IBlockData e = Blocks.SEA_LANTERN.getBlockData();
protected static final IBlockData f = Blocks.WATER.getBlockData();
- protected static final Set<Block> g = ImmutableSet.builder().add(Blocks.ICE).add(Blocks.PACKED_ICE).add(Blocks.BLUE_ICE).add(f.getBlock()).build();
+ protected static final Set<Block> g = new ImmutableSet.Builder<Block>().add(Blocks.ICE).add(Blocks.PACKED_ICE).add(Blocks.BLUE_ICE).add(f.getBlock()).build(); // Paper - decompile error
protected static final int h = b(2, 0, 0);
protected static final int i = b(2, 2, 0);
protected static final int j = b(0, 1, 0);
@@ -158,7 +158,7 @@ public class WorldGenMonumentPieces {
int i1 = this.d(jx);
int j1 = this.b(ix, kx);
if (structureboundingbox.b(new BlockPosition(lx, i1, j1))) {
- EntityGuardianElder entityguardianelder = new EntityGuardianElder(generatoraccess.getMinecraftWorld());
+ EntityGuardianElder entityguardianelder = EntityTypes.ELDER_GUARDIAN.create(generatoraccess.getMinecraftWorld()); // Paper
entityguardianelder.heal(entityguardianelder.getMaxHealth());
entityguardianelder.setPositionRotation((double)lx + 0.5D, (double)i1, (double)j1 + 0.5D, 0.0F, 0.0F);
entityguardianelder.prepare(generatoraccess.getDamageScaler(new BlockPosition(entityguardianelder)), (GroupDataEntity)null, (NBTTagCompound)null);
@@ -188,7 +188,7 @@ public class WorldGenMonumentPieces {
this.n = new StructureBoundingBox(i, 39, j, i + 58 - 1, 61, j + 58 - 1);
}
- List list = this.a(random);
+ List<WorldGenMonumentPieces.WorldGenMonumentStateTracker> list = this.a(random); // Paper - decompile error
this.p.d = true;
this.r.add(new WorldGenMonumentPieces.WorldGenMonumentPieceEntry(enumdirection1, this.p));
this.r.add(new WorldGenMonumentPieces.WorldGenMonumentPiece2(enumdirection1, this.q, random));
@@ -312,7 +312,7 @@ public class WorldGenMonumentPieces {
this.q.b[EnumDirection.EAST.a()].b[EnumDirection.UP.a()].d = true;
this.q.b[EnumDirection.NORTH.a()].b[EnumDirection.UP.a()].d = true;
this.q.b[EnumDirection.EAST.a()].b[EnumDirection.NORTH.a()].b[EnumDirection.UP.a()].d = true;
- ArrayList arraylist = Lists.newArrayList();
+ ArrayList<WorldGenMonumentPieces.WorldGenMonumentStateTracker> arraylist = Lists.newArrayList(); // Paper - decompile error
for(WorldGenMonumentPieces.WorldGenMonumentStateTracker worldgenmonumentpieces$worldgenmonumentstatetracker4 : aworldgenmonumentpieces$worldgenmonumentstatetracker) {
if (worldgenmonumentpieces$worldgenmonumentstatetracker4 != null) {
diff --git a/src/main/java/net/minecraft/server/WorldGenVillagePieces.java b/src/main/java/net/minecraft/server/WorldGenVillagePieces.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/WorldGenVillagePieces.java
+++ b/src/main/java/net/minecraft/server/WorldGenVillagePieces.java
@@ -1656,7 +1656,7 @@ public class WorldGenVillagePieces {
++this.a;
if (this.h) {
- EntityZombieVillager entityzombievillager = new EntityZombieVillager(generatoraccess.getMinecraftWorld());
+ EntityZombieVillager entityzombievillager = EntityTypes.ZOMBIE_VILLAGER.create(generatoraccess.getMinecraftWorld()); // Paper
entityzombievillager.setPositionRotation((double) j1 + 0.5D, (double) k1, (double) l1 + 0.5D, 0.0F, 0.0F);
entityzombievillager.prepare(generatoraccess.getDamageScaler(new BlockPosition(entityzombievillager)), (GroupDataEntity) null, (NBTTagCompound) null);
@@ -1664,7 +1664,7 @@ public class WorldGenVillagePieces {
entityzombievillager.di();
generatoraccess.addEntity(entityzombievillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason
} else {
- EntityVillager entityvillager = new EntityVillager(generatoraccess.getMinecraftWorld());
+ EntityVillager entityvillager = EntityTypes.VILLAGER.create(generatoraccess.getMinecraftWorld()); // Paper
entityvillager.setPositionRotation((double) j1 + 0.5D, (double) k1, (double) l1 + 0.5D, 0.0F, 0.0F);
entityvillager.setProfession(this.c(i1, generatoraccess.m().nextInt(6)));
diff --git a/src/main/java/net/minecraft/server/WorldGenWitchHut.java b/src/main/java/net/minecraft/server/WorldGenWitchHut.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/WorldGenWitchHut.java
+++ b/src/main/java/net/minecraft/server/WorldGenWitchHut.java
@@ -81,7 +81,7 @@ public class WorldGenWitchHut extends WorldGenScatteredPiece {
if (structureboundingbox.b((BaseBlockPosition) (new BlockPosition(i, j, k)))) {
this.e = true;
- EntityWitch entitywitch = new EntityWitch(generatoraccess.getMinecraftWorld());
+ EntityWitch entitywitch = EntityTypes.WITCH.create(generatoraccess.getMinecraftWorld()); // Paper
entitywitch.di();
entitywitch.setPositionRotation((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F);
diff --git a/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java b/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java
+++ b/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java
@@ -197,7 +197,7 @@ public class WorldGenWoodlandMansionPieces {
}
private void b() {
- ArrayList arraylist = Lists.newArrayList();
+ ArrayList<Tuple<Integer, Integer>> arraylist = Lists.newArrayList(); // Paper - decompile error
WorldGenWoodlandMansionPieces.g worldgenwoodlandmansionpieces$g = this.d[1];
for(int i = 0; i < this.c.c; ++i) {
@@ -205,7 +205,7 @@ public class WorldGenWoodlandMansionPieces {
int k = worldgenwoodlandmansionpieces$g.a(j, i);
int l = k & 983040;
if (l == 131072 && (k & 2097152) == 2097152) {
- arraylist.add(new Tuple(j, i));
+ arraylist.add(new Tuple<>(j, i)); // Paper - decompile error
}
}
}
@@ -213,7 +213,7 @@ public class WorldGenWoodlandMansionPieces {
if (arraylist.isEmpty()) {
this.c.a(0, 0, this.c.b, this.c.c, 5);
} else {
- Tuple tuple = (Tuple)arraylist.get(this.a.nextInt(arraylist.size()));
+ Tuple<Integer, Integer> tuple = arraylist.get(this.a.nextInt(arraylist.size())); // Paper - decompile error
int l1 = worldgenwoodlandmansionpieces$g.a(tuple.a(), tuple.b());
worldgenwoodlandmansionpieces$g.a(tuple.a(), tuple.b(), l1 | 4194304);
EnumDirection enumdirection1 = this.b(this.b, tuple.a(), tuple.b(), 1, l1 & '\uffff');
@@ -257,12 +257,12 @@ public class WorldGenWoodlandMansionPieces {
}
private void a(WorldGenWoodlandMansionPieces.g worldgenwoodlandmansionpieces$g, WorldGenWoodlandMansionPieces.g worldgenwoodlandmansionpieces$g1) {
- ArrayList arraylist = Lists.newArrayList();
+ ArrayList<Tuple<Integer, Integer>> arraylist = Lists.newArrayList(); // Paper - decompile error
for(int i = 0; i < worldgenwoodlandmansionpieces$g.c; ++i) {
for(int j = 0; j < worldgenwoodlandmansionpieces$g.b; ++j) {
if (worldgenwoodlandmansionpieces$g.a(j, i) == 2) {
- arraylist.add(new Tuple(j, i));
+ arraylist.add(new Tuple<>(j, i)); // Paper - decompile error
}
}
}
@@ -270,7 +270,7 @@ public class WorldGenWoodlandMansionPieces {
Collections.shuffle(arraylist, this.a);
int k3 = 10;
- for(Tuple tuple : arraylist) {
+ for(Tuple<Integer, Integer> tuple : arraylist) { // Paper - decompile error
int k = tuple.a();
int l = tuple.b();
if (worldgenwoodlandmansionpieces$g1.a(k, l) == 0) {
@@ -985,13 +985,13 @@ public class WorldGenWoodlandMansionPieces {
this.a(generatoraccess, structureboundingbox, random, blockposition, LootTables.o, iblockdata);
} else if ("Mage".equals(s)) {
- EntityEvoker entityevoker = new EntityEvoker(generatoraccess.getMinecraftWorld());
+ EntityEvoker entityevoker = EntityTypes.EVOKER.create(generatoraccess.getMinecraftWorld()); // Paper
entityevoker.di();
entityevoker.setPositionRotation(blockposition, 0.0F, 0.0F);
generatoraccess.addEntity(entityevoker);
generatoraccess.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 2);
} else if ("Warrior".equals(s)) {
- EntityVindicator entityvindicator = new EntityVindicator(generatoraccess.getMinecraftWorld());
+ EntityVindicator entityvindicator = EntityTypes.VINDICATOR.create(generatoraccess.getMinecraftWorld()); // Paper
entityvindicator.di();
entityvindicator.setPositionRotation(blockposition, 0.0F, 0.0F);
entityvindicator.prepare(generatoraccess.getDamageScaler(new BlockPosition(entityvindicator)), (GroupDataEntity)null, (NBTTagCompound)null);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -511,7 +511,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
boolean flag2 = this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper
if (flag2) {
- EntityHorseSkeleton entityhorseskeleton = new EntityHorseSkeleton(this);
+ EntityHorseSkeleton entityhorseskeleton = EntityTypes.SKELETON_HORSE.create(this); // Paper
entityhorseskeleton.s(true);
entityhorseskeleton.setAgeRaw(0);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1048,153 +1048,153 @@ public class CraftWorld implements World {
entity.setPositionRotation(x, y, z, 0, 0);
} else if (LivingEntity.class.isAssignableFrom(clazz)) {
if (Chicken.class.isAssignableFrom(clazz)) {
- entity = new EntityChicken(world);
+ entity = EntityTypes.CHICKEN.create(world); // Paper
} else if (Cow.class.isAssignableFrom(clazz)) {
if (MushroomCow.class.isAssignableFrom(clazz)) {
- entity = new EntityMushroomCow(world);
+ entity = EntityTypes.MOOSHROOM.create(world); // Paper
} else {
- entity = new EntityCow(world);
+ entity = EntityTypes.COW.create(world); // Paper
}
} else if (Golem.class.isAssignableFrom(clazz)) {
if (Snowman.class.isAssignableFrom(clazz)) {
- entity = new EntitySnowman(world);
+ entity = EntityTypes.SNOW_GOLEM.create(world); // Paper
} else if (IronGolem.class.isAssignableFrom(clazz)) {
- entity = new EntityIronGolem(world);
+ entity = EntityTypes.IRON_GOLEM.create(world); // Paper
} else if (Shulker.class.isAssignableFrom(clazz)) {
- entity = new EntityShulker(world);
+ entity = EntityTypes.SHULKER.create(world); // Paper
}
} else if (Creeper.class.isAssignableFrom(clazz)) {
- entity = new EntityCreeper(world);
+ entity = EntityTypes.CREEPER.create(world); // Paper
} else if (Ghast.class.isAssignableFrom(clazz)) {
- entity = new EntityGhast(world);
+ entity = EntityTypes.GHAST.create(world); // Paper
} else if (Pig.class.isAssignableFrom(clazz)) {
- entity = new EntityPig(world);
+ entity = EntityTypes.PIG.create(world); // Paper
} else if (Player.class.isAssignableFrom(clazz)) {
// need a net server handler for this one
} else if (Sheep.class.isAssignableFrom(clazz)) {
- entity = new EntitySheep(world);
+ entity = EntityTypes.SHEEP.create(world); // Paper
} else if (AbstractHorse.class.isAssignableFrom(clazz)) {
if (ChestedHorse.class.isAssignableFrom(clazz)) {
if (Donkey.class.isAssignableFrom(clazz)) {
- entity = new EntityHorseDonkey(world);
+ entity = EntityTypes.DONKEY.create(world); // Paper
} else if (Mule.class.isAssignableFrom(clazz)) {
- entity = new EntityHorseMule(world);
+ entity = EntityTypes.MULE.create(world); // Paper
} else if (Llama.class.isAssignableFrom(clazz)) {
- entity = new EntityLlama(world);
+ entity = EntityTypes.LLAMA.create(world); // Paper
}
} else if (SkeletonHorse.class.isAssignableFrom(clazz)) {
- entity = new EntityHorseSkeleton(world);
+ entity = EntityTypes.SKELETON_HORSE.create(world); // Paper
} else if (ZombieHorse.class.isAssignableFrom(clazz)) {
- entity = new EntityHorseZombie(world);
+ entity = EntityTypes.ZOMBIE_HORSE.create(world); // Paper
} else {
- entity = new EntityHorse(world);
+ entity = EntityTypes.HORSE.create(world); // Paper
}
} else if (Skeleton.class.isAssignableFrom(clazz)) {
if (Stray.class.isAssignableFrom(clazz)){
- entity = new EntitySkeletonStray(world);
+ entity = EntityTypes.STRAY.create(world); // Paper
} else if (WitherSkeleton.class.isAssignableFrom(clazz)) {
- entity = new EntitySkeletonWither(world);
+ entity = EntityTypes.WITHER_SKELETON.create(world); // Paper
} else {
- entity = new EntitySkeleton(world);
+ entity = EntityTypes.SKELETON.create(world); // Paper
}
} else if (Slime.class.isAssignableFrom(clazz)) {
if (MagmaCube.class.isAssignableFrom(clazz)) {
- entity = new EntityMagmaCube(world);
+ entity = EntityTypes.MAGMA_CUBE.create(world); // Paper
} else {
- entity = new EntitySlime(world);
+ entity = EntityTypes.SLIME.create(world); // Paper
}
} else if (Spider.class.isAssignableFrom(clazz)) {
if (CaveSpider.class.isAssignableFrom(clazz)) {
- entity = new EntityCaveSpider(world);
+ entity = EntityTypes.CAVE_SPIDER.create(world); // Paper
} else {
- entity = new EntitySpider(world);
+ entity = EntityTypes.SPIDER.create(world); // Paper
}
} else if (Squid.class.isAssignableFrom(clazz)) {
- entity = new EntitySquid(world);
+ entity = EntityTypes.SQUID.create(world); // Paper
} else if (Tameable.class.isAssignableFrom(clazz)) {
if (Wolf.class.isAssignableFrom(clazz)) {
- entity = new EntityWolf(world);
+ entity = EntityTypes.WOLF.create(world); // Paper
} else if (Ocelot.class.isAssignableFrom(clazz)) {
- entity = new EntityOcelot(world);
+ entity = EntityTypes.OCELOT.create(world); // Paper
} else if (Parrot.class.isAssignableFrom(clazz)) {
- entity = new EntityParrot(world);
+ entity = EntityTypes.PARROT.create(world); // Paper
}
} else if (PigZombie.class.isAssignableFrom(clazz)) {
- entity = new EntityPigZombie(world);
+ entity = EntityTypes.ZOMBIE_PIGMAN.create(world); // Paper
} else if (Zombie.class.isAssignableFrom(clazz)) {
if (Husk.class.isAssignableFrom(clazz)) {
- entity = new EntityZombieHusk(world);
+ entity = EntityTypes.HUSK.create(world); // Paper
} else if (ZombieVillager.class.isAssignableFrom(clazz)) {
- entity = new EntityZombieVillager(world);
+ entity = EntityTypes.ZOMBIE_VILLAGER.create(world); // Paper
} else if (Drowned.class.isAssignableFrom(clazz)) {
- entity = new EntityDrowned(world);
+ entity = EntityTypes.DROWNED.create(world); // Paper
} else {
- entity = new EntityZombie(world);
+ entity = EntityTypes.ZOMBIE.create(world); // Paper
}
} else if (Giant.class.isAssignableFrom(clazz)) {
- entity = new EntityGiantZombie(world);
+ entity = EntityTypes.GIANT.create(world); // Paper
} else if (Silverfish.class.isAssignableFrom(clazz)) {
- entity = new EntitySilverfish(world);
+ entity = EntityTypes.SILVERFISH.create(world); // Paper
} else if (Enderman.class.isAssignableFrom(clazz)) {
- entity = new EntityEnderman(world);
+ entity = EntityTypes.ENDERMAN.create(world); // Paper
} else if (Blaze.class.isAssignableFrom(clazz)) {
- entity = new EntityBlaze(world);
+ entity = EntityTypes.BLAZE.create(world); // Paper
} else if (Villager.class.isAssignableFrom(clazz)) {
- entity = new EntityVillager(world);
+ entity = EntityTypes.VILLAGER.create(world); // Paper
} else if (Witch.class.isAssignableFrom(clazz)) {
- entity = new EntityWitch(world);
+ entity = EntityTypes.WITCH.create(world); // Paper
} else if (Wither.class.isAssignableFrom(clazz)) {
- entity = new EntityWither(world);
+ entity = EntityTypes.WITHER.create(world); // Paper
} else if (ComplexLivingEntity.class.isAssignableFrom(clazz)) {
if (EnderDragon.class.isAssignableFrom(clazz)) {
- entity = new EntityEnderDragon(world);
+ entity = EntityTypes.ENDER_DRAGON.create(world); // Paper
}
} else if (Ambient.class.isAssignableFrom(clazz)) {
if (Bat.class.isAssignableFrom(clazz)) {
- entity = new EntityBat(world);
+ entity = EntityTypes.BAT.create(world); // Paper
}
} else if (Rabbit.class.isAssignableFrom(clazz)) {
- entity = new EntityRabbit(world);
+ entity = EntityTypes.RABBIT.create(world); // Paper
} else if (Endermite.class.isAssignableFrom(clazz)) {
- entity = new EntityEndermite(world);
+ entity = EntityTypes.ENDERMITE.create(world); // Paper
} else if (Guardian.class.isAssignableFrom(clazz)) {
if (ElderGuardian.class.isAssignableFrom(clazz)){
- entity = new EntityGuardianElder(world);
+ entity = EntityTypes.ELDER_GUARDIAN.create(world); // Paper
} else {
- entity = new EntityGuardian(world);
+ entity = EntityTypes.GUARDIAN.create(world); // Paper
}
} else if (ArmorStand.class.isAssignableFrom(clazz)) {
- entity = new EntityArmorStand(world, x, y, z);
+ entity = EntityTypes.ARMOR_STAND.create(world); // Paper
} else if (PolarBear.class.isAssignableFrom(clazz)) {
- entity = new EntityPolarBear(world);
+ entity = EntityTypes.POLAR_BEAR.create(world); // Paper
} else if (Vex.class.isAssignableFrom(clazz)) {
- entity = new EntityVex(world);
+ entity = EntityTypes.VEX.create(world); // Paper
} else if (Illager.class.isAssignableFrom(clazz)) {
if (Spellcaster.class.isAssignableFrom(clazz)) {
if (Evoker.class.isAssignableFrom(clazz)) {
- entity = new EntityEvoker(world);
+ entity = EntityTypes.EVOKER.create(world); // Paper
} else if (Illusioner.class.isAssignableFrom(clazz)) {
- entity = new EntityIllagerIllusioner(world);
+ entity = EntityTypes.ILLUSIONER.create(world); // Paper
}
} else if (Vindicator.class.isAssignableFrom(clazz)) {
- entity = new EntityVindicator(world);
+ entity = EntityTypes.VINDICATOR.create(world); // Paper
}
} else if (Turtle.class.isAssignableFrom(clazz)) {
- entity = new EntityTurtle(world);
+ entity = EntityTypes.TURTLE.create(world); // Paper
} else if (Phantom.class.isAssignableFrom(clazz)) {
- entity = new EntityPhantom(world);
+ entity = EntityTypes.PHANTOM.create(world); // Paper
} else if (Fish.class.isAssignableFrom(clazz)) {
if (Cod.class.isAssignableFrom(clazz)) {
- entity = new EntityCod(world);
+ entity = EntityTypes.COD.create(world); // Paper
} else if (PufferFish.class.isAssignableFrom(clazz)) {
- entity = new EntityPufferFish(world);
+ entity = EntityTypes.PUFFERFISH.create(world); // Paper
} else if (Salmon.class.isAssignableFrom(clazz)) {
- entity = new EntitySalmon(world);
+ entity = EntityTypes.SALMON.create(world); // Paper
} else if (TropicalFish.class.isAssignableFrom(clazz)) {
- entity = new EntityTropicalFish(world);
+ entity = EntityTypes.TROPICAL_FISH.create(world); // Paper
}
} else if (Dolphin.class.isAssignableFrom(clazz)) {
- entity = new EntityDolphin(world);
+ entity = EntityTypes.DOLPHIN.create(world); // Paper
}
if (entity != null) {
--
2.19.1