Skip to content

Commit

Permalink
1.3.2
Browse files Browse the repository at this point in the history
Several fixes for Canvas and Forge

Fixed #90
Fixed #92
Fixed #99
  • Loading branch information
TreyRuffy committed Jul 19, 2022
1 parent aca94ff commit ec9c84b
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ public VertexConsumerProvider.Immediate immediate(final PositionEnum pos, final
for (int i = 0; i < list.size(); i++) {
final int height = 9;
final int width = this.textRenderer.getWidth(list.get(i).getString());
if (width == 0) {
continue;
}
final int y = 2 + height * i;

int x1;
Expand All @@ -200,7 +203,7 @@ public VertexConsumerProvider.Immediate immediate(final PositionEnum pos, final
}

x1 = windowWidth - 1;
x2 = windowWidth + width + 1;
x2 = windowWidth + width;
} else {
windowWidth = 2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,15 @@ public void update(final MinecraftClient client) {
// Chunk Culling
lines.get(1).value(chunkCulling);

// Pending chunk uploads
lines.get(2).value(client.worldRenderer.getChunkBuilder().getToBatchCount());
// TODO make this work properly with Canvas (chunkBuilderAccessor is null when using it)
if (chunkBuilderDuck != null) {
// Pending chunk uploads
lines.get(2).value(client.worldRenderer.getChunkBuilder().getToBatchCount());

lines.get(3).value(client.worldRenderer.getChunkBuilder().getChunksToUpload());
lines.get(3).value(client.worldRenderer.getChunkBuilder().getChunksToUpload());

lines.get(4).value(client.worldRenderer.getChunkBuilder().getFreeBufferCount());
lines.get(4).value(client.worldRenderer.getChunkBuilder().getFreeBufferCount());
}

// Loaded Chunks (Server)
if (serverWorld != null) {
Expand Down
6 changes: 3 additions & 3 deletions forge/src/main/java/me/treyruffy/betterf3/ForgeModMenu.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.treyruffy.betterf3;

import me.cominixo.betterf3.config.gui.ModConfigScreen;
import net.minecraftforge.client.ConfigGuiHandler;
import net.minecraftforge.client.ConfigScreenHandler;
import net.minecraftforge.fml.ModLoadingContext;

/**
Expand All @@ -17,7 +17,7 @@ private ForgeModMenu() {
* Registers BetterF3 in the mod menu.
*/
public static void registerModsPage() {
ModLoadingContext.get().registerExtensionPoint(ConfigGuiHandler.ConfigGuiFactory.class,
() -> new ConfigGuiHandler.ConfigGuiFactory((client, parent) -> new ModConfigScreen(parent)));
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class,
() -> new ConfigScreenHandler.ConfigScreenFactory((client, parent) -> new ModConfigScreen(parent)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.DebugHud;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraftforge.client.gui.ForgeIngameGui;
import net.minecraftforge.client.gui.overlay.ForgeGui;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -13,8 +13,8 @@
/**
* Forge InGame GUI Mixin.
*/
@Mixin(ForgeIngameGui.class)
public abstract class ForgeIngameGuiMixin {
@Mixin(ForgeGui.class)
public abstract class ForgeGuiMixin {

/**
* Modifies the F3 Menu from Forge's to BetterF3.
Expand All @@ -25,7 +25,7 @@ public abstract class ForgeIngameGuiMixin {
* @param ci Callback info
*/
@Inject(remap = false, method = "renderHUDText", at = @At(value = "INVOKE", opcode = Opcodes.PUTFIELD, target =
"Lnet/minecraftforge/client/gui/ForgeIngameGui$ForgeDebugScreenOverlay;update()V"), cancellable = true)
"Lnet/minecraftforge/client/gui/overlay/ForgeGui$ForgeDebugScreenOverlay;update()V"), cancellable = true)
public void customDebugMenu(final int width, final int height, final MatrixStack mStack, final CallbackInfo ci) {
// Sets up BetterF3's debug screen
new DebugHud(MinecraftClient.getInstance()).render(mStack);
Expand Down
4 changes: 2 additions & 2 deletions forge/src/main/resources/betterf3.forge.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"server": [],
"mixins": [],
"client": [
"ForgeIngameGuiMixin"
"ForgeGuiMixin"
]
}
}
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ org.gradle.daemon=false
minecraft_version=1.19

archives_base_name=BetterF3
mod_version=1.3.1
mod_version=1.3.2
maven_group=me.treyruffy.betterf3

architectury_version=5.5.18

fabric_loader_version=0.14.7
fabric_api_version=0.55.3+1.19
fabric_loader_version=0.14.8
fabric_api_version=0.57.0+1.19

yarn_version=1.19+build.1
yarn_version=1.19+build.4

cloth_version=7.0.65
modmenu_version=3.2.2

forge_enabled=true
# Confirm settings in settings.gradle
forge_version=41.0.4
forge_version=41.0.100
5 changes: 3 additions & 2 deletions update.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"homepage": "https://www.curseforge.com/minecraft/mc-mods/betterf3/",
"1.19": {
"1.3.2": "Fixed new Forge version compatibility issues.",
"1.3.1": "Forge Support",
"1.3.0": "Update for 1.19"
},
Expand Down Expand Up @@ -35,8 +36,8 @@
"1.1.2": "Initial release of BetterF3 Forge"
},
"promos": {
"1.19-latest": "1.3.1",
"1.19-recommended": "1.3.1",
"1.19-latest": "1.3.2",
"1.19-recommended": "1.3.2",
"1.18.2-latest": "1.2.5",
"1.18.2-recommended": "1.2.5",
"1.18-latest": "1.2.1",
Expand Down

0 comments on commit ec9c84b

Please sign in to comment.