Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.8-SNAPSHOT'
id 'fabric-loom' version '0.10.36'
id 'maven-publish'
}

Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=21w20a
yarn_mappings=21w20a+build.19
loader_version=0.11.3
minecraft_version=21w42a
yarn_mappings=21w42a+build.3
loader_version=0.11.7
# Mod Properties
mod_version=0.2.7
maven_group=supercoder79
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 4 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
before_install:
- wget https://raw.githubusercontent.com/sormuras/bach/42aa51f2d4b2d9897debec2d15c751a9ac846208/install-jdk.sh
- source install-jdk.sh --feature 16
- jshell --version
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void init() {
this.textRenderer.getClass();
int i = var10000 * 9;
this.addDrawableChild(new ButtonWidget(this.width / 2 - 155 + 80, 124 + i, 150, 20, ScreenTexts.CANCEL, (buttonWidget) -> {
this.client.openScreen(this.parent);
this.client.setScreen(this.parent);
}));
} else {
this.wrappedText = MultilineText.create(this.textRenderer, this.subtitle, this.width - 50);
Expand All @@ -74,7 +74,7 @@ public void init() {
this.callback.proceed(false, this.eraseCacheCheckbox.isChecked());
}));
this.addDrawableChild(new ButtonWidget(this.width / 2 - 155 + 80, 124 + i, 150, 20, ScreenTexts.CANCEL, (buttonWidget) -> {
this.client.openScreen(this.parent);
this.client.setScreen(this.parent);
}));
this.eraseCacheCheckbox = new CheckboxWidget(this.width / 2 - 155 + 80, 76 + i, 150, 20, new TranslatableText("selectWorld.backupEraseCache"), false);
if (this.showEraseCacheCheckbox) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
package supercoder79.databreaker.mixin;

import com.google.common.collect.ImmutableSet;
import com.mojang.datafixers.DataFixer;
import net.minecraft.server.Main;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.World;
import net.minecraft.world.level.storage.LevelStorage;
import net.minecraft.world.updater.WorldUpdater;
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.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.function.BooleanSupplier;

@Mixin(MinecraftServer.class)
@Mixin(Main.class)
public abstract class MixinMinecraftServer {
@Redirect(method = "convertLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/storage/LevelStorage$Session;needsConversion()Z"))
private static boolean pickUpBrokenGlass_convertLevel(LevelStorage.Session session) {
boolean shouldExplode = session.needsConversion();
if (shouldExplode) {
@Inject(method = "forceUpgradeWorld", at = @At("HEAD"))
private static void pickUpBrokenGlass_convertLevel(LevelStorage.Session session, DataFixer dataFixer, boolean eraseCache, BooleanSupplier booleanSupplier, ImmutableSet<RegistryKey<World>> worlds, CallbackInfo ci) {
throw new RuntimeException("You cannot upgrade worlds with DataBreaker. Please remove DataBreaker and then upgrade your world.");
}

return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.minecraft.resource.DataPackSettings;
import net.minecraft.util.Util;
import net.minecraft.util.dynamic.RegistryLookupCodec;
import net.minecraft.util.registry.DynamicRegistryManager;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.dimension.DimensionType;
Expand Down Expand Up @@ -95,30 +96,7 @@ private static Pair<GeneratorOptions, Lifecycle> readGeneratorProperties(Dynamic
Dynamic<?> dynamic3 = dynamic2;
DataResult<GeneratorOptions> dataResult = GeneratorOptions.CODEC.parse(dynamic3);
final Logger var10002 = LOGGER;
return Pair.of(dataResult.resultOrPartial(Util.addPrefix("WorldGenSettings: ", var10002::error)).orElseGet(() -> {
DataResult var10000 = RegistryLookupCodec.of(Registry.DIMENSION_TYPE_KEY).codec().parse(dynamic3);
Registry<DimensionType> registry = null;
try {
registry = (Registry)var10000.resultOrPartial(Util.addPrefix("Dimension type registry: ", var10002::error)).orElseThrow(() -> new IllegalStateException("Failed to get dimension registry"));
} catch (Throwable throwable) {
throwable.printStackTrace();
}
var10000 = RegistryLookupCodec.of(Registry.BIOME_KEY).codec().parse(dynamic3);
Registry<Biome> registry2 = null;
try {
registry2 = (Registry)var10000.resultOrPartial(Util.addPrefix("Biome registry: ", var10002::error)).orElseThrow(() -> new IllegalStateException("Failed to get biome registry"));
} catch (Throwable throwable) {
throwable.printStackTrace();
}
var10000 = RegistryLookupCodec.of(Registry.CHUNK_GENERATOR_SETTINGS_KEY).codec().parse(dynamic3);
Registry<ChunkGeneratorSettings> registry3 = null;
try {
registry3 = (Registry)var10000.resultOrPartial(Util.addPrefix("Noise settings registry: ", var10002::error)).orElseThrow(() -> new IllegalStateException("Failed to get noise settings registry"));
} catch (Throwable throwable) {
throwable.printStackTrace();
}
return GeneratorOptions.getDefaultOptions(registry, registry2, registry3);
}), dataResult.lifecycle());
return Pair.of(dataResult.resultOrPartial(Util.addPrefix("WorldGenSettings: ", var10002::error)).orElseGet(() -> GeneratorOptions.getDefaultOptions(DynamicRegistryManager.Impl.method_39199(dynamic3))), dataResult.lifecycle());
}

private static DataPackSettings method_29580(Dynamic<?> dynamic) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/databreaker.mixins.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"required": true,
"package": "supercoder79.databreaker.mixin",
"compatibilityLevel": "JAVA_8",
"compatibilityLevel": "JAVA_16",
"mixins": [
"MixinBlockEntityType",
"MixinDFU",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
],
"depends": {
"fabricloader": ">=0.7.8+build.189",
"minecraft": ">=1.14-"
"minecraft": "1.18.x"
}
}