Skip to content

Commit

Permalink
Update to Red Core 0.4 & Rename the core mod
Browse files Browse the repository at this point in the history
  • Loading branch information
Desoroxxx committed Jul 30, 2023
1 parent 8f6a2c0 commit 4b2900e
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 37 deletions.
10 changes: 2 additions & 8 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Now weather will follow the current weather, it will rain heavier when a thunder
### Internal

- Revamped GUI's they are now extremely easy to use and create, and the pages components are now independent of each others
- FBP now use Red Core
- GUI's text colors now never uses decimal colors directly and should use when possible hexadecimal colors when possible
- Added documentation for Vector2D, Vector3D, and FBPRenderer
- Switched to [Raven] amazing [RetroFuturaGradle]
Expand All @@ -87,14 +88,7 @@ Now weather will follow the current weather, it will rain heavier when a thunder
- Renamed most of the variables from unreadable names to readable names
- Finished removing useless `@SideOnly`
- Removed useless `isRemote` checks

#### Vectors Redesign

In 0.7 and before FBP was using Minecraft `Vec2f` and `Vec3d` but they have a few problems, by example `Vec3d` lack features like `set`, `copy` or even `scale` plus some of its features are written in a complex and slow manner.
Also, they have a `ZERO` variable which is useless and takes resource's for nothing this is even worst for `Vec2f` since it has tons of useless variables.
And having control over them is really nice, so we need to make our own.

Introducing `Vector2D` and `Vector3D` the brand-new vectors for FBP, which are faster easier to work with and come with great documentation!
- Renamed the plugin from `FMLPlugin` to `FBPPlugin`

#### Changes in exception handling

Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ minecraft {

username = 'Desoroxxx'

extraRunJvmArguments.addAll('-Xmx6G', '-Xms4G', '-Dforge.logging.console.level=debug', '-Dmixin.hotSwap=true', '-Dmixin.checks.interfaces=true', '-Dmixin.debug.export=true')
extraRunJvmArguments.addAll('-Xmx6G', '-Xms4G', '-Dforge.logging.console.level=debug', '-Dmixin.hotSwap=true', '-Dmixin.checks.interfaces=true', '-Dmixin.debug.export=true', "-Dfml.coreMods.load=io.redstudioragnarok.${project.id}.asm.FBPPlugin")

injectedTags.put('ID', project.id)
injectedTags.put('VERSION', project.version)
Expand Down Expand Up @@ -84,13 +84,13 @@ repositories {
}

dependencies {
implementation 'Red-Studio-Ragnarok:Red-Core:0.2'
sources 'Red-Studio-Ragnarok:Red-Core:0.2:sources@jar'
implementation 'Red-Studio-Ragnarok:Red-Core:0.4-Dev-1'
sources 'Red-Studio-Ragnarok:Red-Core:0.4-Dev-1:sources@jar'

implementation 'meldexun:MatrixUtil:1.2.2@jar'
embed 'meldexun:MatrixUtil:1.2.2@jar'

String mixin = modUtils.enableMixins('zone.rong:mixinbooter:8.2', "mixins.${project.id}.refmap.json")
String mixin = modUtils.enableMixins('zone.rong:mixinbooter:8.3', "mixins.${project.id}.refmap.json")
api (mixin) { transitive = false }
annotationProcessor 'org.ow2.asm:asm-debug-all:5.2'
annotationProcessor 'com.google.guava:guava:24.1.1-jre'
Expand Down Expand Up @@ -120,7 +120,7 @@ jar {
manifest.attributes([
'ModSide': 'CLIENT',
'FMLAT': "${project.id}_at.cfg",
'FMLCorePlugin': "io.redstudioragnarok.${project.id}.asm.FMLPlugin",
'FMLCorePlugin': "io.redstudioragnarok.${project.id}.asm.FBPPlugin",
'FMLCorePluginContainsFMLMod': 'true',
'ForceLoadAsMod': 'true'
])
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/redstudioragnarok/fbp/FBP.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// | $$ /$$__ $$| $$ | $$| $$ | $$| $$_____/| $$ | $$ \ $$| $$| $$ | $$| $$ | $$_ $$ | $$ /$$__ $$| $$ | $$ /$$| $$| $$ | $$| $$_____/ \____ $$
// | $$ | $$$$$$$| $$ | $$| $$$$$$$| $$| $$$$$$$| $$ | $$$$$$$/| $$| $$$$$$/| $$$$$$$| $$ \ $$ | $$ | $$$$$$$| $$ | $$$$/| $$| $$$$$$$| $$| $$$$$$$ /$$$$$$$/
// |__/ \_______/|__/ |__/ \_______/|__/ \_______/|__/ |_______/ |__/ \______/ \_______/|__/ \__/ |__/ \_______/|__/ \___/ |__/ \_______/|__/ \_______/|_______/
@Mod(clientSideOnly = true, modid = ModReference.ID, name = ModReference.NAME, version = ModReference.VERSION, guiFactory = "io.redstudioragnarok.fbp.config.FBPConfigGuiFactory", updateJSON = "https://raw.githubusercontent.com/Red-Studio-Ragnarok/Fancier-Block-Particles/main/update.json")
@Mod(clientSideOnly = true, modid = ModReference.ID, name = ModReference.NAME, version = ModReference.VERSION, dependencies = "required-after:redcore@[0.4-Dev-1,)", guiFactory = "io.redstudioragnarok.fbp.config.FBPConfigGuiFactory", updateJSON = "https://raw.githubusercontent.com/Red-Studio-Ragnarok/Fancier-Block-Particles/main/update.json")
public class FBP {

public static final Minecraft mc = Minecraft.getMinecraft();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import zone.rong.mixinbooter.IEarlyMixinLoader;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;

@IFMLLoadingPlugin.TransformerExclusions("io.redstudioragnarok.fbp.asm")
public class FMLPlugin implements IFMLLoadingPlugin, IEarlyMixinLoader {
public class FBPPlugin implements IFMLLoadingPlugin, IEarlyMixinLoader {

@Override
public String[] getASMTransformerClass() {
Expand Down Expand Up @@ -37,7 +38,7 @@ public String getAccessTransformerClass() {

@Override
public List<String> getMixinConfigs() {
return Arrays.asList("mixins.fbp.json");
return Collections.singletonList("mixins.fbp.json");
}

}
3 changes: 2 additions & 1 deletion src/main/java/io/redstudioragnarok/fbp/gui/BasePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.util.Arrays;

import static io.redstudioragnarok.fbp.gui.GuiConfirmation.Action.DefaultConfig;
Expand Down Expand Up @@ -91,7 +92,7 @@ protected void actionPerformed(final GuiButton button) {
break;
case -4:
try {
Desktop.getDesktop().browse(ModReference.newIssueLink);
Desktop.getDesktop().browse(new URI("https://linkify.cz/FancierBugReport"));
} catch (Exception exception) {
// Todo: (Debug Mode) This should count to the problem counter and should output a stack trace
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/redstudioragnarok/fbp/gui/GuiUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.Color;

import static io.redstudioragnarok.fbp.utils.ModReference.redLog;
import static io.redstudioragnarok.fbp.utils.ModReference.RED_LOG;

public class GuiUtils {

Expand Down Expand Up @@ -67,7 +67,7 @@ public static int hexToDecimalColor(final String hexColor) {
} catch (NumberFormatException numberFormatException) {
// Todo: (Debug Mode) This should count to the problem counter

redLog.printFramedError("GUI Rendering", "Hexadecimal to decimal color conversion failed", "Non critical exception falling back to white", numberFormatException.getMessage(), "At:" + numberFormatException.getStackTrace()[3].toString());
RED_LOG.printFramedError("GUI Rendering", "Hexadecimal to decimal color conversion failed", "Non critical exception falling back to white", numberFormatException.getMessage(), "At:" + numberFormatException.getStackTrace()[3].toString());

// Return the decimal value for white
return 16777215;
Expand Down
19 changes: 1 addition & 18 deletions src/main/java/io/redstudioragnarok/fbp/utils/ModReference.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.net.URI;
import java.net.URISyntaxException;

/**
* This class defines constants for FBP.
* <p>
Expand All @@ -19,19 +16,5 @@ public class ModReference {
public static final String NAME = "Fancier Block Particles";
public static final String VERSION = Tags.VERSION;
public static final Logger LOG = LogManager.getLogger(ID);

public static URI newIssueLink;
public static RedLogger redLog;

static {
try {
newIssueLink = new URI("https://linkify.cz/FancierBugReport");

redLog = new RedLogger(NAME, new URI("https://linkify.cz/ValkyrieBugReport"), LOG,
"Hang in there, just a minor bump on the road to particle greatness!"
);
} catch (URISyntaxException e) {
// Todo: (Debug Mode) This should count to the problem counter and should output a stack trace
}
}
public static final RedLogger RED_LOG = new RedLogger(NAME, "https://linkify.cz/ValkyrieBugReport", LOG, "Hang in there, just a minor bump on the road to particle greatness!");
}

0 comments on commit 4b2900e

Please sign in to comment.