Melt Mojang registry back, restore biome features
This commit is contained in:
parent
b0da1d244a
commit
00d65c2f6d
3 changed files with 22 additions and 9 deletions
|
@ -0,0 +1,17 @@
|
||||||
|
package ru.betterend.mixin.common;
|
||||||
|
|
||||||
|
import net.minecraft.core.MappedRegistry;
|
||||||
|
import net.minecraft.resources.ResourceKey;
|
||||||
|
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(MappedRegistry.class)
|
||||||
|
public class MappedRegistryMixin<T> {
|
||||||
|
// TODO Make this a part of BCLib (implement froze/unfroze methods)
|
||||||
|
@Inject(method = "validateWrite", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void be_validateWrite(ResourceKey<T> resourceKey, CallbackInfo info) {
|
||||||
|
info.cancel();
|
||||||
|
}
|
||||||
|
}
|
|
@ -305,9 +305,6 @@ public class EndFeatures {
|
||||||
|
|
||||||
private static BCLFeature registerLayer(String name, Block block, float radius, int minY, int maxY, int count) {
|
private static BCLFeature registerLayer(String name, Block block, float radius, int minY, int maxY, int count) {
|
||||||
OreLayerFeature layer = new OreLayerFeature(block.defaultBlockState(), radius, minY, maxY);
|
OreLayerFeature layer = new OreLayerFeature(block.defaultBlockState(), radius, minY, maxY);
|
||||||
//PlacedFeature configured = layer.configured(FeatureConfiguration.NONE).placed(new PlacementModifier[]{CountPlacement.of(count)});
|
|
||||||
// return new BCLFeature(BetterEnd.makeID(name), layer, GenerationStep.Decoration.UNDERGROUND_ORES, configured);
|
|
||||||
|
|
||||||
return BCLFeatureBuilder
|
return BCLFeatureBuilder
|
||||||
.start(BetterEnd.makeID(name), layer)
|
.start(BetterEnd.makeID(name), layer)
|
||||||
.decoration( GenerationStep.Decoration.UNDERGROUND_ORES)
|
.decoration( GenerationStep.Decoration.UNDERGROUND_ORES)
|
||||||
|
@ -326,11 +323,10 @@ public class EndFeatures {
|
||||||
BiomeAPI.addBiomeFeature(biome, CRASHED_SHIP);
|
BiomeAPI.addBiomeFeature(biome, CRASHED_SHIP);
|
||||||
|
|
||||||
BCLBiome bclbiome = BiomeAPI.getBiome(id);
|
BCLBiome bclbiome = BiomeAPI.getBiome(id);
|
||||||
//TODO: 1.18.2 - Not sure what this code is supposed to do....
|
BCLFeature feature = getBiomeStructures(bclbiome);
|
||||||
// BCLFeature feature = getBiomeStructures(bclbiome);
|
if (feature != null) {
|
||||||
// if (feature != null) {
|
BiomeAPI.addBiomeFeature(biome, feature);
|
||||||
// BiomeAPI.addBiomeFeature(biome, feature);
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
if (id.getNamespace().equals(BetterEnd.MOD_ID)) {
|
if (id.getNamespace().equals(BetterEnd.MOD_ID)) {
|
||||||
return;
|
return;
|
||||||
|
@ -353,7 +349,6 @@ public class EndFeatures {
|
||||||
if (BuiltinRegistries.PLACED_FEATURE.containsKey(id)) {
|
if (BuiltinRegistries.PLACED_FEATURE.containsKey(id)) {
|
||||||
PlacedFeature placed = BuiltinRegistries.PLACED_FEATURE.get(id);
|
PlacedFeature placed = BuiltinRegistries.PLACED_FEATURE.get(id);
|
||||||
Feature<?> feature = Registry.FEATURE.get(id);
|
Feature<?> feature = Registry.FEATURE.get(id);
|
||||||
//return new BCLFeature(id, feature, Decoration.SURFACE_STRUCTURES, placed);
|
|
||||||
return BCLFeatureBuilder
|
return BCLFeatureBuilder
|
||||||
.start(id, feature)
|
.start(id, feature)
|
||||||
.decoration(Decoration.SURFACE_STRUCTURES)
|
.decoration(Decoration.SURFACE_STRUCTURES)
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
"ChorusPlantBlockMixin",
|
"ChorusPlantBlockMixin",
|
||||||
"EndPodiumFeatureMixin",
|
"EndPodiumFeatureMixin",
|
||||||
"EndDragonFightMixin",
|
"EndDragonFightMixin",
|
||||||
|
"MappedRegistryMixin",
|
||||||
"WorldGenRegionMixin",
|
"WorldGenRegionMixin",
|
||||||
"BlockBehaviourMixin",
|
"BlockBehaviourMixin",
|
||||||
"NoiseChunkAccessor",
|
"NoiseChunkAccessor",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue