Skip to content

Commit

Permalink
Reformat all project code with new style
Browse files Browse the repository at this point in the history
  • Loading branch information
Zelaux committed Feb 6, 2025
1 parent 55fbe25 commit 630d512
Show file tree
Hide file tree
Showing 192 changed files with 8,965 additions and 8,416 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug report
description: Submit an issue that you have found while playing Omaloon.
labels: ["bug"]
labels: [ "bug" ]

body:
- type: dropdown
Expand Down
54 changes: 27 additions & 27 deletions .run/Omaloon [debug jar].run.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Omaloon [debug jar]" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="env">
<map>
<entry key="lombok.plugin.debug_sleep" value="3600" />
</map>
</option>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="--stacktrace" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="jar" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
<configuration default="false" name="Omaloon [debug jar]" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="env">
<map>
<entry key="lombok.plugin.debug_sleep" value="3600"/>
</map>
</option>
<option name="executionName"/>
<option name="externalProjectPath" value="$PROJECT_DIR$"/>
<option name="externalSystemIdString" value="GRADLE"/>
<option name="scriptParameters" value="--stacktrace"/>
<option name="taskDescriptions">
<list/>
</option>
<option name="taskNames">
<list>
<option value="jar"/>
</list>
</option>
<option name="vmOptions"/>
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2"/>
</configuration>
</component>
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
[![Total Downloads](https://img.shields.io/github/downloads/xStaBUx/Omaloon-mod-public/total?color=7289da&label&logo=docusign&logoColor=white&style=for-the-badge)](https://github.com/xStaBUx/Omaloon-mod-public/releases)

> An ambitious [Mindustry](https://github.com/Anuken/Mindustry) mod
developed by [stabu](https://github.com/stabu-dev) and [uujuju](https://github.com/uujuju1).
Mod aimed at expanding a campaign by adding a new star system.
> developed by [stabu](https://github.com/stabu-dev) and [uujuju](https://github.com/uujuju1).
> Mod aimed at expanding a campaign by adding a new star system.
## Building from Source

Expand All @@ -22,21 +22,25 @@ Mod aimed at expanding a campaign by adding a new star system.
### Setup

1. Clone the repository:

```bash
git clone -b master --single-branch https://github.com/xstabux/Omaloon
```

2. Set up environment variables:

- Set `ANDROID_SDK_ROOT` or `ANDROID_HOME` to your Android SDK installation path (required for Android builds)

### Building

For Desktop:

```bash
gradlew jar
```

For Android:

```bash
gradlew dex
```
Expand All @@ -46,38 +50,47 @@ The built mod will be in the `build/libs` directory.
### Running

To test the mod directly:

```bash
gradlew runClient
```

This Mindustry client uses the `run` directory to store its data.

## Contributing

### Bug Reports

- Submit bug reports in the [Issues](https://github.com/xStaBUx/Omaloon-mod-public/issues) section
- Include detailed steps to reproduce the issue
- Mention your game version and mod version

### Feature Suggestions

- Join our [Discord server](https://discord.gg/bNMT82Hswb) to suggest new content
- Provide examples and specific arguments why your suggestion should be added to Omaloon
- The Issues section is reserved for bug reports only

### Game-play Feedback

- Share your thoughts on game-play and balancing in our Discord
- Provide specific examples and reasoning for balance changes

### Pull Requests

- Improve Omaloon's code/sprites/localization and propose these changes to us by creating a [Pull Request](https://github.com/stabu-dev/Omaloon/pulls).
- Make sure your code works properly and doesn't cause any issues.
- Provide specific reasoning why your Pull Request should be accepted.

## Credits

### Developers

- stabu - Lead Dev
- uujuju - Dev

### Contributors

- randomguy - Weathers code
- zelaux - Arc library, some code
- saigononozomi - Music
Expand Down
18 changes: 9 additions & 9 deletions annotations/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
println("Hello from gradle")
apply plugin: "java"

tasks.withType(JavaCompile).tap {
configureEach {
tasks.withType(JavaCompile).tap{
configureEach{
options.fork = true
options.compilerArgs += [
'--add-exports', 'jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED',
Expand All @@ -20,17 +20,17 @@ tasks.withType(JavaCompile).tap {
]
}
}
repositories {
repositories{
// Necessary Maven repositories to pull dependencies from.
mavenCentral()

maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
maven { url "https://raw.githubusercontent.com/GlennFolker/EntityAnnoMaven/main" }
maven{ url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven{ url "https://oss.sonatype.org/content/repositories/releases/" }
maven{ url "https://raw.githubusercontent.com/GlennFolker/EntityAnnoMaven/main" }

// Use Zelaux's non-buggy repository for release Mindustry and Arc builds.
maven { url "https://raw.githubusercontent.com/Zelaux/MindustryRepo/master/repository" }
maven { url "https://raw.githubusercontent.com/Zelaux/Repo/master/repository" }
maven{ url "https://raw.githubusercontent.com/Zelaux/MindustryRepo/master/repository" }
maven{ url "https://raw.githubusercontent.com/Zelaux/Repo/master/repository" }
}

/*tasks.withType(JavaCompile){
Expand All @@ -42,7 +42,7 @@ repositories {
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5008"
)
}*/
dependencies {
dependencies{
implementation asmLib.invoke(":annotations:lombok-plugin-starter")


Expand Down
Original file line number Diff line number Diff line change
@@ -1,80 +1,79 @@
package bytelogic.lombok.hierarchy;

import bytelogic.lombok.hierarchy.info.ClassInfo;
import bytelogic.lombok.hierarchy.info.InterfaceInfo;
import bytelogic.lombok.util.Util;
import lombok.javac.JavacNode;
import lombok.val;
import one.util.streamex.EntryStream;
import org.jetbrains.annotations.NotNull;
import bytelogic.lombok.hierarchy.info.*;
import bytelogic.lombok.util.*;
import lombok.javac.*;
import lombok.*;
import one.util.streamex.*;
import org.jetbrains.annotations.*;

import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.*;

public class CollectedHierarchyInfo {
public class CollectedHierarchyInfo{
public static final String JAVA_LANG_OBJECT = "java.lang.Object";
public static final InterfaceInfo interfacesRoot = new InterfaceInfo("?interfacesRoot?", "?interfacesRoot?");
static ClassInfo javaLangObject = new ClassInfo(JAVA_LANG_OBJECT, JAVA_LANG_OBJECT);
static Map<String, ClassInfo> classInfoMap;
static Map<String, InterfaceInfo> interfacesInfoMap;

public static ClassInfo classInfo(String className) {
public static ClassInfo classInfo(String className){
return classInfoMap.get(className);
}

public static InterfaceInfo interfaceInfo(String name) {
public static InterfaceInfo interfaceInfo(String name){
return interfacesInfoMap.get(name);
}

public static EntryStream<String, InterfaceInfo> interfaces() {
public static EntryStream<String, InterfaceInfo> interfaces(){
return EntryStream.of(interfacesInfoMap)
.removeKeys(it -> it.equals(interfacesRoot.name));
}

public static EntryStream<String, ClassInfo> classes() {
public static EntryStream<String, ClassInfo> classes(){
return EntryStream.of(classInfoMap);
}


@NotNull
public static ArrayList<ClassInfo> collectAllImpl(InterfaceInfo interfaceInfo) {
public static ArrayList<ClassInfo> collectAllImpl(InterfaceInfo interfaceInfo){
ArrayList<InterfaceInfo> allSubTypes = collectAllSub(interfaceInfo);
val classInfoStream = allSubTypes
.stream()
.map(it -> it.impltypes.values())
.flatMap(Collection::stream)
.distinct()
.toArray(ClassInfo[]::new);
.stream()
.map(it -> it.impltypes.values())
.flatMap(Collection::stream)
.distinct()
.toArray(ClassInfo[]::new);
;

ArrayList<ClassInfo> implementedClasses = new ArrayList<>();
Set<String> visitedNames = new HashSet<>();
class Visitor {
static void visit(Set<String> visitedNames, ClassInfo info, ArrayList<ClassInfo> targetCollection) {
if (!visitedNames.add(info.name)) return;
class Visitor{
static void visit(Set<String> visitedNames, ClassInfo info, ArrayList<ClassInfo> targetCollection){
if(!visitedNames.add(info.name)) return;
targetCollection.add(info);
for (ClassInfo value : info.subtypes.values()) {
for(ClassInfo value : info.subtypes.values()){
visit(visitedNames, value, targetCollection);
}
}
}
for (ClassInfo info : classInfoStream) {
for(ClassInfo info : classInfoStream){
Visitor.visit(visitedNames, info, implementedClasses);
}
return implementedClasses;
}

@NotNull
public static ArrayList<InterfaceInfo> collectAllSub(InterfaceInfo interfaceInfo) {
public static ArrayList<InterfaceInfo> collectAllSub(InterfaceInfo interfaceInfo){
ArrayList<InterfaceInfo> allSubTypes = new ArrayList<>();
//noinspection unchecked
BiConsumer<String, InterfaceInfo> visitor = new BiConsumer<>() {
BiConsumer<String, InterfaceInfo> visitor = new BiConsumer<>(){

Set<String> visitedNames = new HashSet<>();

@Override
public void accept(String name, InterfaceInfo info) {
if (!visitedNames.add(info.name)) return;
public void accept(String name, InterfaceInfo info){
if(!visitedNames.add(info.name)) return;
allSubTypes.add(info);
info.subtypes.forEach(this);
}
Expand All @@ -83,25 +82,25 @@ public void accept(String name, InterfaceInfo info) {
return allSubTypes;
}

public static ClassInfo classInfo(JavacNode typeNode) {
public static ClassInfo classInfo(JavacNode typeNode){
return classInfo(Util.canonicalFullname(typeNode));
}

public static ClassInfo classInfoOrThrown(JavacNode typeNode) {
public static ClassInfo classInfoOrThrown(JavacNode typeNode){
String mirrorName = Util.canonicalFullname(typeNode);
ClassInfo classInfo = classInfo(mirrorName);
if (classInfo == null) throw new RuntimeException("Cannot find info for class " + mirrorName);
if(classInfo == null) throw new RuntimeException("Cannot find info for class " + mirrorName);
return classInfo;
}

public static InterfaceInfo interfaceInfo(JavacNode typeNode) {
public static InterfaceInfo interfaceInfo(JavacNode typeNode){
return interfaceInfo(Util.canonicalFullname(typeNode));
}

public static InterfaceInfo interfaceInfoOrThrown(JavacNode typeNode) {
public static InterfaceInfo interfaceInfoOrThrown(JavacNode typeNode){
String string = Util.canonicalFullname(typeNode);
InterfaceInfo interfaceInfo = interfaceInfo(string);
if (interfaceInfo == null) throw new RuntimeException("Cannot find info for interface " + string);
if(interfaceInfo == null) throw new RuntimeException("Cannot find info for interface " + string);
return interfaceInfo;
}
}
Loading

0 comments on commit 630d512

Please sign in to comment.