-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
Refactor ore gen for 1.16.2
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package eu.midnightdust.motschen.dishes; | ||
|
||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.registry.BuiltinRegistries; | ||
import net.minecraft.util.registry.Registry; | ||
import net.minecraft.world.gen.feature.ConfiguredFeature; | ||
import net.minecraft.world.gen.feature.Feature; | ||
import net.minecraft.world.gen.feature.OreFeatureConfig; | ||
|
||
public class OreFeatures { | ||
public static final ConfiguredFeature<?, ?> SALT_ORE_FEATURE = Feature.ORE.configure(new OreFeatureConfig(OreFeatureConfig.Rules.BASE_STONE_OVERWORLD, DishesMain.SaltOre.getDefaultState(), 4)).method_30377(120).spreadHorizontally().repeat(20); | ||
|
||
public static void init() { | ||
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new Identifier(DishesMain.MOD_ID, "salt_ore"), SALT_ORE_FEATURE); | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package eu.midnightdust.motschen.dishes.mixin; | ||
|
||
import eu.midnightdust.motschen.dishes.OreFeatures; | ||
import net.minecraft.world.biome.GenerationSettings.Builder; | ||
import net.minecraft.world.gen.GenerationStep; | ||
import net.minecraft.world.gen.feature.DefaultBiomeFeatures; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(DefaultBiomeFeatures.class) | ||
public class DefaultBiomeFeaturesMixin { | ||
@Inject(at = @At("RETURN"), method = "addDefaultOres") | ||
private static void addDefaultOres(Builder builder, CallbackInfo info) { | ||
builder.feature(GenerationStep.Feature.UNDERGROUND_ORES, OreFeatures.SALT_ORE_FEATURE); | ||
} | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.