feat: Update to Minecraft 26.2 (rc 2)
This commit is contained in:
+7
-1
@@ -12,6 +12,7 @@ import de.siphalor.tweed5.core.api.entry.ConfigEntry;
|
|||||||
import de.siphalor.tweed5.core.api.extension.TweedExtensionSetupContext;
|
import de.siphalor.tweed5.core.api.extension.TweedExtensionSetupContext;
|
||||||
import de.siphalor.tweed5.patchwork.api.PatchworkPartAccess;
|
import de.siphalor.tweed5.patchwork.api.PatchworkPartAccess;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -67,7 +68,12 @@ public class TweedCoatBridgeExtensionImpl implements TweedCoatBridgeExtension {
|
|||||||
} else {
|
} else {
|
||||||
title = translatableComponent(params.translationKeyPrefix() + ".title");
|
title = translatableComponent(params.translationKeyPrefix() + ".title");
|
||||||
}
|
}
|
||||||
ConfigScreen configScreen = new ConfigScreen(minecraft.screen, title, Collections.singletonList(contentWidget));
|
//# if MC_VERSION_NUMBER >= 260200
|
||||||
|
Screen parent = minecraft.gui.screen();
|
||||||
|
//# else
|
||||||
|
//- Screen parent = minecraft.screen;
|
||||||
|
//# end
|
||||||
|
ConfigScreen configScreen = new ConfigScreen(parent, title, Collections.singletonList(contentWidget));
|
||||||
if (params.saveHandler() != null) {
|
if (params.saveHandler() != null) {
|
||||||
configScreen.setOnSave(() -> params.saveHandler().accept(value));
|
configScreen.setOnSave(() -> params.saveHandler().accept(value));
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-2
@@ -38,7 +38,8 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.resources.language.I18n;
|
//- import net.minecraft.client.resources.language.I18n;
|
||||||
|
import net.minecraft.locale.Language;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.resources.Identifier;
|
import net.minecraft.resources.Identifier;
|
||||||
//- import net.minecraft.resources.ResourceLocation;
|
//- import net.minecraft.resources.ResourceLocation;
|
||||||
@@ -592,7 +593,11 @@ public class TweedCoatMappersImpl {
|
|||||||
);
|
);
|
||||||
|
|
||||||
String descriptionKey = translationKey + ".description";
|
String descriptionKey = translationKey + ".description";
|
||||||
if (I18n.exists(descriptionKey)) {
|
//# if MC_VERSION_NUMBER >= 260200
|
||||||
|
if (Language.getInstance().has(descriptionKey)) {
|
||||||
|
//# else
|
||||||
|
//- if (I18n.exists(descriptionKey)) {
|
||||||
|
//# end
|
||||||
categoryWidget.addEntry(new ConfigListTextEntry(
|
categoryWidget.addEntry(new ConfigListTextEntry(
|
||||||
translatableComponent(descriptionKey).withStyle(ChatFormatting.GRAY)
|
translatableComponent(descriptionKey).withStyle(ChatFormatting.GRAY)
|
||||||
));
|
));
|
||||||
|
|||||||
+10
-2
@@ -83,7 +83,11 @@ public class TweedCoatBridgeTestMod implements ClientModInitializer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onPressedPriority() {
|
public boolean onPressedPriority() {
|
||||||
if (!(Minecraft.getInstance().screen instanceof TitleScreen)) {
|
//# if MC_VERSION_NUMBER >= 260200
|
||||||
|
if (!(Minecraft.getInstance().gui.screen() instanceof TitleScreen)) {
|
||||||
|
//# else
|
||||||
|
//- if (!(Minecraft.getInstance().screen instanceof TitleScreen)) {
|
||||||
|
//# end
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +105,11 @@ public class TweedCoatBridgeTestMod implements ClientModInitializer {
|
|||||||
})
|
})
|
||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
Minecraft.getInstance().setScreen(configScreen);
|
//# if MC_VERSION_NUMBER >= 260200
|
||||||
|
Minecraft.getInstance().gui.setScreen(configScreen);
|
||||||
|
//# else
|
||||||
|
//- Minecraft.getInstance().setScreen(configScreen);
|
||||||
|
//# end
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
org.gradle.jvmargs = -Xmx2G
|
org.gradle.jvmargs = -Xmx2G
|
||||||
org.gradle.configuration-cache = true
|
org.gradle.configuration-cache = true
|
||||||
|
|
||||||
minecraft.version.descriptor = 26.1.0
|
minecraft.version.descriptor = 26.2.0
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fabric.api.key_mapping = fabric-key-mapping-api-v1
|
||||||
|
|
||||||
|
preprocessor.mc_version_number = 260200
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
[versions]
|
||||||
|
amecs-priorityKeyMappings = "1.0.1"
|
||||||
|
coat = "1.1.3"
|
||||||
|
fabric-api = "0.152.0+26.2"
|
||||||
|
fabric-loom = "1.15-SNAPSHOT"
|
||||||
|
java = "25"
|
||||||
|
minecraft = "26.2-rc-2"
|
||||||
|
|
||||||
|
[plugins]
|
||||||
|
fabric-loom = { id = "net.fabricmc.fabric-loom", version.ref = "fabric-loom" }
|
||||||
|
|
||||||
|
[libraries]
|
||||||
|
amecs-priorityKeyMappings = { group = "de.siphalor.amecs.amecs-priority-key-mappings", name = "amecs-priority-key-mappings-mc26.2.0", version.ref = "amecs-priorityKeyMappings" }
|
||||||
|
coat = { group = "de.siphalor.coat", name = "coat-mc26.2.0", version.ref = "coat" }
|
||||||
|
fabric-api = { group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fabric-api" }
|
||||||
|
minecraft = { group = "com.mojang", name = "minecraft", version.ref = "minecraft" }
|
||||||
Reference in New Issue
Block a user