2019-04-08 12:31:50 +02:00
From 77e25caa3b18b13dadcc0b1deb10bc3031eb35b3 Mon Sep 17 00:00:00 2001
2018-10-24 22:26:00 +02:00
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
2019-03-20 01:28:15 +01:00
index 5a0cc6d05..d385f647e 100644
2018-10-24 22:26:00 +02:00
--- 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
2019-03-20 01:28:15 +01:00
index 75622fbdf..265369984 100644
2018-10-24 22:26:00 +02:00
--- 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
2019-03-20 01:28:15 +01:00
index 0f0872c1e..1c1bf85a0 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/BlockTurtleEgg.java
+++ b/src/main/java/net/minecraft/server/BlockTurtleEgg.java
2019-01-18 23:34:02 +01:00
@@ -94,7 +94,7 @@ public class BlockTurtleEgg extends Block {
2018-10-24 22:26:00 +02:00
if (!world.isClientSide) {
2018-12-08 11:09:55 +01:00
for (int j = 0; j < (Integer) iblockdata.get(BlockTurtleEgg.b); ++j) {
2018-10-24 22:26:00 +02:00
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
2019-03-20 01:28:15 +01:00
index 93bf32dc1..e6063bb46 100644
2018-10-24 22:26:00 +02:00
--- 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
2019-03-20 01:28:15 +01:00
index aad7ce93f..09eabf123 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/EnderDragonBattle.java
+++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java
2019-01-01 04:15:55 +01:00
@@ -412,7 +412,7 @@ public class EnderDragonBattle {
2018-10-24 22:26:00 +02:00
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
2019-01-01 04:15:55 +01:00
2018-12-17 06:18:06 +01:00
entityenderdragon.getDragonControllerManager().setControllerPhase(DragonControllerPhase.HOLDING_PATTERN);
2018-10-24 22:26:00 +02:00
entityenderdragon.setPositionRotation(0.0D, 128.0D, 0.0D, this.d.random.nextFloat() * 360.0F, 0.0F);
diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java
2019-03-20 01:28:15 +01:00
index ee159e0a8..070a9e7b1 100644
2018-10-24 22:26:00 +02:00
--- 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 {
}
2018-12-17 06:18:06 +01:00
public EntityChicken createChild(EntityAgeable entityageable) {
2018-10-24 22:26:00 +02:00
- 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
2019-03-20 01:28:15 +01:00
index 5874d2993..cc53e915d 100644
2018-10-24 22:26:00 +02:00
--- 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 {
}
2018-12-17 06:18:06 +01:00
public EntityCow createChild(EntityAgeable entityageable) {
2018-10-24 22:26:00 +02:00
- 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
2019-03-20 01:28:15 +01:00
index 961afa5c4..a372f6508 100644
2018-10-24 22:26:00 +02:00
--- 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
2018-12-17 06:18:06 +01:00
entityendermite.setPlayerSpawned(true);
2018-10-24 22:26:00 +02:00
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
2019-03-20 01:28:15 +01:00
index 963b6fbb9..fc20bbe27 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/EntityEvoker.java
+++ b/src/main/java/net/minecraft/server/EntityEvoker.java
2019-01-01 04:15:55 +01:00
@@ -188,8 +188,7 @@ public class EntityEvoker extends EntityIllagerWizard {
2018-10-24 22:26:00 +02:00
protected void j() {
2019-01-01 04:15:55 +01:00
for (int i = 0; i < 3; ++i) {
2018-10-24 22:26:00 +02:00
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);
2019-01-01 04:15:55 +01:00
-
2018-10-24 22:26:00 +02:00
+ EntityVex entityvex = EntityTypes.VEX.create(EntityEvoker.this.world); // Paper
entityvex.setPositionRotation(blockposition, 0.0F, 0.0F);
2019-01-01 04:15:55 +01:00
entityvex.prepare(EntityEvoker.this.world.getDamageScaler(blockposition), (GroupDataEntity) null, (NBTTagCompound) null);
entityvex.a((EntityInsentient) EntityEvoker.this);
2018-10-24 22:26:00 +02:00
diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java
2019-03-20 01:28:15 +01:00
index 4e8a97c55..1b9425f3e 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/EntityHorse.java
+++ b/src/main/java/net/minecraft/server/EntityHorse.java
2019-01-01 04:15:55 +01:00
@@ -208,11 +208,11 @@ public class EntityHorse extends EntityHorseAbstract {
2018-10-24 22:26:00 +02:00
Object object;
2019-01-01 04:15:55 +01:00
2018-10-24 22:26:00 +02:00
if (entityageable instanceof EntityHorseDonkey) {
- object = new EntityHorseMule(this.world);
+ object = EntityTypes.MULE.create(world); // Paper
} else {
2019-01-01 04:15:55 +01:00
EntityHorse entityhorse = (EntityHorse) entityageable;
2018-10-24 22:26:00 +02:00
- object = new EntityHorse(this.world);
+ object = EntityTypes.HORSE.create(world); // Paper
2019-01-01 04:15:55 +01:00
int i = this.random.nextInt(9);
int j;
2018-10-24 22:26:00 +02:00
diff --git a/src/main/java/net/minecraft/server/EntityHorseDonkey.java b/src/main/java/net/minecraft/server/EntityHorseDonkey.java
2019-03-20 01:28:15 +01:00
index 72eed22eb..65c40e72b 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/EntityHorseDonkey.java
+++ b/src/main/java/net/minecraft/server/EntityHorseDonkey.java
2019-01-01 04:15:55 +01:00
@@ -33,7 +33,7 @@ public class EntityHorseDonkey extends EntityHorseChestedAbstract {
2018-10-24 22:26:00 +02:00
}
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
2019-01-01 04:15:55 +01:00
this.a(entityageable, (EntityHorseAbstract) object);
return (EntityAgeable) object;
2018-10-24 22:26:00 +02:00
diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java
2019-03-20 01:28:15 +01:00
index eae2b2665..0a092acdf 100644
2018-10-24 22:26:00 +02:00
--- 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
2019-01-01 04:15:55 +01:00
public EntityAgeable createChild(EntityAgeable entityageable) {
2018-10-24 22:26:00 +02:00
- 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
2019-03-20 01:28:15 +01:00
index c23bc72fc..a1873f557 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/EntityHorseZombie.java
+++ b/src/main/java/net/minecraft/server/EntityHorseZombie.java
2019-01-01 04:15:55 +01:00
@@ -41,7 +41,7 @@ public class EntityHorseZombie extends EntityHorseAbstract {
2018-10-24 22:26:00 +02:00
@Nullable
2019-01-01 04:15:55 +01:00
public EntityAgeable createChild(EntityAgeable entityageable) {
2018-10-24 22:26:00 +02:00
- 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
2019-03-20 01:28:15 +01:00
index 5e1976871..82a32c61e 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/EntityLlama.java
+++ b/src/main/java/net/minecraft/server/EntityLlama.java
2019-01-01 04:15:55 +01:00
@@ -285,7 +285,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
2018-10-24 22:26:00 +02:00
}
2018-12-17 06:18:06 +01:00
public EntityLlama createChild(EntityAgeable entityageable) {
2019-01-01 04:15:55 +01:00
- EntityLlama entityllama = new EntityLlama(this.world);
+ EntityLlama entityllama = EntityTypes.LLAMA.create(world); // Paper
this.a(entityageable, (EntityHorseAbstract) entityllama);
EntityLlama entityllama1 = (EntityLlama) entityageable;
2018-10-24 22:26:00 +02:00
diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java
2019-03-20 01:28:15 +01:00
index dde9f1e61..638dbe978 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/EntityMushroomCow.java
+++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java
2018-11-14 05:21:32 +01:00
@@ -40,7 +40,7 @@ public class EntityMushroomCow extends EntityCow {
2018-10-24 22:26:00 +02:00
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) {
2018-12-08 11:09:55 +01:00
// this.die(); // CraftBukkit - moved down
2018-10-24 22:26:00 +02:00
- 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());
2018-12-08 11:09:55 +01:00
@@ -74,7 +74,7 @@ public class EntityMushroomCow extends EntityCow {
2018-10-24 22:26:00 +02:00
}
2018-12-17 06:18:06 +01:00
public EntityMushroomCow createChild(EntityAgeable entityageable) {
2018-10-24 22:26:00 +02:00
- 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
2019-03-20 01:28:15 +01:00
index ba074c10c..13c84bda8 100644
2018-10-24 22:26:00 +02:00
--- 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 {
}
2018-12-17 06:18:06 +01:00
public EntityOcelot createChild(EntityAgeable entityageable) {
2018-10-24 22:26:00 +02:00
- 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
2019-03-20 01:28:15 +01:00
index 9dc2d8be2..d1689dc33 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/EntityPig.java
+++ b/src/main/java/net/minecraft/server/EntityPig.java
2018-11-14 05:21:32 +01:00
@@ -153,7 +153,7 @@ public class EntityPig extends EntityAnimal {
2018-10-24 22:26:00 +02:00
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
2018-12-08 11:09:55 +01:00
entitypigzombie.setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.GOLDEN_SWORD));
entitypigzombie.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
@@ -242,7 +242,7 @@ public class EntityPig extends EntityAnimal {
2018-10-24 22:26:00 +02:00
}
2018-12-17 06:18:06 +01:00
public EntityPig createChild(EntityAgeable entityageable) {
2018-10-24 22:26:00 +02:00
- 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
2019-03-20 01:28:15 +01:00
index a02020d5f..dbb534c9c 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/EntityPolarBear.java
+++ b/src/main/java/net/minecraft/server/EntityPolarBear.java
2019-01-01 04:15:55 +01:00
@@ -18,7 +18,7 @@ public class EntityPolarBear extends EntityAnimal {
2018-10-24 22:26:00 +02:00
}
2019-01-01 04:15:55 +01:00
public EntityAgeable createChild(EntityAgeable entityageable) {
2018-10-24 22:26:00 +02:00
- return new EntityPolarBear(this.world);
+ return EntityTypes.POLAR_BEAR.create(world); // Paper
}
2019-01-01 04:15:55 +01:00
public boolean f(ItemStack itemstack) {
2018-10-24 22:26:00 +02:00
diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java
2019-03-20 01:28:15 +01:00
index e545b1c9b..d6bac06a7 100644
2018-10-24 22:26:00 +02:00
--- 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 {
}
2018-12-17 06:18:06 +01:00
public EntityRabbit createChild(EntityAgeable entityageable) {
2018-10-24 22:26:00 +02:00
- 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
2019-03-20 01:28:15 +01:00
index f7a25c148..c35d1eef4 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/EntitySheep.java
+++ b/src/main/java/net/minecraft/server/EntitySheep.java
2019-01-01 04:15:55 +01:00
@@ -247,7 +247,7 @@ public class EntitySheep extends EntityAnimal {
2018-10-24 22:26:00 +02:00
2018-12-17 06:18:06 +01:00
public EntitySheep createChild(EntityAgeable entityageable) {
2018-10-24 22:26:00 +02:00
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
2019-03-20 01:28:15 +01:00
index a42b8d554..9ef1c9baf 100644
2018-10-24 22:26:00 +02:00
--- 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
2019-03-20 01:28:15 +01:00
index a533e0eb5..270b95082 100644
2018-10-24 22:26:00 +02:00
--- 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
2019-03-20 01:28:15 +01:00
index d74bfa120..24ca35119 100644
2018-10-24 22:26:00 +02:00
--- 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
2019-03-20 01:28:15 +01:00
index f01e776fe..40b3ffd8c 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/EntityVillager.java
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
2019-01-01 04:15:55 +01:00
@@ -592,7 +592,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant {
2018-10-24 22:26:00 +02:00
}
2018-12-17 06:18:06 +01:00
public EntityVillager createChild(EntityAgeable entityageable) {
2018-10-24 22:26:00 +02:00
- 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;
2019-01-01 04:15:55 +01:00
@@ -604,7 +604,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant {
2018-10-24 22:26:00 +02:00
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
2019-03-20 01:28:15 +01:00
index 4f1696d01..46d8e0a1f 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/EntityWolf.java
+++ b/src/main/java/net/minecraft/server/EntityWolf.java
2019-01-01 04:15:55 +01:00
@@ -342,7 +342,7 @@ public class EntityWolf extends EntityTameableAnimal {
2018-10-24 22:26:00 +02:00
}
2018-12-17 06:18:06 +01:00
public EntityWolf createChild(EntityAgeable entityageable) {
2018-10-24 22:26:00 +02:00
- 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
2019-03-20 01:28:15 +01:00
index 7998b80c1..81cc0c3b3 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
2019-01-15 22:12:19 +01:00
@@ -208,7 +208,7 @@ public class EntityZombie extends EntityMonster {
2018-10-24 22:26:00 +02:00
}
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);
}
2019-01-15 22:12:19 +01:00
@@ -261,7 +261,7 @@ public class EntityZombie extends EntityMonster {
2018-10-24 22:26:00 +02:00
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);
2019-01-15 22:12:19 +01:00
@@ -385,7 +385,7 @@ public class EntityZombie extends EntityMonster {
2018-10-24 22:26:00 +02:00
}
EntityVillager entityvillager = (EntityVillager) entityliving;
- EntityZombieVillager entityzombievillager = new EntityZombieVillager(this.world);
+ EntityZombieVillager entityzombievillager = EntityTypes.ZOMBIE_VILLAGER.create(world); // Paper
entityzombievillager.u(entityvillager);
2018-12-08 11:09:55 +01:00
// this.world.kill(entityvillager); // CraftBukkit - moved down
2019-01-15 22:12:19 +01:00
@@ -450,7 +450,7 @@ public class EntityZombie extends EntityMonster {
2018-10-24 22:26:00 +02:00
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
2019-03-20 01:28:15 +01:00
index 85d402965..0cca7b6d5 100644
2018-10-24 22:26:00 +02:00
--- 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
2019-04-08 12:31:50 +02:00
index 359ac8b88..96a1b1d3f 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/EntityZombieVillager.java
+++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java
2019-04-08 12:31:50 +02:00
@@ -119,7 +119,7 @@ public class EntityZombieVillager extends EntityZombie {
2018-10-24 22:26:00 +02:00
}
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
2019-03-20 01:28:15 +01:00
index 576b3c565..4dd0e39ec 100644
2018-10-24 22:26:00 +02:00
--- 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
2019-03-20 01:28:15 +01:00
index 5ddf66eef..bb7e072ee 100644
2018-10-24 22:26:00 +02:00
--- 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
2019-03-20 01:28:15 +01:00
index d4fdcbdfd..887e4461f 100644
2018-10-24 22:26:00 +02:00
--- 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
2019-03-20 01:28:15 +01:00
index 0ac1fb53a..509d62f6b 100644
2018-10-24 22:26:00 +02:00
--- 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
2019-03-20 01:28:15 +01:00
index 94b21693e..0a223cfe5 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/WorldGenEndCityPieces.java
+++ b/src/main/java/net/minecraft/server/WorldGenEndCityPieces.java
2019-01-01 04:15:55 +01:00
@@ -270,7 +270,7 @@ public class WorldGenEndCityPieces {
2018-10-24 22:26:00 +02:00
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
2019-01-01 04:15:55 +01:00
entityshulker.setPosition((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D);
2018-10-24 22:26:00 +02:00
entityshulker.g(blockposition);
diff --git a/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java b/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java
2019-03-20 01:28:15 +01:00
index 2def56b06..abeb4aa02 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java
+++ b/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java
2019-01-01 04:15:55 +01:00
@@ -154,8 +154,7 @@ public class WorldGenFeatureOceanRuinPieces {
((TileEntityChest) tileentity).setLootTable(this.h ? LootTables.q : LootTables.p, random.nextLong());
2018-10-24 22:26:00 +02:00
}
} else if ("drowned".equals(s)) {
- EntityDrowned entitydrowned = new EntityDrowned(generatoraccess.getMinecraftWorld());
2019-01-01 04:15:55 +01:00
-
2018-10-24 22:26:00 +02:00
+ EntityDrowned entitydrowned = EntityTypes.DROWNED.create(generatoraccess.getMinecraftWorld()); // Paper
entitydrowned.di();
entitydrowned.setPositionRotation(blockposition, 0.0F, 0.0F);
2019-01-01 04:15:55 +01:00
entitydrowned.prepare(generatoraccess.getDamageScaler(blockposition), (GroupDataEntity) null, (NBTTagCompound) null);
2018-10-24 22:26:00 +02:00
diff --git a/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java b/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java
2019-03-20 01:28:15 +01:00
index 0e7aed09d..493a86e1b 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java
+++ b/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java
2019-01-01 04:15:55 +01:00
@@ -1800,7 +1800,7 @@ public class WorldGenMonumentPieces {
protected static final IBlockData d = WorldGenMonumentPieces.WorldGenMonumentPiece.b;
2018-10-24 22:26:00 +02:00
protected static final IBlockData e = Blocks.SEA_LANTERN.getBlockData();
protected static final IBlockData f = Blocks.WATER.getBlockData();
2019-01-01 04:15:55 +01:00
- protected static final Set<Block> g = ImmutableSet.builder().add(Blocks.ICE).add(Blocks.PACKED_ICE).add(Blocks.BLUE_ICE).add(WorldGenMonumentPieces.WorldGenMonumentPiece.f.getBlock()).build();
+ protected static final Set<Block> g = ImmutableSet.<Block>builder().add(Blocks.ICE).add(Blocks.PACKED_ICE).add(Blocks.BLUE_ICE).add(WorldGenMonumentPieces.WorldGenMonumentPiece.f.getBlock()).build(); // Paper - decompile fix
2018-10-24 22:26:00 +02:00
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);
2019-01-01 04:15:55 +01:00
@@ -1923,7 +1923,7 @@ public class WorldGenMonumentPieces {
int j1 = this.b(i, k);
if (structureboundingbox.b((BaseBlockPosition) (new BlockPosition(l, i1, j1)))) {
2018-10-24 22:26:00 +02:00
- EntityGuardianElder entityguardianelder = new EntityGuardianElder(generatoraccess.getMinecraftWorld());
+ EntityGuardianElder entityguardianelder = EntityTypes.ELDER_GUARDIAN.create(generatoraccess.getMinecraftWorld()); // Paper
2019-01-01 04:15:55 +01:00
entityguardianelder.heal(entityguardianelder.getMaxHealth());
entityguardianelder.setPositionRotation((double) l + 0.5D, (double) i1, (double) j1 + 0.5D, 0.0F, 0.0F);
2018-10-24 22:26:00 +02:00
diff --git a/src/main/java/net/minecraft/server/WorldGenVillagePieces.java b/src/main/java/net/minecraft/server/WorldGenVillagePieces.java
2019-03-20 01:28:15 +01:00
index 5fa2987d2..967e33b3d 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/WorldGenVillagePieces.java
+++ b/src/main/java/net/minecraft/server/WorldGenVillagePieces.java
2019-01-01 04:15:55 +01:00
@@ -1640,7 +1640,7 @@ public class WorldGenVillagePieces {
2018-10-24 22:26:00 +02:00
++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);
2019-01-01 04:15:55 +01:00
@@ -1648,7 +1648,7 @@ public class WorldGenVillagePieces {
2018-10-24 22:26:00 +02:00
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
2019-03-20 01:28:15 +01:00
index efb0379ce..3d8193c47 100644
2018-10-24 22:26:00 +02:00
--- 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 {
2018-12-08 11:09:55 +01:00
if (structureboundingbox.b((BaseBlockPosition) (new BlockPosition(j, i, k)))) {
2018-10-24 22:26:00 +02:00
this.e = true;
- EntityWitch entitywitch = new EntityWitch(generatoraccess.getMinecraftWorld());
+ EntityWitch entitywitch = EntityTypes.WITCH.create(generatoraccess.getMinecraftWorld()); // Paper
entitywitch.di();
2018-12-08 11:09:55 +01:00
entitywitch.setPositionRotation((double) j + 0.5D, (double) i, (double) k + 0.5D, 0.0F, 0.0F);
2018-10-24 22:26:00 +02:00
diff --git a/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java b/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java
2019-03-20 01:28:15 +01:00
index 11010d8e1..4eb746ebb 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java
+++ b/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java
2019-01-01 04:15:55 +01:00
@@ -23,14 +23,14 @@ public class WorldGenWoodlandMansionPieces {
static class h extends WorldGenWoodlandMansionPieces.f {
private h() {
- super(null);
+ super(); // Paper - decompile fix
2018-10-24 22:26:00 +02:00
}
2019-01-01 04:15:55 +01:00
}
2018-10-24 22:26:00 +02:00
2019-01-01 04:15:55 +01:00
static class f extends WorldGenWoodlandMansionPieces.b {
private f() {
- super(null);
+ super(); // Paper - decompile fix
2018-10-24 22:26:00 +02:00
}
2019-01-01 04:15:55 +01:00
public String a(Random random) {
@@ -65,7 +65,7 @@ public class WorldGenWoodlandMansionPieces {
static class a extends WorldGenWoodlandMansionPieces.b {
2018-10-24 22:26:00 +02:00
2019-01-01 04:15:55 +01:00
private a() {
- super(null);
+ super(); // Paper - decompile fix
}
2018-10-24 22:26:00 +02:00
2019-01-01 04:15:55 +01:00
public String a(Random random) {
@@ -1065,15 +1065,13 @@ public class WorldGenWoodlandMansionPieces {
2018-10-24 22:26:00 +02:00
this.a(generatoraccess, structureboundingbox, random, blockposition, LootTables.o, iblockdata);
} else if ("Mage".equals(s)) {
- EntityEvoker entityevoker = new EntityEvoker(generatoraccess.getMinecraftWorld());
2019-01-01 04:15:55 +01:00
-
2018-10-24 22:26:00 +02:00
+ 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());
2019-01-01 04:15:55 +01:00
-
2018-10-24 22:26:00 +02:00
+ EntityVindicator entityvindicator = EntityTypes.VINDICATOR.create(generatoraccess.getMinecraftWorld()); // Paper
entityvindicator.di();
entityvindicator.setPositionRotation(blockposition, 0.0F, 0.0F);
2019-01-01 04:15:55 +01:00
entityvindicator.prepare(generatoraccess.getDamageScaler(new BlockPosition(entityvindicator)), (GroupDataEntity) null, (NBTTagCompound) null);
2018-10-24 22:26:00 +02:00
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
2019-03-29 07:02:53 +01:00
index 53e7834cc..5c2421ac3 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
2019-03-29 07:02:53 +01:00
@@ -495,7 +495,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
2018-10-24 22:26:00 +02:00
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
2019-03-29 07:02:53 +01:00
index 7c0a53053..40ee34675 100644
2018-10-24 22:26:00 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
2019-01-01 04:15:55 +01:00
@@ -1181,153 +1181,153 @@ public class CraftWorld implements World {
2018-10-24 22:26:00 +02:00
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) {
--
2019-03-20 01:28:15 +01:00
2.21.0
2018-10-24 22:26:00 +02:00