Skip to content

Commit

Permalink
feat: Case-insensitive biome id and fix Core reference (#1)
Browse files Browse the repository at this point in the history
* feat: Use Name instead String for biome ids
* chore: update module version and dependencies
* chore: upgrade `CoreAssets` dependency to 2.0.1

Co-authored-by: Niruandaleth <[email protected]>
  • Loading branch information
skaldarnar and jdrueckert committed May 17, 2020
1 parent 6dc0206 commit 1eacc18
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 27 deletions.
30 changes: 12 additions & 18 deletions module.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
{
"id": "CoreWorlds",
"version": "1.0.0",
"isReleaseManaged": true,
"author": "The Terasology Foundation",
"displayName": "CoreWorlds",
"description": "A basic set of world generators and facets.",
"dependencies": [
{
"id": "BiomesAPI",
"minVersion": "3.0.0"
},
{
"id": "CoreAssets",
"minVersion": "2.0.0"
}
],
"serverSideOnly": false,
"isWorld": true
"id": "CoreWorlds",
"version": "1.1.0",
"isReleaseManaged": true,
"author": "The Terasology Foundation",
"displayName": "CoreWorlds",
"description": "A basic set of world generators and facets.",
"dependencies": [
{ "id": "BiomesAPI", "minVersion": "4.0.0" },
{ "id": "CoreAssets", "minVersion": "2.0.1" }
],
"serverSideOnly": false,
"isWorld": true
}
19 changes: 10 additions & 9 deletions src/main/java/org/terasology/core/world/CoreBiome.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.terasology.core.world;

import org.terasology.biomesAPI.Biome;
import org.terasology.naming.Name;

public enum CoreBiome implements Biome {
MOUNTAINS("Mountains"),
Expand All @@ -26,27 +27,27 @@ public enum CoreBiome implements Biome {
BEACH("Beach"),
PLAINS("Plains");

private final String id;
private final String name;
private final Name id;
private final String displayName;

CoreBiome(String name) {
this.id = "Core:" + name().toLowerCase();
this.name = name;
CoreBiome(String displayName) {
this.id = new Name("CoreWorlds:" + name());
this.displayName = displayName;
}

@Override
public String getId() {
public Name getId() {
return id;
}

@Override
public String getName() {
return this.name;
public String getDisplayName() {
return this.displayName;
}

@Override
public String toString() {
return this.name;
return this.displayName;
}

}

0 comments on commit 1eacc18

Please sign in to comment.