Skip to content

Commit

Permalink
Removed Capital + Fixed SCHEDULAR Issue (#56)
Browse files Browse the repository at this point in the history
## Description
Removed the Capital letter in Forge and NeoForge to remove any
incompatibilities with IntelIJ
Ensured that the SCHEDULAR is being restarted when you join a world to
ensure it is always online.

## Changes
- **Change 1**: Removed the Capital letter in Forge and NeoForge
- **Change 2**: Ensured that the SCHEDULAR is being restarted when you
join a world

## How has this been tested?
* Join a world
* Save and Leave
* Rejoin and see if the SCHEDULAR is still active

## Screenshots (if applicable)
<!-- Add screenshots to explain the visual impact of the changes. -->

## Type of Change
- [x] Bug fix
- [ ] New feature
- [ ] Documentation update

## Checklist
- [x] My code follows the style guidelines of this project.
[Contributing](https://github.com/MeAlam1/BlueLib/blob/1.21/CONTRIBUTING.md)
- [x] I have performed a self-review of my own code.
- [x] I have commented my code following the guidelines.
[Contributing](https://github.com/MeAlam1/BlueLib/blob/1.21/CONTRIBUTING.md)
- [x] My changes generate no new warnings.

## Related Issues
* Got the issue through Discord

---------

Co-Authored-By: Bluedude <[email protected]>
  • Loading branch information
MeAlam1 and Dan6335 authored Oct 25, 2024
1 parent 7d70a61 commit 18d1186
Show file tree
Hide file tree
Showing 60 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions common/src/main/java/software/bluelib/BlueLibConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ private BlueLibConstants() {
public static final Logger LOGGER = Logger.getLogger(BlueLibConstants.MOD_NAME);

/**
* A {@code public static final} {@link ScheduledExecutorService} used to schedule tasks, such as printing messages after a delay.
* A {@code public static} {@link ScheduledExecutorService} used to schedule tasks, such as printing messages after a delay.
* <p>
* This executor runs tasks on a single thread to ensure delayed tasks run in a separate thread from the main thread.
* </p>
*
* @since 1.0.0
*/
public static final ScheduledExecutorService SCHEDULER = Executors.newScheduledThreadPool(1);
public static ScheduledExecutorService SCHEDULER = Executors.newScheduledThreadPool(1);

/**
* A {@code public static final} {@link String} representing the Mod ID for the {@code BlueLib} mod.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
Expand Down Expand Up @@ -50,6 +51,7 @@ public class ReloadHandler extends ReloadEventHandler {
* @since 1.0.0
*/
public static void onServerStart(MinecraftServer pServer) {
BlueLibConstants.SCHEDULER = new ScheduledThreadPoolExecutor(1);
server = pServer;
ReloadHandler.LoadEntityVariants(server);
BaseLogger.log(BaseLogLevel.INFO, "Entity variants loaded.", true);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
Expand Down Expand Up @@ -55,6 +56,7 @@ public class ReloadHandler extends ReloadEventHandler {
*/
@SubscribeEvent
public static void onServerStart(ServerStartingEvent pEvent) {
BlueLibConstants.SCHEDULER = new ScheduledThreadPoolExecutor(1);
server = pEvent.getServer();
ReloadHandler.LoadEntityVariants(server);
BaseLogger.log(BaseLogLevel.INFO, "Entity variants loaded.", true);
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ forge_version_range=[51,)
forge_loader_version_range=[0,)

# NeoForge
neoforge_version=21.0.167
neoforge_version=21.1.72
neoforge_loader_version_range=[4,)
neoforge_version_range=[21.0.0-beta,)

Expand Down
4 changes: 2 additions & 2 deletions NeoForge/build.gradle → neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ neoForge {
}

dependencies {
compileOnly("curse.maven:geckolib-388172:5605715")
runtimeOnly("curse.maven:geckolib-388172:5605715")
compileOnly("curse.maven:geckolib-388172:5763144")
runtimeOnly("curse.maven:geckolib-388172:5763144")
}

sourceSets.main.resources { srcDir 'src/generated/resources' }
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
import net.neoforged.fml.event.lifecycle.FMLLoadCompleteEvent;
import net.neoforged.fml.loading.FMLEnvironment;
import org.spongepowered.asm.launch.MixinBootstrap;
import software.bluelib.example.event.ClientEvents;
import software.bluelib.example.init.ModEntities;

import java.util.concurrent.ScheduledThreadPoolExecutor;

/**
* The main class of the {@code BlueLib} mod.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
Expand Down Expand Up @@ -58,6 +59,7 @@ public class ReloadHandler extends ReloadEventHandler {
*/
@SubscribeEvent
public static void onServerStart(ServerStartingEvent pEvent) {
BlueLibConstants.SCHEDULER = new ScheduledThreadPoolExecutor(1);
server = pEvent.getServer();
ReloadHandler.LoadEntityVariants(server);
BaseLogger.log(BaseLogLevel.INFO, "Entity variants loaded.", true);
Expand Down

0 comments on commit 18d1186

Please sign in to comment.