diff --git a/src/main/java/org/terasology/spawning/SpawnableComponent.java b/src/main/java/org/terasology/spawning/SpawnableComponent.java index c90c312..29eb06a 100644 --- a/src/main/java/org/terasology/spawning/SpawnableComponent.java +++ b/src/main/java/org/terasology/spawning/SpawnableComponent.java @@ -10,8 +10,6 @@ /** * Component that enables an entity to be spawned by something. - * - * @author Rasmus 'Cervator' Praestholm */ public class SpawnableComponent implements Component { diff --git a/src/main/java/org/terasology/spawning/SpawnerComponent.java b/src/main/java/org/terasology/spawning/SpawnerComponent.java index 499de45..27d909d 100644 --- a/src/main/java/org/terasology/spawning/SpawnerComponent.java +++ b/src/main/java/org/terasology/spawning/SpawnerComponent.java @@ -12,8 +12,6 @@ * Component that enables an entity to be a spawner of something. * It forces any block it attaches to "active" so it'll maintain a BlockComponent for location purposes. * However other entities can be valid spawners as well, such as creatures that have a LocationComponent. - * - * @author Rasmus 'Cervator' Praestholm */ @ForceBlockActive public class SpawnerComponent implements Component { diff --git a/src/main/java/org/terasology/spawning/SpawnerSystem.java b/src/main/java/org/terasology/spawning/SpawnerSystem.java index 4ff99aa..dcae8b1 100644 --- a/src/main/java/org/terasology/spawning/SpawnerSystem.java +++ b/src/main/java/org/terasology/spawning/SpawnerSystem.java @@ -1,18 +1,5 @@ -/* - * Copyright 2015 MovingBlocks - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2021 The Terasology Foundation +// SPDX-License-Identifier: Apache-2.0 package org.terasology.spawning; import com.google.common.collect.HashMultimap; @@ -48,8 +35,6 @@ /** * System that handles spawning of stuff - * - * @author Rasmus 'Cervator' Praestholm */ @RegisterSystem(RegisterMode.AUTHORITY) public class SpawnerSystem extends BaseComponentSystem implements UpdateSubscriberSystem { @@ -154,7 +139,7 @@ public void onRemovedSpawner(BeforeRemoveComponent event, EntityRef spawner) { * @param event the PeriodicActionTriggeredEvent from the scheduler to react to. * @param spawner the spawner entity about to be processed. */ - @ReceiveEvent(components = {SpawnerComponent.class}) + @ReceiveEvent(components = SpawnerComponent.class) public void onSpawn(PeriodicActionTriggeredEvent event, EntityRef spawner) { logger.info("Spawner {} is ticking", spawner); } @@ -230,7 +215,9 @@ public void update(float delta) { if (spawnerComp.rangedSpawning) { // Add random range on the x and z planes, leave y (height) unchanged for now - spawnPos = new Vector3f(originPos.x + random.nextFloat() * spawnerComp.range, originPos.y, originPos.z + random.nextFloat() * spawnerComp.range); + spawnPos = new Vector3f(originPos.x + random.nextFloat() * spawnerComp.range, + originPos.y, + originPos.z + random.nextFloat() * spawnerComp.range); // If a minimum distance is set make sure we're beyond it if (spawnerComp.minDistance != 0) { @@ -277,7 +264,8 @@ public void update(float delta) { int anotherRandomIndex = random.nextInt(randomType.size()); Object[] randomPrefabs = randomType.toArray(); Prefab chosenPrefab = (Prefab) randomPrefabs[anotherRandomIndex]; - logger.info("Picked index {} of types {} which is a {}, to spawn at {}", anotherRandomIndex, chosenSpawnerType, chosenPrefab, spawnPos); + logger.info("Picked index {} of types {} which is a {}, to spawn at {}", + anotherRandomIndex, chosenSpawnerType, chosenPrefab, spawnPos); // Finally create the Spawnable. Assign parentage so we can tie Spawnables to their Spawner if needed EntityRef newSpawnableRef = entityManager.create(chosenPrefab, spawnPos);