Skip to content
Merged
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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import net.minecraft.client.gui.GuiGraphicsExtractor;
import net.minecraft.client.gui.screens.ChatScreen;
import net.minecraft.network.chat.Component;
import net.minecraft.server.packs.resources.ReloadableResourceManager;
import net.minecraft.world.scores.DisplaySlot;
import net.minecraft.world.scores.Scoreboard;
import org.apache.logging.log4j.LogManager;
Expand All @@ -57,8 +56,6 @@
import org.polyfrost.oneconfig.api.notifications.v1.NotificationsRenderer;
import org.polyfrost.oneconfig.api.platform.v1.ModInfo;
import org.polyfrost.oneconfig.api.platform.v1.Platform;
import org.polyfrost.oneconfig.api.ui.v1.internal.BlurHandler;
import org.polyfrost.oneconfig.api.ui.v1.keybind.KeybindHelper;
import org.polyfrost.oneconfig.internal.ui.api.ConfigRegistry;
import org.polyfrost.oneconfig.internal.ui.api.ConfigSource;
import org.polyfrost.oneconfig.internal.ui.api.ThirdPartyModCategories;
Expand Down Expand Up @@ -236,7 +233,7 @@ private static void registerEventHandlers() {
// resets the editing flag if another screen replaces the HUD editor without going through
// HudManager.closeEditor() and null opens are ignored because commands close chat first
EventManager.register(
org.polyfrost.oneconfig.api.event.v1.events.ScreenOpenEvent.class, e -> {
ScreenOpenEvent.class, e -> {
if (HudManager.INSTANCE.isEditorOpen() && e.getScreen() != null && !(e.getScreen() instanceof HudEditorUIScreen)) {
HudManager.INSTANCE.closeEditor();
}
Expand All @@ -254,6 +251,7 @@ private static void registerEventHandlers() {
ConfigRegistry.INSTANCE.loadFrom(ConfigManager.active(), ConfigSource.OC);
org.polyfrost.oneconfig.internal.ui.hud.BuiltinHudRegistrar.register();
org.polyfrost.oneconfig.internal.compat.FirmamentHudCompat.register();
//? if wwaypoints_compat
org.polyfrost.oneconfig.internal.compat.WWaypointsCompat.register();
org.polyfrost.oneconfig.internal.ui.themes.ThemeRegistry.INSTANCE.loadFromConfig();
});
Expand Down Expand Up @@ -342,7 +340,6 @@ private void init() {
.orElse(null);
String v = self == null ? "LOCAL" : self.getVersion();
LOGGER.info("Loading OneConfig v{}", v);
BlurHandler.init();
McFontService.INSTANCE.init();
ThirdPartyModCategories.INSTANCE.init();
// force class-load so the hello/disconnect handlers are armed before joining any server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,10 @@ public List<String> getMixins() {
mixins.add("skia.Mixin_InitSkiaFontRenderer");
mixins.add("skia.Mixin_FixComposeRaceCondition");

//? >= 1.21.10 {
//? if >= 1.21.10 {
mixins.add("keybind.Mixin_KeybindCategoryLabel");
//? }
//? < 1.21.10 {
//?} else
//mixins.add("keybind.KeyMappingCategoryAccessor");
//? }

mixins.add("keybind.Mixin_OneConfigKeybindRebind");
mixins.add("keybind.Mixin_KeyMappingResetDetect");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public class Mixin_GuiRendererLegacyTarget {
return override != null ? override.height : original;
}
//? } else {
/*
@ModifyExpressionValue(
/*@ModifyExpressionValue(
method = "draw",
at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/platform/Window;getWidth()I")
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.mojang.blaze3d.buffers.GpuBuffer
import com.mojang.blaze3d.buffers.BufferUsage
*///? }
//? if < 1.21.5
/*import com.mojang.blaze3d.platform.NativeImage*/
//import com.mojang.blaze3d.platform.NativeImage
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiGraphicsExtractor
//? if >= 1.21.8
Expand Down Expand Up @@ -205,13 +205,13 @@ class MinecraftItemCatalogService : ItemCatalogService {
//? if >= 1.21.11 {
val graphics = GuiGraphicsExtractor(Minecraft.getInstance(), state, guiWidth, guiHeight)
//? } else
/*val graphics = GuiGraphicsExtractor(Minecraft.getInstance(), state)*/
//val graphics = GuiGraphicsExtractor(Minecraft.getInstance(), state)
placements.forEach { placement ->
val item = entriesById[placement.id]?.item ?: return@forEach
//? if >= 26.1 {
graphics.fakeItem(ItemStack(item), placement.x + ITEM_PADDING, placement.y + ITEM_PADDING)
//? } else
/*graphics.renderFakeItem(ItemStack(item), placement.x + ITEM_PADDING, placement.y + ITEM_PADDING)*/
//graphics.renderFakeItem(ItemStack(item), placement.x + ITEM_PADDING, placement.y + ITEM_PADDING)
}

val client = Minecraft.getInstance()
Expand Down Expand Up @@ -438,7 +438,7 @@ class MinecraftItemCatalogService : ItemCatalogService {
//? if >= 1.21.11 {
device.createCommandEncoder().copyTextureToBuffer(texture, buffer, 0L, onCopied, 0)
//? } else
/*device.createCommandEncoder().copyTextureToBuffer(texture, buffer, 0, onCopied, 0)*/
//device.createCommandEncoder().copyTextureToBuffer(texture, buffer, 0, onCopied, 0)
} catch (throwable: Throwable) {
buffer.close()
throw throwable
Expand All @@ -461,7 +461,7 @@ class MinecraftItemCatalogService : ItemCatalogService {
//? if >= 1.21.4 {
image.getPixel(x, y)
//? } else
/*abgrToArgb(image.getPixelRGBA(x, y))*/
//abgrToArgb(image.getPixelRGBA(x, y))
}
completeBatch(batch, icons)
} finally {
Expand Down
3 changes: 3 additions & 0 deletions minecraft/src/main/resources/mixins.oneconfigv1.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"injectors": {
"maxShiftBy": 5
},
"mixinextras": {
"minVersion": "0.5.0"
},
"verbose": true,
"client": [
"Mixin_PackRepository",
Expand Down
19 changes: 6 additions & 13 deletions minecraft/stonecutter.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,20 @@ stonecutter {
replace("GuiGraphics", "GuiGraphicsExtractor")
}

regex(eval(current.version, "< 26.1")) {
string(eval(current.version, "< 26.1")) {
replace(
"import net.minecraft.client.gui.GuiGraphicsExtractor(?!;)",
"import net.minecraft.client.gui.GuiGraphics as GuiGraphicsExtractor",
"import net.minecraft.client.gui.GuiGraphics as GuiGraphicsExtractor",
"import net.minecraft.client.gui.GuiGraphicsExtractor",
"import net.minecraft.client.gui.GuiGraphicsExtractor\n",
"import net.minecraft.client.gui.GuiGraphics as GuiGraphicsExtractor\n",
)
}
// 26.2 moved the main render target from Minecraft onto GameRenderer
string(eval(current.version, ">= 26.2"), "main_render_target") {
replace("mainRenderTarget", "gameRenderer.mainRenderTarget()")
}
string(eval(current.version, ">= 1.21.11"), "identifier") {
replace("ResourceLocation", "Identifier")
}
regex(eval(current.version, "< 1.21.11")) {
string(eval(current.version, "< 1.21.11")) {
replace(
"import net.minecraft.resources.Identifier(?!;)",
"import net.minecraft.resources.ResourceLocation as Identifier",
"import net.minecraft.resources.ResourceLocation as Identifier",
"import net.minecraft.resources.Identifier",
"import net.minecraft.resources.Identifier\n",
"import net.minecraft.resources.ResourceLocation as Identifier\n",
)
}

Expand Down
Loading