mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
Ephemeral -> Placeholder
This commit is contained in:
@@ -48,7 +48,7 @@ public class PipelineBiomeProvider implements BiomeProvider {
|
||||
this.biomes = new HashSet<>();
|
||||
Iterable<PipelineBiome> finalResult = result;
|
||||
result.forEach(pipelineBiome -> {
|
||||
if(pipelineBiome.isEphemeral()) {
|
||||
if(pipelineBiome.isPlaceholder()) {
|
||||
|
||||
StringBuilder biomeList = new StringBuilder("\n");
|
||||
StreamSupport.stream(finalResult.spliterator(), false)
|
||||
@@ -59,8 +59,8 @@ public class PipelineBiomeProvider implements BiomeProvider {
|
||||
.append(':')
|
||||
.append(delegate.getClass().getCanonicalName())
|
||||
.append('\n'));
|
||||
throw new IllegalArgumentException("Biome Pipeline leaks ephemeral biome \"" + pipelineBiome.getID() +
|
||||
"\". Ensure there is a stage to guarantee replacement of the ephemeral biome. Biomes: " +
|
||||
throw new IllegalArgumentException("Biome Pipeline leaks placeholder biome \"" + pipelineBiome.getID() +
|
||||
"\". Ensure there is a stage to guarantee replacement of the placeholder biome. Biomes: " +
|
||||
biomeList);
|
||||
}
|
||||
this.biomes.add(pipelineBiome.getBiome());
|
||||
|
||||
@@ -9,8 +9,8 @@ import com.dfsek.terra.api.world.biome.Biome;
|
||||
public interface PipelineBiome extends StringIdentifiable {
|
||||
Biome getBiome();
|
||||
|
||||
static PipelineBiome ephemeral(String id) {
|
||||
return new EphemeralPipelineBiome(id);
|
||||
static PipelineBiome placeholder(String id) {
|
||||
return new PlaceholderPipelineBiome(id);
|
||||
}
|
||||
|
||||
static PipelineBiome from(Biome biome) {
|
||||
@@ -23,7 +23,7 @@ public interface PipelineBiome extends StringIdentifiable {
|
||||
|
||||
Set<String> getTags();
|
||||
|
||||
default boolean isEphemeral() {
|
||||
default boolean isPlaceholder() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ import java.util.Set;
|
||||
import com.dfsek.terra.api.world.biome.Biome;
|
||||
|
||||
|
||||
final class EphemeralPipelineBiome implements PipelineBiome {
|
||||
final class PlaceholderPipelineBiome implements PipelineBiome {
|
||||
private final Set<String> tags;
|
||||
private final String id;
|
||||
|
||||
public EphemeralPipelineBiome(String id) {
|
||||
public PlaceholderPipelineBiome(String id) {
|
||||
this.id = id;
|
||||
tags = new HashSet<>();
|
||||
tags.add(id);
|
||||
@@ -19,7 +19,7 @@ final class EphemeralPipelineBiome implements PipelineBiome {
|
||||
|
||||
@Override
|
||||
public Biome getBiome() {
|
||||
throw new UnsupportedOperationException("Cannot get biome from ephemeral delegate");
|
||||
throw new UnsupportedOperationException("Cannot get raw biome from placeholder pipeline biome");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -33,7 +33,7 @@ final class EphemeralPipelineBiome implements PipelineBiome {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEphemeral() {
|
||||
public boolean isPlaceholder() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ final class EphemeralPipelineBiome implements PipelineBiome {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if(!(obj instanceof EphemeralPipelineBiome that)) return false;
|
||||
if(!(obj instanceof PlaceholderPipelineBiome that)) return false;
|
||||
|
||||
return this.id.equals(that.id);
|
||||
}
|
||||
@@ -24,7 +24,7 @@ final class SelfPipelineBiome implements PipelineBiome {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEphemeral() {
|
||||
public boolean isPlaceholder() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,6 @@ public class PipelineBiomeLoader implements TypeLoader<PipelineBiome> {
|
||||
return biomeRegistry
|
||||
.getByID((String) c)
|
||||
.map(PipelineBiome::from)
|
||||
.orElseGet(() -> PipelineBiome.ephemeral((String) c));
|
||||
.orElseGet(() -> PipelineBiome.placeholder((String) c));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user