1
0
forked from xjboss/KCauldronX

调整getEntity以及类似函数获取不到死亡的实体

This commit is contained in:
2017-07-07 02:12:24 +08:00
parent 8f7f315790
commit b98b47864d
2 changed files with 31 additions and 6 deletions

View File

@ -776,7 +776,14 @@
if (chunkposition != null)
{
i = chunkposition.chunkPosX;
@@ -876,6 +1083,20 @@
@@ -871,11 +1078,26 @@
public Entity getEntityByID(int p_73045_1_)
{
- return (Entity)this.entityIdMap.lookup(p_73045_1_);
+ Entity entity = (Entity)this.entityIdMap.lookup(p_73045_1_);
+ return entity == null || entity.isDead ? null : entity;
}
public boolean addWeatherEffect(Entity p_72942_1_)
{
@ -797,7 +804,7 @@
if (super.addWeatherEffect(p_72942_1_))
{
this.mcServer.getConfigurationManager().sendToAllNear(p_72942_1_.posX, p_72942_1_.posY, p_72942_1_.posZ, 512.0D, this.provider.dimensionId, new S2CPacketSpawnGlobalEntity(p_72942_1_));
@@ -894,13 +1115,23 @@
@@ -894,13 +1116,23 @@
public Explosion newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_)
{
@ -822,7 +829,7 @@
if (!p_72885_10_)
{
explosion.affectedBlockPositions.clear();
@@ -977,7 +1208,7 @@
@@ -977,7 +1209,7 @@
{
boolean flag = this.isRaining();
super.updateWeather();
@ -831,7 +838,7 @@
if (this.prevRainingStrength != this.rainingStrength)
{
this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(7, this.rainingStrength), this.provider.dimensionId);
@@ -988,10 +1219,6 @@
@@ -988,10 +1220,6 @@
this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(8, this.thunderingStrength), this.provider.dimensionId);
}
@ -842,7 +849,7 @@
if (flag != this.isRaining())
{
if (flag)
@@ -1006,6 +1233,33 @@
@@ -1006,6 +1234,33 @@
this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(7, this.rainingStrength), this.provider.dimensionId);
this.mcServer.getConfigurationManager().sendPacketToAllPlayersInDimension(new S2BPacketChangeGameState(8, this.thunderingStrength), this.provider.dimensionId);
}
@ -876,7 +883,7 @@
}
protected int func_152379_p()
@@ -1069,4 +1323,54 @@
@@ -1069,4 +1324,54 @@
this();
}
}