Skip to content

Commit

Permalink
- Config is now initialized before config screen is registered (fixes #…
Browse files Browse the repository at this point in the history
…234)

- Build against NeoForge 21.0.139-beta (fixes opening config screen through Forge modlist crashing)
- Fixed pumpkin overlay rendering while Freecam is enabled (#239)
  • Loading branch information
hashalite committed Jul 27, 2024
1 parent b5028a5 commit a2ab9e7
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 17 deletions.
19 changes: 15 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,25 @@ and Freecam's versioning is based on [Semantic Versioning](https://semver.org/sp

### Added

- 1.21 Support ([#222](https://github.com/MinecraftFreecam/Freecam/pull/222)).
- 1.20.6 Support ([#223](https://github.com/MinecraftFreecam/Freecam/pull/223)).

### Changed

### Removed

### Fixed

- Config is now initialized before config screen is registered (fixes #234)
- Build against NeoForge 21.0.139-beta (fixes opening config screen through Forge modlist crashing)
- Pumpkin overlay rendering while Freecam is enabled (#239)

## [1.3.0-beta1] - 2024-07-26

### Added

- 1.21 Support ([#222](https://github.com/MinecraftFreecam/Freecam/pull/222)).
- 1.20.6 Support ([#223](https://github.com/MinecraftFreecam/Freecam/pull/223)).

### Fixed

- Issues specific to hosting LAN worlds ([#207](https://github.com/MinecraftFreecam/Freecam/pull/207)).
- Compatibility issue with Lunar Client ([#206](https://github.com/MinecraftFreecam/Freecam/issues/206)).
- Modrinth Edition not treating hosted LAN worlds as singleplayer.
Expand Down Expand Up @@ -535,7 +545,8 @@ and Freecam's versioning is based on [Semantic Versioning](https://semver.org/sp
- Minecraft 1.18 support.
- Minecraft 1.17 support.

[Unreleased]: https://github.com/MinecraftFreecam/Freecam/compare/v1.2.4...HEAD
[Unreleased]: https://github.com/MinecraftFreecam/Freecam/compare/v1.3.0-beta1...HEAD
[1.3.0-beta1]: https://github.com/MinecraftFreecam/Freecam/compare/v1.2.4...v1.3.0-beta1
[1.2.4]: https://github.com/MinecraftFreecam/Freecam/compare/v1.2.3...v1.2.4
[1.2.3]: https://github.com/MinecraftFreecam/Freecam/compare/v1.2.2...v1.2.3
[1.2.2]: https://github.com/MinecraftFreecam/Freecam/compare/v1.2.1.1...v1.2.2
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.jetbrains.changelog.tasks.BaseChangelogTask

plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
id "com.hypherionmc.modutils.modpublisher" version "2.1.2" apply false
id "com.github.johnrengelman.shadow" version "8.1.1" apply false
id "org.jetbrains.changelog" version "2.2.0"
Expand Down
17 changes: 17 additions & 0 deletions common/src/main/java/net/xolt/freecam/mixins/GuiMixin.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package net.xolt.freecam.mixins;

import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.resources.ResourceLocation;
import net.xolt.freecam.Freecam;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import static net.xolt.freecam.Freecam.MC;
Expand All @@ -14,11 +19,23 @@
@Mixin(Gui.class)
public class GuiMixin {

@Shadow
@Final
private static ResourceLocation PUMPKIN_BLUR_LOCATION;

// Makes HUD correspond to the player rather than the FreeCamera.
@Inject(method = "getCameraPlayer", at = @At("HEAD"), cancellable = true)
private void onGetCameraPlayer(CallbackInfoReturnable<Player> cir) {
if (Freecam.isEnabled()) {
cir.setReturnValue(MC.player);
}
}

// Don't render pumpkin overlay while Freecam is active
@Inject(method = "renderTextureOverlay", at = @At("HEAD"), cancellable = true)
private void onRenderTextureOverlay(GuiGraphics guiGraphics, ResourceLocation shaderLocation, float alpha, CallbackInfo ci) {
if (Freecam.isEnabled() && shaderLocation.equals(PUMPKIN_BLUR_LOCATION)) {
ci.cancel();
}
}
}
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
org.gradle.jvmargs=-Xmx4G

mod_version=1.2.4
mod_version=1.3.0-beta1
maven_group=net.xolt.freecam
authors=hashalite,Matt Sturgeon
description=A highly customizable freecam mod.
Expand All @@ -27,7 +27,7 @@ release_type=release
# Forge dependencies use maven's version range spec:
# https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html
minecraft_version=1.21
parchment_version=1.20.6-2024.06.02
parchment_version=1.21-2024.07.07
supported_mc_versions=

fabric_loader_version=0.15.11
Expand All @@ -36,15 +36,15 @@ fabric_loader_req=>=0.14.0
fabric_mc_req=>1.21-
fabric_supported_mc_versions=

neoforge_version=21.0.0-beta
neoforge_version=21.0.139-beta
neoforge_pr=
neoforge_mc_req=[1.21,)
neoforge_loader_req=[1,)
neoforge_req=[21.0.0-beta,)
neoforge_req=[21.0.110-beta,)
neoforge_supported_mc_versions=

# Other dependencies
# https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu
# https://mvnrepository.com/artifact/me.shedaniel.cloth/cloth-config?repo=architectury
modmenu_version=11.0.0-beta.1
cloth_version=15.0.127
modmenu_version=11.0.1
cloth_version=15.0.128
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@
public class FreecamForge {

public FreecamForge(ModContainer container) {
ModConfig.init();
// Register our config screen with Forge
container.registerExtensionPoint(IConfigScreenFactory.class, (client, parent) ->
AutoConfig.getConfigScreen(ModConfig.class, parent).get());
}

@SubscribeEvent
public static void clientSetup(FMLClientSetupEvent event) {
ModConfig.init();
}

@SubscribeEvent
public static void registerKeymappings(RegisterKeyMappingsEvent event) {
ModBindings.forEach(event::register);
Expand Down

0 comments on commit a2ab9e7

Please sign in to comment.