-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67be2ce
commit 895b605
Showing
6 changed files
with
103 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
src/main/java/ru/bclib/mixin/common/InternalBiomeDataMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package ru.bclib.mixin.common; | ||
|
||
import net.fabricmc.fabric.impl.biome.InternalBiomeData; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.minecraft.world.level.biome.Biome; | ||
import net.minecraft.world.level.biome.Biomes; | ||
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; | ||
import ru.bclib.world.biomes.FabricBiomesData; | ||
|
||
@Mixin(value = InternalBiomeData.class, remap = false) | ||
public class InternalBiomeDataMixin { | ||
@Inject(method = "addEndBiomeReplacement", at = @At(value = "HEAD")) | ||
private static void bclib_addEndBiomeReplacement(ResourceKey<Biome> replaced, ResourceKey<Biome> variant, double weight, CallbackInfo info) { | ||
if (replaced == Biomes.END_BARRENS || replaced == Biomes.SMALL_END_ISLANDS) { | ||
FabricBiomesData.END_VOID_BIOMES.put(variant, (float) weight); | ||
} | ||
else { | ||
FabricBiomesData.END_LAND_BIOMES.put(variant, (float) weight); | ||
} | ||
} | ||
|
||
@Inject(method = "addEndMidlandsReplacement", at = @At(value = "HEAD")) | ||
private static void bclib_addEndMidlandsReplacement(ResourceKey<Biome> highlands, ResourceKey<Biome> midlands, double weight, CallbackInfo info) { | ||
FabricBiomesData.END_LAND_BIOMES.put(midlands, (float) weight); | ||
} | ||
|
||
@Inject(method = "addEndBarrensReplacement", at = @At(value = "HEAD")) | ||
private static void bclib_addEndBarrensReplacement(ResourceKey<Biome> highlands, ResourceKey<Biome> barrens, double weight, CallbackInfo info) { | ||
FabricBiomesData.END_LAND_BIOMES.put(barrens, (float) weight); | ||
FabricBiomesData.END_VOID_BIOMES.put(barrens, (float) weight); | ||
} | ||
|
||
@Inject(method = "addNetherBiome", at = @At(value = "HEAD")) | ||
private static void bclib_addNetherBiome(ResourceKey<Biome> biome, Biome.ClimateParameters spawnNoisePoint, CallbackInfo info) { | ||
FabricBiomesData.NETHER_BIOMES.add(biome); | ||
} | ||
} |
37 changes: 0 additions & 37 deletions
37
src/main/java/ru/bclib/mixin/common/WeightedBiomePickerMixin.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package ru.bclib.world.biomes; | ||
|
||
import com.google.common.collect.Maps; | ||
import com.google.common.collect.Sets; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.minecraft.world.level.biome.Biome; | ||
|
||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
public class FabricBiomesData { | ||
public static final Map<ResourceKey<Biome>, Float> END_LAND_BIOMES = Maps.newHashMap(); | ||
public static final Map<ResourceKey<Biome>, Float> END_VOID_BIOMES = Maps.newHashMap(); | ||
public static final Set<ResourceKey<Biome>> NETHER_BIOMES = Sets.newHashSet(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters