Skip to content

Commit

Permalink
Enforce Cause to never be empty, removed now unnecessary EmptyCause and
Browse files Browse the repository at this point in the history
PresentCause as Cause itself can remain it's own implementation.

Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
  • Loading branch information
gabizou committed Dec 18, 2015
1 parent 96e12c4 commit f2f7a9c
Show file tree
Hide file tree
Showing 13 changed files with 295 additions and 512 deletions.
Expand Up @@ -84,7 +84,6 @@ private static void translateMapOrList(ConfigurationNode node, DataView containe
} else if (value != null) {
container.set(of(node.getKey().toString()), value);
}

}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/spongepowered/api/entity/Entity.java
Expand Up @@ -303,7 +303,7 @@ public interface Entity extends Identifiable, DataHolder, DataSerializable {
* @return True if damaging the entity was successful
*/
default boolean damage(double damage, DamageSource damageSource) {
return damage(damage, damageSource, Cause.of());
return damage(damage, damageSource, Cause.of(NamedCause.source(damageSource)));
}

/**
Expand Down
Expand Up @@ -4459,14 +4459,12 @@ public static LoadWorldEvent createLoadWorldEvent(Cause cause, World targetWorld
* Creates a new instance of
* {@link org.spongepowered.api.event.world.SaveWorldEvent}.
*
* @param game The game
* @param cause The cause
* @param targetWorld The target world
* @return A new save world event
*/
public static SaveWorldEvent createSaveWorldEvent(Game game, Cause cause, World targetWorld) {
public static SaveWorldEvent createSaveWorldEvent(Cause cause, World targetWorld) {
Map<String, Object> values = Maps.newHashMap();
values.put("game", game);
values.put("cause", cause);
values.put("targetWorld", targetWorld);
return SpongeEventFactoryUtils.createEventImpl(SaveWorldEvent.class, values);
Expand Down

0 comments on commit f2f7a9c

Please sign in to comment.