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

refactor!: overhaul package structure #78

Merged
merged 2 commits into from
Apr 18, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion module.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "Health",
"version": "1.3.0-SNAPSHOT",
"version": "2.0.0-SNAPSHOT",
"isReleaseManaged": true,
"author": "The Terasology Foundation",
"displayName": "Health",
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.module.health.components;

import org.terasology.engine.entitySystem.Component;
import org.terasology.engine.world.block.ForceBlockActive;

/**
* This component is added by the authority to temporary block entities so that they
* can persist for a bit while the block is being damaged.
*/
@ForceBlockActive
public class BlockDamagedComponent implements Component {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.module.health.components;

import org.terasology.engine.entitySystem.Component;
import java.util.Map;

public class DamageResistComponent implements Component {
public Map<String,Float> damageTypes;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.module.health.components;

import com.google.common.collect.Lists;
import org.terasology.engine.audio.StaticSound;
import org.terasology.engine.entitySystem.Component;

import java.util.List;

/**
* Contains list of damage sounds, one of which is played when entity is damaged.
*/
public class DamageSoundComponent implements Component {
public List<StaticSound> sounds = Lists.newArrayList();
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
/*
* Copyright 2019 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.
*/
package org.terasology.logic.health;
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.module.health.components;

import org.terasology.engine.entitySystem.Component;
import org.terasology.engine.network.Replicate;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
// Copyright 2020 The Terasology Foundation
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.logic.health;
package org.terasology.module.health.components;

import com.google.common.collect.Ordering;
import com.google.common.collect.SortedSetMultimap;
import com.google.common.collect.TreeMultimap;
import org.terasology.engine.entitySystem.Component;
import org.terasology.engine.network.Replicate;
import org.terasology.module.health.events.ActivateRegenEvent;
import org.terasology.module.health.events.DeactivateRegenEvent;

import java.util.HashMap;
import java.util.Map;

/**
* Not for direct access! Use regen events instead.
*
* @see org.terasology.logic.health.event.ActivateRegenEvent
* @see org.terasology.logic.health.event.DeactivateRegenEvent
* @see ActivateRegenEvent
* @see DeactivateRegenEvent
*/
public class RegenComponent implements Component {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
// Copyright 2020 The Terasology Foundation
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.logic.health.event;
package org.terasology.module.health.events;

import org.terasology.engine.entitySystem.event.Event;
import org.terasology.module.health.components.HealthComponent;
import org.terasology.module.health.systems.RegenAuthoritySystem;
import org.terasology.module.health.components.RegenComponent;

import static org.terasology.logic.health.RegenAuthoritySystem.BASE_REGEN;
import static org.terasology.module.health.systems.RegenAuthoritySystem.BASE_REGEN;

/**
* Send this event to active regeneration of health points for an entity.
* <p>
* The targeted entity must have a {@link org.terasology.logic.health.HealthComponent} for this event to have an
* The targeted entity must have a {@link HealthComponent} for this event to have an
* effect.
* <p>
* The {@link org.terasology.logic.health.RegenAuthoritySystem} manages regeneration effects and updates affected
* The {@link RegenAuthoritySystem} manages regeneration effects and updates affected
* components every "tick". A tick currently occurs once per second.
*
* @see org.terasology.logic.health.RegenAuthoritySystem
* @see org.terasology.logic.health.RegenComponent
* @see org.terasology.logic.health.HealthComponent
* @see RegenAuthoritySystem
* @see RegenComponent
* @see HealthComponent
*/
public class ActivateRegenEvent implements Event {
/**
Expand All @@ -37,7 +40,7 @@ public class ActivateRegenEvent implements Event {
* Active base regeneration for the target entity.
* <p>
* Base regeneration (or "natural regeneration") is active until the entity is back at full health. The regeneration
* value is typically derived from {@link org.terasology.logic.health.HealthComponent#regenRate}.
* value is typically derived from {@link HealthComponent#regenRate}.
*/
public ActivateRegenEvent(float value) {
this.value = value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
/*
* Copyright 2019 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.
*/
package org.terasology.logic.health.event;
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.module.health.events;

import org.terasology.engine.entitySystem.entity.EntityRef;
import org.terasology.engine.entitySystem.event.AbstractConsumableValueModifiableEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
/*
* Copyright 2019 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.
*/
package org.terasology.logic.health.event;
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.module.health.events;

import org.terasology.engine.entitySystem.entity.EntityRef;
import org.terasology.engine.entitySystem.event.AbstractConsumableValueModifiableEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020 The Terasology Foundation
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.logic.health.event;
package org.terasology.module.health.events;

import org.terasology.engine.entitySystem.event.AbstractValueModifiableEvent;

Expand Down
Loading