Skip to content

Commit

Permalink
fix(ecs-gestalt): Migrate Components to gestalt's Components. (#8)
Browse files Browse the repository at this point in the history
Ref: MovingBlocks/Terasology#4753

Co-authored-by: Tobias Nett <skaldarnar@googlemail.com>
  • Loading branch information
DarkWeird and skaldarnar committed Aug 26, 2021
1 parent 7a14e14 commit cbc54ad
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/org/terasology/AlchemyPlantProvider.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright 2020 The Terasology Foundation
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology;

import org.terasology.engine.entitySystem.Component;
import org.terasology.engine.utilities.procedural.Noise;
import org.terasology.engine.utilities.procedural.WhiteNoise;
import org.terasology.engine.world.generation.Border3D;
Expand All @@ -15,6 +14,7 @@
import org.terasology.engine.world.generation.Requires;
import org.terasology.engine.world.generation.facets.SurfacesFacet;
import org.terasology.engine.world.generator.plugin.RegisterPlugin;
import org.terasology.gestalt.entitysystem.component.Component;
import org.terasology.nui.properties.Range;

import java.util.HashMap;
Expand Down Expand Up @@ -86,8 +86,13 @@ public void setConfiguration(Component configuration) {
this.configuration = (AlchemyPlantConfiguration) configuration;
}

private static class AlchemyPlantConfiguration implements Component {
private static class AlchemyPlantConfiguration implements Component<AlchemyPlantConfiguration> {
@Range(min = 0.0f, max = 100f, increment = 25f, precision = 1, description = "Plant Rarity")
private float plantRarity = 50f;

@Override
public void copyFrom(AlchemyPlantConfiguration other) {
this.plantRarity = other.plantRarity;
}
}
}

0 comments on commit cbc54ad

Please sign in to comment.