MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / spawnEntityInWorld

Method spawnEntityInWorld

src/main/java/net/minecraft/world/World.java:1144–1173  ·  view source on GitHub ↗

Called when an entity is spawned in the world. This includes players.

(Entity entityIn)

Source from the content-addressed store, hash-verified

1142 * Called when an entity is spawned in the world. This includes players.
1143 */
1144 public boolean spawnEntityInWorld(Entity entityIn)
1145 {
1146 int i = MathHelper.floor_double(entityIn.posX / 16.0D);
1147 int j = MathHelper.floor_double(entityIn.posZ / 16.0D);
1148 boolean flag = entityIn.forceSpawn;
1149
1150 if (entityIn instanceof EntityPlayer)
1151 {
1152 flag = true;
1153 }
1154
1155 if (!flag && !this.isChunkLoaded(i, j, true))
1156 {
1157 return false;
1158 }
1159 else
1160 {
1161 if (entityIn instanceof EntityPlayer)
1162 {
1163 EntityPlayer entityplayer = (EntityPlayer)entityIn;
1164 this.playerEntities.add(entityplayer);
1165 this.updateAllPlayersSleepingFlag();
1166 }
1167
1168 this.getChunkFromChunkCoords(i, j).addEntity(entityIn);
1169 this.loadedEntityList.add(entityIn);
1170 this.onEntityAdded(entityIn);
1171 return true;
1172 }
1173 }
1174
1175 protected void onEntityAdded(Entity entityIn)
1176 {

Callers 15

dispenseStackMethod · 0.95
dispenseStackMethod · 0.95
processCommandMethod · 0.95
updateTaskMethod · 0.95
dispenseStackMethod · 0.95
onItemRightClickMethod · 0.45
onItemRightClickMethod · 0.45
onItemUseMethod · 0.45
onItemRightClickMethod · 0.45
onItemRightClickMethod · 0.45
onItemRightClickMethod · 0.45
onPlayerStoppedUsingMethod · 0.45

Calls 7

floor_doubleMethod · 0.95
isChunkLoadedMethod · 0.95
onEntityAddedMethod · 0.95
addMethod · 0.45
addEntityMethod · 0.45

Tested by

no test coverage detected