Data fixer enhancements, new textures

This commit is contained in:
paulevsGitch 2021-03-13 17:00:52 +03:00
parent 2aa08604bd
commit 24280e7649
11 changed files with 7 additions and 6 deletions

View file

@ -33,11 +33,8 @@ public class ServerWorldMixin {
private void be_onServerWorldInit(MinecraftServer server, Executor workerExecutor, LevelStorage.Session session, ServerWorldProperties properties, RegistryKey<World> registryKey, DimensionType dimensionType, WorldGenerationProgressListener worldGenerationProgressListener, ChunkGenerator chunkGenerator, boolean debugWorld, long l, List<Spawner> list, boolean bl, CallbackInfo info) { private void be_onServerWorldInit(MinecraftServer server, Executor workerExecutor, LevelStorage.Session session, ServerWorldProperties properties, RegistryKey<World> registryKey, DimensionType dimensionType, WorldGenerationProgressListener worldGenerationProgressListener, ChunkGenerator chunkGenerator, boolean debugWorld, long l, List<Spawner> list, boolean bl, CallbackInfo info) {
File beData = new File(FabricLoader.getInstance().getGameDir().getParent().toString(), "saves/" + properties.getLevelName() + "/betterend_data.nbt"); File beData = new File(FabricLoader.getInstance().getGameDir().getParent().toString(), "saves/" + properties.getLevelName() + "/betterend_data.nbt");
ModMetadata meta = FabricLoader.getInstance().getModContainer(BetterEnd.MOD_ID).get().getMetadata(); ModMetadata meta = FabricLoader.getInstance().getModContainer(BetterEnd.MOD_ID).get().getMetadata();
String version = meta.getVersion().toString(); String version = BetterEnd.isDevEnvironment() ? "development" : meta.getVersion().toString();
boolean fix = false; boolean fix = false;
if (version.equals("${version}")) {
version = "development";
}
if (beData.exists()) { if (beData.exists()) {
CompoundTag root; CompoundTag root;
try { try {

View file

@ -19,12 +19,16 @@ public class DataFixerUtil {
private static final Map<String, String> REPLACEMENT = Maps.newHashMap(); private static final Map<String, String> REPLACEMENT = Maps.newHashMap();
public static void init() { public static void init() {
addFix("minecraft:stone", "minecraft:glowstone"); //addFix("minecraft:stone", "minecraft:glowstone"); // Example
} }
public static void fixData(File dir) { public static void fixData(File dir) {
if (REPLACEMENT.isEmpty()) {
return;
}
List<File> regions = getAllRegions(dir, null); List<File> regions = getAllRegions(dir, null);
regions.forEach((file) -> { regions.parallelStream().forEach((file) -> {
try { try {
System.out.println("Fixing " + file); System.out.println("Fixing " + file);
boolean[] changed = new boolean[1]; boolean[] changed = new boolean[1];

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B