Skip to content

Commit b7e6dfe

Browse files
committed
🚀 1.1.0
Signed-off-by: Qboi123 <30625109+Qboi123@users.noreply.github.com>
1 parent 74da17c commit b7e6dfe

File tree

79 files changed

+865
-262
lines changed

Some content is hidden

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

79 files changed

+865
-262
lines changed

‎.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ atlassian-ide-plugin.xml
2525
*.ctxt
2626

2727
# Package Files #
28-
*.jar
2928
*.war
3029
*.nar
3130
*.ear
32-
*.zip
3331
*.tar.gz
3432
*.rar
3533

Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
f1fa2797e65a6fa5db2ec0499e4a9b0d
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5c650839777dce4242877861da6944aed8b98503
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6aa083b262bc3ceb4f80be7e772937c6952d9bbf9c9dbc73969c9a0c87e817f4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fe2f3eee914658e36c60e801620980de479ac0ccaa62b5d41bd443470e04f0c1eb583f35b63317fae9757d59feda3574496e6fa4729663a4fdc0cb8d3667d1e0
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bdd4bd8a0ae87a68453e1b19fbd433bd
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
578c20aea086cf9a9df74dada550b7677d6659c3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
04e6655d2ef8f7f53bababa507188d090cb15a23ec22beaf46fc51511b115979
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2d127b7071268d21da3dd329e1cd528b00eb1b6487b307834074b724070a542ba8d0490d2203e2e6f69edfd5323c5cf6268ddeaf45bc220458ea21bdfd34b8b1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.ultreon.mods</groupId>
5+
<artifactId>advanced-debug</artifactId>
6+
<version>1.1.0</version>
7+
<dependencies/>
8+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
f6d67e7d4b8da712f9497dba14705d4f
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
58ff8b108db118f41611aa8694810b0c3c01b546
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fde38a5bef2d557f75293c81928d17caf30c5c44aadd74537fc99df541abb21d
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
463f139b9637710847b95d3a6f0eae41c55635406b9356dc21c11259d35394d44ed58d38a6810727147c7aacaab4b81f0d43b11382a63d7435741878a5b38d1d

‎.maven_repo/com/ultreon/mods/advanced-debug/maven-metadata.xml

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
<groupId>com.ultreon.mods</groupId>
44
<artifactId>advanced-debug</artifactId>
55
<versioning>
6-
<latest>1.0.0</latest>
7-
<release>1.0.0</release>
6+
<latest>1.1.0</latest>
7+
<release>1.1.0</release>
88
<versions>
99
<version>1.0.0</version>
10+
<version>1.1.0</version>
1011
</versions>
11-
<lastUpdated>20220309161544</lastUpdated>
12+
<lastUpdated>20220309170001</lastUpdated>
1213
</versioning>
1314
</metadata>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
81f5a446c38246dc20e1b28bc3738ab2
1+
6287310fea2162b1f7cee1ed008f113b
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9db4384936482ec3adcdaa22c07f6e415cd3a66c
1+
93aad76df12fd2028f700b27c6d29b8c643028fa
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2fe0c83577617298d9b19b06b2a9961b80df95cd0c79850e4a5e76455d4357d7
1+
3fbafb66b3f8e32a90605e6f68896bf06d7e76904f5258214128912bfdc53392
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a367e14b49d98ec34614ecd4d2ee8a3e61b28dc00b77a0dffeadf42146edae1a1d3241fe290097aea3045b3788745acc0fda6d09af4bb946739b910f4d614f23
1+
dce74fc63bce183f08c534c71824b0430ec9e95dd8c91b0bfb1572725dfcab0132e4bfe49cdb066f31427c1c621a0a523df5de247bb166d2a69d0362fd7a6954

‎.run/Publish to Maven.run.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<component name="ProjectRunConfigurationManager">
2-
<configuration default="false" name="Publish to Maven" type="GradleRunConfiguration" factoryName="Gradle">
2+
<configuration default="false" name="Publish to Main Maven" type="GradleRunConfiguration" factoryName="Gradle">
33
<ExternalSystemSettings>
44
<option name="executionName" />
55
<option name="externalProjectPath" value="$PROJECT_DIR$" />

‎build.gradle

+130-3
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,64 @@ apply plugin: 'eclipse'
2222
apply plugin: 'maven-publish'
2323

2424
group = 'com.ultreon.mods'
25-
version = '1.0.0'
25+
version = '1.1.0'
2626

2727
java {
2828
archivesBaseName = 'advanced-debug'
2929
toolchain.languageVersion = JavaLanguageVersion.of(17)
3030
}
3131

32+
Project proj = project
33+
34+
eclipse {
35+
classpath {
36+
file {
37+
whenMerged { cp ->
38+
project.logger.lifecycle "[eclipse] Excluding sourceSet outputs from eclipse dependencies for project '${project.path}'"
39+
cp.entries.grep { it.kind == 'lib' }.each { entry ->
40+
rootProject.allprojects { Project project ->
41+
String buildDirPath = project.buildDir.path.replace('\\', '/') + '/'
42+
String entryPath = entry.path
43+
44+
if (entryPath.startsWith(buildDirPath)) {
45+
cp.entries.remove entry
46+
47+
if (project != proj) {
48+
boolean projectContainsProjectDep = false
49+
for (Configuration cfg : proj.configurations) {
50+
boolean cfgContainsProjectDependency = cfg.allDependencies.withType(ProjectDependency).collect { it.dependencyProject }.contains(project)
51+
if(cfgContainsProjectDependency) {
52+
projectContainsProjectDep = true
53+
break
54+
}
55+
}
56+
if (!projectContainsProjectDep) {
57+
throw new GradleException("The project '${proj.path}' has a dependency to the outputs of project '${project.path}', but not to the project itself. This is not allowed because it will cause compilation in eclipse to behave differently than in gradle.")
58+
}
59+
}
60+
}
61+
}
62+
}
63+
}
64+
}
65+
}
66+
}
67+
68+
sourceSets {
69+
// Note that just declaring this source set creates two configurations.
70+
api {
71+
java {
72+
73+
}
74+
}
75+
main {
76+
java {
77+
compileClasspath += api.output
78+
runtimeClasspath += api.output
79+
}
80+
}
81+
}
82+
3283
minecraft {
3384
// The mappings can be changed at any time and must be in the following format.
3485
// Channel: Version:
@@ -144,6 +195,12 @@ repositories {
144195
// }
145196
}
146197

198+
configurations {
199+
apiImplementation.extendsFrom(implementation)
200+
apiCompileOnly.extendsFrom(compileOnly)
201+
apiRuntimeOnly.extendsFrom(runtimeOnly)
202+
}
203+
147204
dependencies {
148205
// Specify the version of Minecraft to use. If this is any group other than 'net.minecraft' it is assumed
149206
// that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
@@ -178,6 +235,67 @@ jar {
178235
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
179236
])
180237
}
238+
239+
dependsOn "apiJar"
240+
}
241+
242+
classes {
243+
dependsOn "apiClasses"
244+
245+
doLast {
246+
// Add directories with generated sources (might be several - one for every supported language).
247+
copy {
248+
from sourceSets.api.output.classesDirs
249+
into sourceSets.main.output.classesDirs.singleFile
250+
duplicatesStrategy DuplicatesStrategy.EXCLUDE
251+
}
252+
}
253+
}
254+
255+
processResources {
256+
dependsOn "processApiResources"
257+
258+
// Add output directories of the source set's resources.
259+
from sourceSets.api.output.resourcesDir
260+
}
261+
262+
// Example for how to get properties into the manifest for reading at runtime.
263+
task apiJar (type: Jar) {
264+
manifest {
265+
attributes([
266+
"Specification-Title" : "advanceddebug",
267+
"Specification-Vendor" : "Qboi123",
268+
"Specification-Version" : "1", // We are version 1 of ourselves
269+
"Implementation-Title" : project.name,
270+
"Implementation-Version" : project.jar.archiveVersion,
271+
"Implementation-Vendor" : "Qboi123",
272+
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
273+
])
274+
}
275+
276+
// Add directories with generated sources (might be several - one for every supported language).
277+
from sourceSets.api.output.classesDirs
278+
279+
// Add output directories of the source set's resources.
280+
from sourceSets.api.output.resourcesDir
281+
282+
classifier "api"
283+
}
284+
285+
reobf {
286+
jar {
287+
288+
}
289+
290+
apiJar {
291+
dependsOn createMcpToSrg
292+
mappings = createMcpToSrg.outputs.files.singleFile
293+
}
294+
}
295+
296+
artifacts {
297+
archives apiJar
298+
archives jar
181299
}
182300

183301
jar.finalizedBy('reobfJar')
@@ -192,12 +310,21 @@ publishing {
192310
}
193311
publications {
194312
//noinspection GroovyAssignabilityCheck
195-
gpr(MavenPublication) {
313+
main(MavenPublication) {
196314
from components.java
315+
artifact apiJar
316+
pom.withXml {
317+
//noinspection GroovyImplicitNullArgumentCall
318+
def pomNode = asNode()
319+
pomNode.dependencies.'*'.findAll() {
320+
it.groupId.text() == 'net.minecraftforge' && it.artifactId.text() == "forge"
321+
}.each() {
322+
it.parent().remove(it)
323+
}
324+
}
197325
}
198326
}
199327
}
200-
201328
tasks.withType(GenerateModuleMetadata) {
202329
enabled = false
203330
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.ultreon.mods.advanceddebug.api;
2+
3+
import com.ultreon.mods.advanceddebug.api.client.menu.IDebugGui;
4+
import com.ultreon.mods.advanceddebug.api.client.registry.IFormatterRegistry;
5+
6+
import java.lang.reflect.InvocationTargetException;
7+
8+
public interface IAdvancedDebug {
9+
static IAdvancedDebug get() {
10+
try {
11+
return (IAdvancedDebug) Class.forName("com.ultreon.mods.advanceddebug.AdvancedDebug").getDeclaredMethod("getInstance").invoke(null);
12+
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException | ClassNotFoundException e) {
13+
throw new IllegalStateException("Can't get instance object of the Advanced Debug Mod.");
14+
}
15+
}
16+
17+
IDebugGui getGui();
18+
19+
IFormatterRegistry getFormatterRegistry();
20+
21+
String getModId();
22+
}

‎src/main/java/com/ultreon/mods/advanceddebug/client/menu/DebugPage.java renamed to ‎src/api/java/com/ultreon/mods/advanceddebug/api/client/menu/DebugPage.java

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
package com.ultreon.mods.advanceddebug.client.menu;
1+
package com.ultreon.mods.advanceddebug.api.client.menu;
22

33
import com.mojang.blaze3d.platform.Window;
44
import com.mojang.blaze3d.vertex.PoseStack;
5-
import com.ultreon.mods.advanceddebug.common.*;
5+
import com.ultreon.mods.advanceddebug.api.common.*;
66
import net.minecraft.client.Minecraft;
77
import net.minecraft.resources.ResourceLocation;
88
import net.minecraft.world.phys.Vec3;
@@ -23,25 +23,25 @@ public DebugPage(String modId, String name) {
2323
this.resourceLocation = new ResourceLocation(modId, name);
2424
}
2525

26-
public abstract void render(PoseStack poseStack, DebugRenderContext ctx);
26+
public abstract void render(PoseStack poseStack, IDebugRenderContext ctx);
2727

28-
protected static Formattable getFormatted(String s) {
28+
protected static IFormattable getFormatted(String s) {
2929
return () -> s;
3030
}
3131

32-
protected static Formattable getMultiplier(double multiplier) {
32+
protected static IFormattable getMultiplier(double multiplier) {
3333
return new Multiplier(multiplier);
3434
}
3535

36-
protected static Formattable getSize(int w, int h) {
36+
protected static IFormattable getSize(int w, int h) {
3737
return new IntSize(w, h);
3838
}
3939

40-
protected static Formattable getSize(float w, float h) {
40+
protected static IFormattable getSize(float w, float h) {
4141
return new FloatSize(w, h);
4242
}
4343

44-
protected static Formattable getPercentage(double value) {
44+
protected static IFormattable getPercentage(double value) {
4545
return new Percentage(value);
4646
}
4747

@@ -53,22 +53,18 @@ protected static Color getColor(int rgb) {
5353
return new Color(rgb);
5454
}
5555

56-
protected static Formattable getAngle(double angle) {
56+
protected static IFormattable getAngle(double angle) {
5757
return new Angle(angle * 360.0d);
5858
}
5959

60-
protected static Formattable getRadians(double angle) {
60+
protected static IFormattable getRadians(double angle) {
6161
return new Angle(Math.toDegrees(angle));
6262
}
6363

64-
protected static Formattable getDegrees(double angle) {
64+
protected static IFormattable getDegrees(double angle) {
6565
return new Angle(angle);
6666
}
6767

68-
protected static MoonPhase getMoonPhase(int index) {
69-
return MoonPhase.fromIndex(index);
70-
}
71-
7268
public Minecraft getMinecraft() {
7369
return mc;
7470
}

‎src/main/java/com/ultreon/mods/advanceddebug/client/menu/Formatter.java renamed to ‎src/api/java/com/ultreon/mods/advanceddebug/api/client/menu/Formatter.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
package com.ultreon.mods.advanceddebug.client.menu;
1+
package com.ultreon.mods.advanceddebug.api.client.menu;
22

3+
import com.ultreon.mods.advanceddebug.api.IAdvancedDebug;
4+
import com.ultreon.mods.advanceddebug.api.common.IFormatter;
35
import net.minecraft.resources.ResourceLocation;
46
import net.minecraftforge.registries.ForgeRegistryEntry;
57

6-
public abstract class Formatter<T> extends ForgeRegistryEntry<Formatter<T>> {
8+
public abstract class Formatter<T> extends ForgeRegistryEntry<Formatter<T>> implements IFormatter {
79
private final Class<T> clazz;
810

911
public Formatter(Class<T> clazz, ResourceLocation name) {
1012
this.clazz = clazz;
1113
this.setRegistryName(name);
1214
}
13-
14-
public abstract void format(T obj, StringBuilder sb);
1515

16+
public abstract void format(T obj, StringBuilder sb);
1617

17-
protected final String format(Object obj) {
18-
return DebugGui.format(obj);
18+
@Override
19+
public final String format(Object obj) {
20+
return IAdvancedDebug.get().getGui().format(obj);
1921
}
2022

2123
public Class<T> clazz() {

0 commit comments

Comments
 (0)