Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Commit 75e81ec

Browse files
author
hub
committed
resource assets
load assets from client directory provide defaults from jar resources
1 parent 6349e99 commit 75e81ec

71 files changed

Lines changed: 409 additions & 785 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@ trim_trailing_whitespace = true
1010
[*.java]
1111
indent_size = 4
1212

13-
[*.{json, toml, xml, yml}]
13+
[*.{json, toml, xml, yml, yaml}]
1414
indent_size = 2
1515

16+
[*.sh]
17+
indent_size = 4
18+
1619
[*.md]
17-
max_line_length = 420
1820
trim_trailing_whitespace = false
21+
22+
[Makefile]
23+
indent_style = tab

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
* text=auto eol=lf
2+
3+
*.gif binary
4+
*.png binary
5+
6+
*.dll binary
7+
*.so binary
8+
9+
*.jar binary
10+
*.zip binary

.github/dependabot.yml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,14 @@
11
version: 2
22
updates:
3-
43
- package-ecosystem: "gradle"
54
directory: "/"
65
schedule:
76
interval: "daily"
8-
time: "12:00"
9-
timezone: "Europe/Berlin"
107
assignees:
11-
- "Krazzzzymonkey"
12-
- "nothub"
13-
reviewers:
14-
- "Krazzzzymonkey"
15-
- "nothub"
16-
commit-message:
17-
prefix: "gradle"
18-
include: "scope"
19-
8+
- "Pr3roxDLC"
209
- package-ecosystem: "github-actions"
2110
directory: "/"
2211
schedule:
2312
interval: "daily"
24-
time: "12:00"
25-
timezone: "Europe/Berlin"
2613
assignees:
27-
- "Krazzzzymonkey"
28-
- "nothub"
29-
reviewers:
30-
- "Krazzzzymonkey"
31-
- "nothub"
32-
commit-message:
33-
prefix: "github-actions"
34-
include: "scope"
14+
- "Pr3roxDLC"

.github/workflows/workflow.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: '🚔'
2+
on:
3+
push:
4+
tags:
5+
- 'v[0-9]*'
6+
jobs:
7+
job:
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-java@v3
12+
with:
13+
java-version: '8'
14+
distribution: 'temurin'
15+
check-latest: true
16+
cache: 'gradle'
17+
- run: ./gradlew clean setupDecompWorkspace build --console plain --no-daemon --full-stacktrace
18+
- uses: softprops/action-gh-release@v1
19+
with:
20+
body: 'Release generated at commit: ${{ github.sha }}'
21+
files: 'build/libs/Catalyst-*-shadow.jar'

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# git
77
!/**/.gitkeep
8+
!/.gitattributes
89
!/.gitignore
910
!/.gitmodules
1011

@@ -22,8 +23,6 @@
2223

2324
# misc
2425
!/.github/**
25-
!/.binscure/**
2626
!/scripts/**
27-
!/*.md
2827
!/.editorconfig
29-
!/LICENSE
28+
!/README.md

LICENSE.md

Lines changed: 0 additions & 353 deletions
This file was deleted.

build.gradle

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.gradle.process.internal.ExecException
2+
13
buildscript {
24
repositories {
35
//jcenter()
@@ -20,7 +22,28 @@ apply plugin: "org.jetbrains.gradle.plugin.idea-ext"
2022

2123
group = project.mod_group
2224
archivesBaseName = project.mod_name
23-
version = project.mod_version
25+
version = { ->
26+
def pattern = 'v[0-9]*'
27+
def fallback = 'indev'
28+
def result = new ByteArrayOutputStream()
29+
try {
30+
exec {
31+
commandLine 'git', 'describe', '--tags', '--abbrev=0', '--match', pattern
32+
ignoreExitValue = true
33+
standardOutput = result
34+
// void stderr
35+
errorOutput = new OutputStream() {
36+
@Override
37+
void write(int b) throws IOException {}
38+
}
39+
}
40+
} catch (ExecException ignored) {
41+
ignored.printStackTrace()
42+
println 'No git tag found with format \'' + pattern + '\', using fallback version identifier \'' + fallback + '\'.'
43+
return fallback
44+
}
45+
return result.toString().trim().replaceFirst('v', '')
46+
}()
2447

2548
sourceCompatibility = targetCompatibility = '1.8'
2649
compileJava {
@@ -46,7 +69,7 @@ minecraft {
4669

4770
replaceIn "com/krazzzzymonkey/catalyst/Main.java"
4871
replace "@modid@", project.mod_id
49-
replace "@version@", project.mod_version
72+
replace "@version@", project.version
5073
replace "@name@", project.mod_name
5174
}
5275

@@ -169,13 +192,12 @@ jar {
169192

170193
task loaderJar(type: Jar, dependsOn: shadowJar) {
171194
from(zipTree(shadowJar.archivePath)) {
172-
include "assets/minecraft/catalyst/mainmenu/config.json"
173195
include "com/krazzzzymonkey/**"
174196
include "mixins.catalyst.json"
175197
include "mixins.catalyst.refmap.json"
176198
}
177199
baseName = project.mod_name
178-
version = project.mod_version
200+
version = project.version
179201
classifier = "loader"
180202
manifest = jar.manifest
181203
}

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ org.gradle.daemon=false
44
mod_group=com.krazzzzymonkey.catalyst
55
mod_id=catalyst
66
mod_name=Catalyst
7-
mod_version=1.10.2
87

98
forge_version=1.12.2-14.23.5.2847
109
mcp_version=stable_39

src/main/java/com/krazzzzymonkey/catalyst/Main.java

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.krazzzzymonkey.catalyst;
22

3-
import com.google.gson.JsonElement;
4-
import com.google.gson.JsonParser;
53
import com.krazzzzymonkey.catalyst.configuration.Config;
64
import com.krazzzzymonkey.catalyst.configuration.ConfigurationLoader;
75
import com.krazzzzymonkey.catalyst.events.ClientEvents;
@@ -11,8 +9,6 @@
119
import com.krazzzzymonkey.catalyst.managers.accountManager.AccountManager;
1210
import com.krazzzzymonkey.catalyst.managers.accountManager.Standards;
1311
import com.krazzzzymonkey.catalyst.managers.accountManager.config.ConfigValues;
14-
import com.krazzzzymonkey.catalyst.utils.AssetUtils;
15-
import com.krazzzzymonkey.catalyst.managers.TimerManager;
1612
import com.krazzzzymonkey.catalyst.utils.font.CFontRenderer;
1713
import com.krazzzzymonkey.catalyst.utils.visual.ColorUtils;
1814
import net.minecraftforge.common.MinecraftForge;
@@ -30,7 +26,8 @@
3026
import org.lwjgl.opengl.Display;
3127

3228
import java.awt.*;
33-
import java.io.*;
29+
import java.io.File;
30+
import java.io.IOException;
3431

3532
import static com.krazzzzymonkey.catalyst.managers.FileManager.CATALYST_DIR;
3633

@@ -53,8 +50,6 @@ public static void syncConfig() {
5350
public static final String VERSION = "@version@";
5451
public static int initCount = 0;
5552
public static ModuleManager moduleManager;
56-
public static FileManager fileManager;
57-
public static Thread assetThread;
5853
public static FontManager fontManager;
5954

6055
public static CFontRenderer fontRenderer;
@@ -78,7 +73,6 @@ public static void syncConfig() {
7873
public void preInit(FMLPreInitializationEvent E) throws IOException {
7974

8075

81-
assetThread = new AssetUtils().getThread();
8276
logger.info(" ____ _ _ _ ____ _ _ _ ");
8377
logger.info(" / ___|__ _| |_ __ _| |_ _ ___| |_ / ___| (_) ___ _ __ | |_ ");
8478
logger.info(" | | / _` | __/ _` | | | | / __| __| | | | | |/ _ \\ '_ \\| __|");
@@ -120,38 +114,28 @@ public void preInit(FMLPreInitializationEvent E) throws IOException {
120114
altConfig = new Configuration(E.getSuggestedConfigurationFile());
121115
altConfig.load();
122116
syncConfig();
123-
if (!E.getModMetadata().version.equals("${version}"))//Dev environment needs to use a local list, to avoid issues
124-
Standards.updateFolder();
125-
else
126-
logger.info("Dev environment detected!");
127117
}
128118

129119
@Mod.EventHandler
130120
public void init(FMLInitializationEvent E) throws IOException {
131-
try {
132-
assetThread.join();
133-
} catch (InterruptedException e) {
134-
e.printStackTrace();
135-
}
136121
if (initCount > 0) {
137122
return;
138123
}
139124
Standards.importAccounts();
140125
TimerManager.INSTANCE = new TimerManager();
141126
moduleManager = new ModuleManager();
127+
FileManager.init();
142128
luaManager = new LuaManager();
143-
fileManager = new FileManager();
144129
fontRenderer = new CFontRenderer(new Font(FontManager.font, Font.PLAIN, 20), true, true);
145130
smallFontRenderer = new CFontRenderer(new Font(FontManager.font, Font.PLAIN, 15), true, true);
146131
AccountManager.init();
147132

148-
149133
initCount++;
150134
}
151135

152136
@EventHandler
153137
public void postInit(FMLPostInitializationEvent E){
154-
File file = new File(System.getProperty("user.home") + File.separator + "Catalyst" + File.separator + "assets" + File.separator + "gui" + File.separator + "watermark.png");
138+
File file = FileManager.getAssetFile("gui" + File.separator + "watermark.png");
155139

156140
Display.setTitle(NAME + " " + VERSION);
157141

0 commit comments

Comments
 (0)