Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix checkstyle issues #10

Merged
merged 1 commit into from
Oct 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/main/java/org/terasology/spawning/SpawnableComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

/**
* Component that enables an entity to be spawned by something.
*
* @author Rasmus 'Cervator' Praestholm <cervator@gmail.com>
*/
public class SpawnableComponent implements Component<SpawnableComponent> {

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/terasology/spawning/SpawnerComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cervator@gmail.com>
*/
@ForceBlockActive
public class SpawnerComponent implements Component<SpawnerComponent> {
Expand Down
28 changes: 8 additions & 20 deletions src/main/java/org/terasology/spawning/SpawnerSystem.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -48,8 +35,6 @@

/**
* System that handles spawning of stuff
*
* @author Rasmus 'Cervator' Praestholm <cervator@gmail.com>
*/
@RegisterSystem(RegisterMode.AUTHORITY)
public class SpawnerSystem extends BaseComponentSystem implements UpdateSubscriberSystem {
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down