Skip to content

Commit

Permalink
Merge branch main into 1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
xTracr committed Dec 3, 2023
1 parent 019f4b1 commit 60a324c
Show file tree
Hide file tree
Showing 51 changed files with 990 additions and 1,023 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build

on:
on:
pull_request:
push:
branches:
Expand All @@ -15,12 +15,12 @@ jobs:
run: env

- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

- name: Setup JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 17
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish on Modrinth & CurseForge

on:
release:
types: [published]
types: [ published ]

env:
CURSEFORGE_ID: 851574
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Make the camera more realistic in the first-person view.
Supported versions: 1.18-1.20 Forge & Fabric
Download the mod from [Releases](https://github.com/xTracr/RealCamera/releases), [Modrinth](https://modrinth.com/mod/real-camera) or [CurseForge](https://curseforge.com/minecraft/mc-mods/real-camera)
Snapshots are [here](https://github.com/xTracr/RealCamera/actions/workflows/build.yml)

## Features ##

Expand Down Expand Up @@ -34,18 +35,18 @@ Download the mod from [Releases](https://github.com/xTracr/RealCamera/releases),

### Compatibility ###

* Cause crash:
* OptiFine
* Incompatible:
* Yes Steve Model(GeckoLib?)
* Customizable Player Models
* Compatible:
* most camera mods
* Player Animation Lib
* Not Enough Animations[^1]
* First Person Model
* Pehkui
* Epic Fight
* Incompatible:
* Yes Steve Model(GeckoLib?)
* Customizable Player Models
* Cause crash:
* OptiFine

[^1]:It is suggested to disable `Animation Smoothing` option in the config of *Not Enough Animations*.

Expand Down
11 changes: 6 additions & 5 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
使第一人称视角下的摄像头更加真实。
支持的版本: 1.18-1.20 Forge & Fabric
[Releases](https://github.com/xTracr/RealCamera/releases)[Modrinth](https://modrinth.com/mod/real-camera)[CurseForge](https://curseforge.com/minecraft/mc-mods/real-camera)下载
快照版在[这里](https://github.com/xTracr/RealCamera/actions/workflows/build.yml)

## 特性 ##

Expand Down Expand Up @@ -34,18 +35,18 @@

### 兼容性 ###

* 引起崩溃:
* OptiFine
* 不兼容:
* Yes Steve Model(GeckoLib?)
* Customizable Player Models
* 兼容:
* 大多数摄像头模组
* Player Animation Lib
* Not Enough Animations[^1]
* First Person Model
* Pehkui
* Epic Fight
* 不兼容:
* Yes Steve Model(GeckoLib?)
* Customizable Player Models
* 引起崩溃:
* OptiFine

[^1]:建议在 *更多动画* 的配置内禁用`Animation Smoothing`选项。

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.2-SNAPSHOT" apply false
id "dev.architectury.loom" version "1.4-SNAPSHOT" apply false
}

architectury {
Expand Down Expand Up @@ -33,7 +33,7 @@ allprojects {
repositories {
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/releases/" }
//maven { url "https://cursemaven.com" }
maven { url "https://cursemaven.com" }
//maven { url "https://jitpack.io" }
}

Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* Added support for 1.19.2
* Upgraded to 1.20
* 0.5.4-beta:
* Added feature #15, fixed #35
* Changed the way of clipping to space to avoid #23 and #32

* 0.4.0-alpha:
* Fixed an issue where the camera would not follow the model action when the player started/ended sneaking
Expand Down Expand Up @@ -95,6 +97,8 @@
* 添加了对1.19.2的支持
* 更新至1.20
* 0.5.4-beta:
* 添加了功能#15, 修复#35
* 修改了clip to space的方式来避免#23#32

* 0.4.0-alpha:
* 修复了玩家开始/结束潜行时摄像头未跟上模型动作的问题
Expand Down
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"

// Cloth Config
modImplementation("me.shedaniel.cloth:cloth-config:${rootProject.cloth_config_version}") {
modCompileOnly("me.shedaniel.cloth:cloth-config:${rootProject.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
}
Expand Down
34 changes: 14 additions & 20 deletions common/src/main/java/com/xtracr/realcamera/KeyBindings.java
Original file line number Diff line number Diff line change
@@ -1,44 +1,38 @@
package com.xtracr.realcamera;

import org.lwjgl.glfw.GLFW;

import com.xtracr.realcamera.config.ConfigFile;
import com.xtracr.realcamera.config.ModConfig;

import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import org.lwjgl.glfw.GLFW;

public final class KeyBindings {

private static final ModConfig config = ConfigFile.modConfig;

private static final String KEY_CATEGORY = "key.category.xtracr_"+RealCamera.MODID;
private static final String KEY_ID = "key.xtracr_"+RealCamera.MODID+"_";
private static final ModConfig config = ConfigFile.modConfig;
private static final String KEY_CATEGORY = "key.category.xtracr_" + RealCamera.MODID;
private static final String KEY_ID = "key.xtracr_" + RealCamera.MODID + "_";

public static final KeyBinding TOGGLE_PERSPECTIVE = new KeyBinding(
KEY_ID+"togglePerspective", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_F6, KEY_CATEGORY);
KEY_ID + "togglePerspective", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_F6, KEY_CATEGORY);
public static final KeyBinding TOGGLE_ADJUST_MODE = new KeyBinding(
KEY_ID+"toggleAdjustMode", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);
KEY_ID + "toggleAdjustMode", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);
public static final KeyBinding TOGGLE_CAMERA_MODE = new KeyBinding(
KEY_ID+"toggleCameraMode", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);
KEY_ID + "toggleCameraMode", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);
public static final KeyBinding ADJUST_UP = new KeyBinding(
KEY_ID+"adjustUP", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);
KEY_ID + "adjustUP", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);
public static final KeyBinding ADJUST_DOWN = new KeyBinding(
KEY_ID+"adjustDOWN", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);
KEY_ID + "adjustDOWN", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);
public static final KeyBinding ADJUST_FRONT = new KeyBinding(
KEY_ID+"adjustFRONT", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);
KEY_ID + "adjustFRONT", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);
public static final KeyBinding ADJUST_BACK = new KeyBinding(
KEY_ID+"adjustBACK", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);
KEY_ID + "adjustBACK", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);
public static final KeyBinding ADJUST_LEFT = new KeyBinding(
KEY_ID+"adjustLEFT", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);
KEY_ID + "adjustLEFT", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);
public static final KeyBinding ADJUST_RIGHT = new KeyBinding(
KEY_ID+"adjustRIGHT", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);
KEY_ID + "adjustRIGHT", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), KEY_CATEGORY);

public static void handle(MinecraftClient client) {
if (client.player == null || client.currentScreen != null) {
return;
}
if (client.player == null || client.currentScreen != null) return;

while (TOGGLE_PERSPECTIVE.wasPressed()) {
boolean enabled = config.isEnabled();
Expand Down
6 changes: 2 additions & 4 deletions common/src/main/java/com/xtracr/realcamera/RealCamera.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.xtracr.realcamera;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.xtracr.realcamera.api.CompatExample;
import com.xtracr.realcamera.config.ConfigFile;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class RealCamera {

public static final String MODID = "realcamera";
public static final Logger LOGGER = LoggerFactory.getLogger(MODID);

Expand Down
Loading

0 comments on commit 60a324c

Please sign in to comment.