11/*
22 * Copyright (c) 2016, 2017, 2018, 2019 FabricMC
3+ * Copyright 2022 The Quilt Project
34 *
45 * Licensed under the Apache License, Version 2.0 (the "License");
56 * you may not use this file except in compliance with the License.
2122import java .util .function .Predicate ;
2223
2324import org .jetbrains .annotations .ApiStatus ;
25+ import org .quiltmc .qsl .worldgen .biome .impl .modification .BiomeModificationImpl ;
2426
2527import net .minecraft .util .Identifier ;
2628
27- import net .fabricmc .fabric .impl .biome .modification .BiomeModificationImpl ;
28-
2929/**
3030 * Provides methods for modifying biomes. To create an instance, call
3131 * {@link BiomeModifications#create(Identifier)}.
3232 *
3333 * @see BiomeModifications
34+ * @deprecated see {@link org.quiltmc.qsl.worldgen.biome.api.BiomeModification}.
3435 */
36+ @ Deprecated
3537public class BiomeModification {
3638 private final Identifier id ;
3739
@@ -45,8 +47,14 @@ public class BiomeModification {
4547 * for this are modifiers that simply add or remove features unconditionally, or change other values
4648 * to constants.
4749 */
50+ @ SuppressWarnings ("unchecked" )
4851 public BiomeModification add (ModificationPhase phase , Predicate <BiomeSelectionContext > selector , Consumer <BiomeModificationContext > modifier ) {
49- BiomeModificationImpl .INSTANCE .addModifier (id , phase , selector , modifier );
52+ BiomeModificationImpl .INSTANCE .addModifier (
53+ id ,
54+ phase .toQuilt (),
55+ (Predicate <org .quiltmc .qsl .worldgen .biome .api .BiomeSelectionContext >) (Object ) selector ,
56+ (Consumer <org .quiltmc .qsl .worldgen .biome .api .BiomeModificationContext >) (Object ) modifier
57+ );
5058 return this ;
5159 }
5260
@@ -58,8 +66,14 @@ public BiomeModification add(ModificationPhase phase, Predicate<BiomeSelectionCo
5866 * conditions to the selector, and use a context-free modifier instead, as this will greatly help
5967 * with debugging world generation issues.
6068 */
69+ @ SuppressWarnings ("unchecked" )
6170 public BiomeModification add (ModificationPhase phase , Predicate <BiomeSelectionContext > selector , BiConsumer <BiomeSelectionContext , BiomeModificationContext > modifier ) {
62- BiomeModificationImpl .INSTANCE .addModifier (id , phase , selector , modifier );
71+ BiomeModificationImpl .INSTANCE .addModifier (
72+ id ,
73+ phase .toQuilt (),
74+ (Predicate <org .quiltmc .qsl .worldgen .biome .api .BiomeSelectionContext >) (Object ) selector ,
75+ (BiConsumer <org .quiltmc .qsl .worldgen .biome .api .BiomeSelectionContext , org .quiltmc .qsl .worldgen .biome .api .BiomeModificationContext >) (Object ) modifier
76+ );
6377 return this ;
6478 }
6579}
0 commit comments