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