Skip to content

Commit

Permalink
Level biome source fix (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulevsGitch committed Aug 10, 2021
1 parent 708c4d6 commit 8bea55a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 340 deletions.
21 changes: 20 additions & 1 deletion src/main/java/ru/betterend/DataFixer.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package ru.betterend;

import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtIo;
import ru.bclib.api.datafixer.DataFixerAPI;
import ru.bclib.api.datafixer.Patch;
import ru.bclib.api.datafixer.PatchFunction;

import java.io.File;

public class DataFixer {
public static void register() {
Expand All @@ -13,7 +18,21 @@ public static void register() {
private static final class BetterEndPatch extends Patch {
protected BetterEndPatch() {
super(BetterEnd.MOD_ID, "0.11.0");
System.out.println("BE Patch!");
}

/*public PatchFunction<CompoundTag, Boolean> getLevelDatPatcher() {
return (root, profile) -> {
CompoundTag dimensions = root.getCompound("Data").getCompound("WorldGenSettings").getCompound("dimensions");
if (dimensions.contains("minecraft:the_end")) {
CompoundTag biomeSource = dimensions.getCompound("minecraft:the_end").getCompound("generator").getCompound("biome_source");
if (!biomeSource.getString("type").equals("betterend:better_end_biome_source")) {
BetterEnd.LOGGER.info("Applying biome source patch");
biomeSource.putString("type", "betterend:better_end_biome_source");
return true;
}
}
return false;
};
}*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,17 @@ private void be_createLevels(ChunkProgressListener worldGenerationProgressListen
}

@Shadow
private static void setInitialSpawn(ServerLevel serverLevel, ServerLevelData serverLevelData, boolean bl, boolean bl2) {
}

;
private static void setInitialSpawn(ServerLevel serverLevel, ServerLevelData serverLevelData, boolean bl, boolean bl2) {}

@Inject(method = "setInitialSpawn", at = @At(value = "HEAD"), cancellable = true)
private static void be_setInitialSpawn(ServerLevel world, ServerLevelData serverWorldProperties, boolean bonusChest, boolean debugWorld, CallbackInfo info) {
if (GeneratorOptions.swapOverworldToEnd() && world.dimension() == Level.OVERWORLD) {
info.cancel();
}
if (GeneratorOptions.changeSpawn() && world.dimension() == Level.END) {
world.setDefaultSpawnPos(GeneratorOptions.getSpawn(), 0F);
info.cancel();
}
}


Expand Down
332 changes: 0 additions & 332 deletions src/main/java/ru/betterend/mixin/common/PlayerListMixin.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/resources/assets/betterend/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"block.betterend.dense_vine": "Dense Vine",
"block.betterend.bubble_coral": "Bubble Coral",
"block.betterend.aurora_crystal": "Aurora Crystal",
"item.betterend.crystal_shards": "Crystal Shards",
"item.betterend.crystal_shards": "Aurora Crystal Shards",

"block.betterend.pythadendron_sapling": "Pythadendron Sapling",
"block.betterend.pythadendron_bark": "Pythadendron Bark",
Expand Down
Loading

0 comments on commit 8bea55a

Please sign in to comment.