MCPcopy Create free account
hub / github.com/demoth/jake2 / ED_CallSpawn

Method ED_CallSpawn

game/src/main/java/jake2/game/GameSpawn.java:1002–1026  ·  view source on GitHub ↗

Finds the spawn function for the entity and calls it.

(SubgameEntity ent, GameExportsImpl gameExports)

Source from the content-addressed store, hash-verified

1000 * Finds the spawn function for the entity and calls it.
1001 */
1002 public static void ED_CallSpawn(SubgameEntity ent, GameExportsImpl gameExports) {
1003
1004 if (null == ent.classname) {
1005 gameExports.gameImports.dprintf("ED_CallSpawn: null classname\n");
1006 return;
1007 }
1008
1009 // check item spawn functions
1010 var item = gameExports.items.stream()
1011 .filter(it -> ent.classname.equals(it.classname))
1012 .findFirst();
1013 if (item.isPresent()) {
1014 GameItems.SpawnItem(ent, item.get(), gameExports);
1015 return;
1016 }
1017
1018 // check normal spawn functions
1019 var spawn = spawns.get(ent.classname.toLowerCase());
1020 if (spawn != null) {
1021 spawn.spawn(ent, gameExports);
1022 ent.st = null;
1023 } else {
1024 gameExports.gameImports.dprintf(ent.classname + " doesn't have a spawn function\n");
1025 }
1026 }
1027
1028
1029 static String[] mobs = { "monster_berserk", "monster_gladiator", "monster_gunner", "monster_infantry", "monster_soldier_light", "monster_soldier", "monster_soldier_ss", "monster_tank", "monster_tank_commander", "monster_medic", "monster_chick", "monster_parasite", "monster_flyer", "monster_brain", "monster_floater", "monster_mutant"};

Callers 4

SpawnEntitiesMethod · 0.95
createEntityMethod · 0.95
thinkMethod · 0.95
targetEntities.ktFile · 0.80

Calls 5

SpawnItemMethod · 0.95
spawnMethod · 0.80
dprintfMethod · 0.65
equalsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected