Skip to content

Commit

Permalink
Add .editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
AMereBagatelle committed May 15, 2024
1 parent 017c801 commit 341a78f
Show file tree
Hide file tree
Showing 11 changed files with 1,319 additions and 53 deletions.
1,221 changes: 1,221 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

36 changes: 26 additions & 10 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,56 @@

## Introduction

As a contributor or user of Nuit, you are required to abide by this Code of Conduct to ensure a welcoming and respectful environment for everyone involved. The Code of Conduct applies to all interactions and communication related to the mod, including but not limited to forums, GitHub discussions, in-game chat, and social media.
As a contributor or user of Nuit, you are required to abide by this Code of Conduct to ensure a welcoming and respectful
environment for everyone involved. The Code of Conduct applies to all interactions and communication related to the mod,
including but not limited to forums, GitHub discussions, in-game chat, and social media.

## 1. Be Respectful and Inclusive

Treat all individuals with respect and kindness, regardless of their background, race, ethnicity, gender, age, sexual orientation, religion, or any other personal attribute. This mod aims to be a diverse and inclusive community, and everyone should feel welcome and valued.
Treat all individuals with respect and kindness, regardless of their background, race, ethnicity, gender, age, sexual
orientation, religion, or any other personal attribute. This mod aims to be a diverse and inclusive community, and
everyone should feel welcome and valued.

## 2. Be Collaborative and Supportive

Encourage collaboration and constructive discussions among users and contributors. Offer support and help to others, and foster a positive learning environment. Remember that everyone is here to share their passion for Minecraft and modding.
Encourage collaboration and constructive discussions among users and contributors. Offer support and help to others, and
foster a positive learning environment. Remember that everyone is here to share their passion for Minecraft and modding.

## 3. Be Patient and Understanding

Be patient with others, especially those who may be new to modding or the community. Respect that people may have different levels of experience and expertise, and refrain from belittling or dismissing their contributions or questions.
Be patient with others, especially those who may be new to modding or the community. Respect that people may have
different levels of experience and expertise, and refrain from belittling or dismissing their contributions or
questions.

## 4. Avoid Harassment and Hate Speech

Harassment, bullying, and hate speech will not be tolerated. This includes offensive language, personal attacks, and any form of discriminatory behavior. Respect boundaries and refrain from engaging in behavior that could harm or distress others.
Harassment, bullying, and hate speech will not be tolerated. This includes offensive language, personal attacks, and any
form of discriminatory behavior. Respect boundaries and refrain from engaging in behavior that could harm or distress
others.

## 5. Use Constructive Feedback

Provide feedback in a constructive and respectful manner. Critique ideas, contributions, or proposals based on their merits and potential for improvement. Avoid using harsh language or making personal attacks when discussing issues.
Provide feedback in a constructive and respectful manner. Critique ideas, contributions, or proposals based on their
merits and potential for improvement. Avoid using harsh language or making personal attacks when discussing issues.

## 6. Follow the Project's Guidelines

Adhere to the guidelines and rules set by the mod's maintainers and administrators. These guidelines may include rules related to code contributions, issue reporting, and community interactions. Ignoring guidelines may result in consequences at the discretion of the maintainers.
Adhere to the guidelines and rules set by the mod's maintainers and administrators. These guidelines may include rules
related to code contributions, issue reporting, and community interactions. Ignoring guidelines may result in
consequences at the discretion of the maintainers.

## 7. Report Incidents

If you witness or experience any violation of this Code of Conduct, promptly report it to the mod's maintainers or administrators through appropriate channels. Provide as much detail as possible to aid in resolving the situation.
If you witness or experience any violation of this Code of Conduct, promptly report it to the mod's maintainers or
administrators through appropriate channels. Provide as much detail as possible to aid in resolving the situation.

## 8. Consequences of Non-Compliance

Violation of this Code of Conduct may result in appropriate actions taken by the mod's maintainers, including warnings, temporary bans, or permanent bans from the community. Decisions regarding consequences will be made with fairness and consideration.
Violation of this Code of Conduct may result in appropriate actions taken by the mod's maintainers, including warnings,
temporary bans, or permanent bans from the community. Decisions regarding consequences will be made with fairness and
consideration.

## Conclusion

By contributing to or using Nuit, you agree to uphold this Code of Conduct. Let's work together to maintain a friendly, supportive, and inclusive environment for all users and contributors.
By contributing to or using Nuit, you agree to uphold this Code of Conduct. Let's work together to maintain a friendly,
supportive, and inclusive environment for all users and contributors.
11 changes: 8 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## Code Style

When contributing source code to the project, please adhere to our code style guidelines. These guidelines are based on the [Google code style guidelines for Java](https://google.github.io/styleguide/javaguide.html), with a few minor adjustments as described below:
When contributing source code to the project, please adhere to our code style guidelines. These guidelines are based on
the [Google code style guidelines for Java](https://google.github.io/styleguide/javaguide.html), with a few minor
adjustments as described below:

- Use 4 spaces for indentation, not tabs. Avoid lines that exceed 120 characters in length.
- Avoid deeply nested conditional logic and prefer breaking out into separate functions when possible.
Expand All @@ -14,6 +16,9 @@ We also provide [EditorConfig](https://editorconfig.org/) files, which most Java

## Pull Requests

When submitting a pull request, please include a brief description of the changes you made and link to any relevant open issues that your pull request addresses. Additionally, ensure that your code is well-documented, especially in cases where it might not be immediately obvious, and that it follows our code style guidelines.
When submitting a pull request, please include a brief description of the changes you made and link to any relevant open
issues that your pull request addresses. Additionally, ensure that your code is well-documented, especially in cases
where it might not be immediately obvious, and that it follows our code style guidelines.

We value your contributions and appreciate your efforts in helping us maintain a high-quality codebase. Thank you for contributing to our project!
We value your contributions and appreciate your efforts in helping us maintain a high-quality codebase. Thank you for
contributing to our project!
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#### Implements custom skyboxes, like OptiFine! (With a different format)

![](https://cdn.modrinth.com/data/YBz7DOs8/images/49eab46d1e74e8f781404a8f773a1a09dedda5aa.png)
_Screenshot taken with the [Awesome Skies](https://github.com/heymanMC/Awesome-Skies) resource pack, a pack made to run **only** under Nuit_ (Credit: [heyman](https://github.com/heymanMC))
_Screenshot taken with the [Awesome Skies](https://github.com/heymanMC/Awesome-Skies) resource pack, a pack made to
run **only** under Nuit_ (Credit: [heyman](https://github.com/heymanMC))

</div>

Expand All @@ -21,11 +22,16 @@ The documentation on this format can be found [here](docs).

### OptiFine skybox format

It is **out of the scope** of this mod to support the OptiFine format by itself. [FSB-Interop](https://modrinth.com/mod/fabricskyboxes-interop) is designed as an add-on to Nuit to achieve compatibility with the OptiFine format. Alternatively, [MCPP++](https://modrinth.com/mod/mcpppp) can be used following these [instructions](https://github.com/supsm/MCPPPP#use).
It is **out of the scope** of this mod to support the OptiFine format by
itself. [FSB-Interop](https://modrinth.com/mod/fabricskyboxes-interop) is designed as an add-on to Nuit to achieve
compatibility with the OptiFine format. Alternatively, [MCPP++](https://modrinth.com/mod/mcpppp) can be used following
these [instructions](https://github.com/supsm/MCPPPP#use).

## Suggestions / Support

You can report bugs-issues or suggest new features in the [Issues section](https://github.com/AMereBagatelle/fabricskyboxes/issues), or in the [Discord server](https://discord.gg/quvzkaV).
You can report bugs-issues or suggest new features in
the [Issues section](https://github.com/AMereBagatelle/fabricskyboxes/issues), or in
the [Discord server](https://discord.gg/quvzkaV).

## License

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import com.google.gson.JsonObject;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.serialization.JsonOps;
import io.github.amerebagatelle.mods.nuit.api.NuitPlatformHelper;
import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap;
import io.github.amerebagatelle.mods.nuit.api.NuitApi;
import io.github.amerebagatelle.mods.nuit.api.NuitPlatformHelper;
import io.github.amerebagatelle.mods.nuit.api.skyboxes.Skybox;
import io.github.amerebagatelle.mods.nuit.mixin.LevelRendererAccessor;
import io.github.amerebagatelle.mods.nuit.skybox.Metadata;
import io.github.amerebagatelle.mods.nuit.skyboxes.SkyboxType;
import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap;
import net.minecraft.client.Camera;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.resources.ResourceLocation;
Expand All @@ -22,9 +22,6 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;

public class SkyboxManager implements NuitApi {
private static final SkyboxManager INSTANCE = new SkyboxManager();
Expand Down Expand Up @@ -121,17 +118,17 @@ public List<Skybox> getActiveSkyboxes() {
}

public void tick(ClientLevel level) {
for(Skybox skybox : Iterables.concat(this.skyboxMap.values(), this.permanentSkyboxMap.values())) {
for (Skybox skybox : Iterables.concat(this.skyboxMap.values(), this.permanentSkyboxMap.values())) {
skybox.tick(level);
}

this.activeSkyboxes.removeIf(skybox -> !skybox.isActive());

// Add the skyboxes to a activeSkyboxes container so that they can be ordered
for (Skybox skybox : Iterables.concat(skyboxMap.values(), this.permanentSkyboxMap.values())) {
if(!this.activeSkyboxes.contains(skybox) && skybox.isActive()) {
activeSkyboxes.add(skybox);
}
if (!this.activeSkyboxes.contains(skybox) && skybox.isActive()) {
activeSkyboxes.add(skybox);
}
}
this.activeSkyboxes.sort(Comparator.comparingInt(Skybox::getPriority));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import io.github.amerebagatelle.mods.nuit.util.Utils;
import it.unimi.dsi.fastutil.longs.Long2FloatArrayMap;

import java.util.LinkedHashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import io.github.amerebagatelle.mods.nuit.util.CodecUtils;
import io.github.amerebagatelle.mods.nuit.util.Utils;

public class RGBA {
public static final RGBA DEFAULT = new RGBA(.0F, .0F, .0F, .0F);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.github.amerebagatelle.mods.nuit.skyboxes;

import com.google.common.base.Preconditions;
import com.google.common.collect.BiMap;
import com.google.common.collect.ImmutableBiMap;
import com.mojang.serialization.Codec;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.*;

public class Utils {
public static final UVRange[] TEXTURE_FACES = new UVRange[] {
public static final UVRange[] TEXTURE_FACES = new UVRange[]{
new UVRange(0, 0, 1.0F / 3.0F, 1.0F / 2.0F), // bottom
new UVRange(1.0F / 3.0F, 1.0F / 2.0F, 2.0F / 3.0F, 1), // north
new UVRange(2.0F / 3.0F, 0, 1, 1.0F / 2.0F), // south
Expand Down
51 changes: 39 additions & 12 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# API Documentation

Nuit provides an api that allows you to register skyboxes in code.
The code can be found at [here](/src/main/java/io/github/amerebagatelle/mods/nuit/api).

## Gradle

You can find the version of Nuit you require over at [Modrinth](https://modrinth.com/mod/fabricskyboxes/versions).

```
repositories {
maven {
Expand All @@ -18,24 +20,49 @@ dependencies {
```

## Quickstart

```java
// Verify that Nuit is present
if (FabricLoader.getInstance().isModLoaded("Nuit")) {
// Verify Nuit's API feature set
if (NuitApi.getInstance().getApiVersion() == 0) {
if(FabricLoader.getInstance().

isModLoaded("Nuit")){
// Verify Nuit's API feature set
if(NuitApi.

getInstance().

getApiVersion() ==0){
// Enables Nuit
NuitApi.getInstance().setEnabled(true);
// Clear loaded skyboxes
NuitApi.getInstance().clearSkyboxes();

// Adds a temporary skybox
NuitApi.getInstance().addSkybox(Identifier.of("my_mod", "my_temporary_skybox"), /*JsonObject or Skybox implementation*/);
NuitApi.

getInstance().

setEnabled(true);
// Clear loaded skyboxes
NuitApi.

getInstance().

clearSkyboxes();

// Adds a temporary skybox
NuitApi.

getInstance().

addSkybox(Identifier.of("my_mod", "my_temporary_skybox"), /*JsonObject or Skybox implementation*/);
// Adds a permanent skybox
NuitApi.getInstance().addPermanentSkybox(Identifier.of("my_mod", "my_permanent_skybox"), /*Skybox implementation*/);
}
}
NuitApi.

getInstance().

addPermanentSkybox(Identifier.of("my_mod", "my_permanent_skybox"), /*Skybox implementation*/);
}
}
```

### Skybox Implementation

```java
import io.github.amerebagatelle.mods.nuit.api.skyboxes.Skybox;
import io.github.amerebagatelle.mods.nuit.mixin.skybox.WorldRendererAccess;
Expand Down
21 changes: 9 additions & 12 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
# Done to increase the memory available to Gradle.
org.gradle.jvmargs=-Xmx2G
org.gradle.parallel=true

# Mod properties
mod_version = 1.0.0
maven_group = io.github.amerebagatelle.mods
archives_name = nuit
enabled_platforms = fabric,neoforge

mod_version=1.0.0
maven_group=io.github.amerebagatelle.mods
archives_name=nuit
enabled_platforms=fabric,neoforge
# Minecraft properties
minecraft_version = 1.20.6

minecraft_version=1.20.6
# Dependencies
architectury_api_version = 12.0.26
fabric_loader_version = 0.15.11
fabric_api_version = 0.98.0+1.20.6
neoforge_version = 20.6.61-beta
architectury_api_version=12.0.26
fabric_loader_version=0.15.11
fabric_api_version=0.98.0+1.20.6
neoforge_version=20.6.61-beta

0 comments on commit 341a78f

Please sign in to comment.