mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-24 05:21:16 +00:00
convert a bunch of stuff to new APIs
This commit is contained in:
+1
-1
@@ -95,7 +95,7 @@ public final class TerraMinestomPlatform extends AbstractPlatform {
|
||||
|
||||
MinecraftServer.getInstanceManager().getInstances().forEach(world -> {
|
||||
if(world.generator() instanceof MinestomChunkGeneratorWrapper wrapper) {
|
||||
getConfigRegistry().get(wrapper.getPack().getRegistryKey()).ifPresent(pack -> {
|
||||
getConfigRegistry().get(wrapper.getPack().getRegistryKey()).consume(pack -> {
|
||||
wrapper.setPack(pack);
|
||||
LOGGER.info("Replaced pack in chunk generator for instance {}", world.getUuid());
|
||||
});
|
||||
|
||||
+2
-2
@@ -39,14 +39,14 @@ public class TerraMinestomWorldBuilder {
|
||||
}
|
||||
|
||||
public TerraMinestomWorldBuilder packById(String id) {
|
||||
this.pack = platform.getConfigRegistry().getByID(id).orElseThrow();
|
||||
this.pack = platform.getConfigRegistry().getByID(id).collectThrow(RuntimeException::new);
|
||||
return this;
|
||||
}
|
||||
|
||||
public TerraMinestomWorldBuilder packByMeta(String metaPack, RegistryKey<@NonNull DimensionType> dimensionType) {
|
||||
this.pack = platform.getMetaConfigRegistry()
|
||||
.getByID(metaPack)
|
||||
.orElseThrow(() -> new RuntimeException("MetaPack " + metaPack + " could not be found"))
|
||||
.collectThrow(left -> new RuntimeException("MetaPack " + metaPack + " could not be found: " + left))
|
||||
.packs()
|
||||
.get(dimensionType.key().asString());
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user