-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change from Dominion ECS to Ashley ECS for J8 Compat
- Loading branch information
Showing
35 changed files
with
160 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
|
||
repositories { | ||
mavenLocal() | ||
maven { url "https://oss.sonatype.org/content/repositories/releases/" } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 8 additions & 26 deletions
34
src/main/java/com/gtnewhorizons/mutecore/SystemRegistrator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,31 @@ | ||
package com.gtnewhorizons.mutecore; | ||
|
||
import com.badlogic.ashley.core.EntitySystem; | ||
|
||
import cpw.mods.fml.common.eventhandler.SubscribeEvent; | ||
import cpw.mods.fml.common.gameevent.TickEvent; | ||
import dev.dominion.ecs.api.Scheduler; | ||
|
||
public class SystemRegistrator { | ||
|
||
private static final Scheduler SYSTEMS = MuTECore.ENGINE.createScheduler(); | ||
|
||
/** | ||
* Register a single system. It will be ran after the last registered system | ||
*/ | ||
public static void registerSystem(Runnable system) { | ||
SYSTEMS.schedule(system); | ||
public static void registerSystem(EntitySystem system) { | ||
MuTECore.ENGINE.addSystem(system); | ||
} | ||
|
||
/** | ||
* Register any amount of systems. The systems will be scheduled one after another. | ||
*/ | ||
public static void registerSystems(Runnable... systems) { | ||
for (Runnable system : systems) { | ||
SYSTEMS.schedule(system); | ||
} | ||
} | ||
|
||
/** | ||
* Register any amount of systems. The systems registered this way will be ran in parallel | ||
*/ | ||
public static void registerSystemsParallel(Runnable... systems) { | ||
int processors = Runtime.getRuntime() | ||
.availableProcessors(); | ||
Runnable[] parallel = new Runnable[processors]; | ||
int count = 0; | ||
for (Runnable system : systems) { | ||
parallel[count++] = system; | ||
if (count >= processors) { | ||
SYSTEMS.parallelSchedule(parallel); | ||
count = 0; | ||
parallel = new Runnable[processors]; | ||
} | ||
public static void registerSystems(EntitySystem... systems) { | ||
for (EntitySystem system : systems) { | ||
MuTECore.ENGINE.addSystem(system); | ||
} | ||
} | ||
|
||
@SubscribeEvent | ||
public void onServerTick(TickEvent.ServerTickEvent event) { | ||
SYSTEMS.tick(); | ||
MuTECore.ENGINE.update(1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
src/main/java/com/gtnewhorizons/mutecore/api/data/Coordinates.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
src/main/java/com/gtnewhorizons/mutecore/api/data/Direction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
src/main/java/com/gtnewhorizons/mutecore/api/data/FirstTickEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
package com.gtnewhorizons.mutecore.api.data; | ||
|
||
public class FirstTickEvent { | ||
import com.badlogic.ashley.core.Component; | ||
|
||
public class FirstTickEvent implements Component { | ||
} |
4 changes: 3 additions & 1 deletion
4
src/main/java/com/gtnewhorizons/mutecore/api/data/GUIEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
src/main/java/com/gtnewhorizons/mutecore/api/data/WorldContainer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.