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

Method createEntity

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

Makes sense only for point entities

(SubgameEntity creator, List<String> args, GameExportsImpl gameExports)

Source from the content-addressed store, hash-verified

1085 * Makes sense only for point entities
1086 */
1087 public static void createEntity(SubgameEntity creator, List<String> args, GameExportsImpl gameExports) {
1088 // hack: join back all the arguments, quoting keys and values
1089 // no comments are expected here
1090 String entities = args.stream()
1091 .skip(1)
1092 .filter(s -> !s.equals("}") && !s.equals("{"))
1093 .map(s -> '"' + s + '"')
1094 .collect(Collectors.joining(" ", "{", "}"));
1095
1096 // actually we expect 1 entity
1097 EntityParserKt.parseEntities(entities).forEach(entity -> {
1098 SubgameEntity newThing = gameExports.G_Spawn();
1099 entity.forEach((key, value) -> ED_ParseField(key, value, newThing, gameExports));
1100 putInFrontOfCreator(creator, newThing);
1101 ED_CallSpawn(newThing, gameExports);
1102 });
1103 }
1104}

Callers 1

ClientCommandMethod · 0.95

Calls 5

ED_ParseFieldMethod · 0.95
putInFrontOfCreatorMethod · 0.95
ED_CallSpawnMethod · 0.95
G_SpawnMethod · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected