Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Singleplayer Crash Fix #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Gradle Package

on:
release:
types: [created]
pull_request:
workflow_dispatch:
push:

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
server-id: github
settings-path: ${{ github.workspace }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

- name: Build with Gradle
run: ./gradlew build --no-daemon

- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts
path: versions/**/build/libs/

- name: Clean Gradle
run: ./gradlew clean --no-daemon
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod_name=Freelook
mod_id=freelook
mod_version=2.0.0
mod_version=2.0.1
mod_archives_name=Freelook

# Gradle Configuration -- DO NOT TOUCH THESE VALUES.
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/me/syz/freelook/mixins/ModListMixin.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.syz.freelook.mixins;

import me.syz.freelook.FreelookMod;
import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.common.ModContainer;
import net.minecraftforge.fml.common.network.handshake.FMLHandshakeMessage;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -12,12 +13,13 @@
import java.util.List;
import java.util.Map;

@Mixin(FMLHandshakeMessage.ModList.class)
@Mixin(value = FMLHandshakeMessage.ModList.class, remap = false)
public class ModListMixin {
@Shadow(remap = false) private Map<String,String> modTags;
@Shadow private Map<String,String> modTags;

@Inject(method = "<init>(Ljava/util/List;)V", at = @At("RETURN"), remap = false)
@Inject(method = "<init>(Ljava/util/List;)V", at = @At("RETURN"))
private void removeMod(List<ModContainer> modList, CallbackInfo ci) {
this.modTags.keySet().removeIf(key -> key.equals(FreelookMod.MODID));
if (!Minecraft.getMinecraft().isIntegratedServerRunning())
this.modTags.remove(FreelookMod.MODID);
}
}