-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
110 additions
and
86 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
14 changes: 14 additions & 0 deletions
14
common/src/main/java/dev/tocraft/ctgen/platform/PlatformService.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package dev.tocraft.ctgen.platform; | ||
|
||
import net.minecraft.core.Registry; | ||
import net.minecraft.resources.ResourceKey; | ||
import org.jetbrains.annotations.ApiStatus; | ||
|
||
import java.util.ServiceLoader; | ||
|
||
@ApiStatus.Internal | ||
public interface PlatformService { | ||
PlatformService INSTANCE = ServiceLoader.load(PlatformService.class).findFirst().orElseThrow(() -> new RuntimeException("Couldn't initialize CTGen Platform Service!")); | ||
|
||
<T> Registry<T> createSimpleRegistry(ResourceKey<Registry<T>> key); | ||
} |
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
49 changes: 0 additions & 49 deletions
49
common/src/main/java/dev/tocraft/ctgen/util/Registrar.java
This file was deleted.
Oops, something went wrong.
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
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
13 changes: 13 additions & 0 deletions
13
fabric/src/main/java/dev/tocraft/ctgen/fabric/service/FabricPlatformService.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package dev.tocraft.ctgen.fabric.service; | ||
|
||
import dev.tocraft.ctgen.platform.PlatformService; | ||
import net.fabricmc.fabric.api.event.registry.FabricRegistryBuilder; | ||
import net.minecraft.core.Registry; | ||
import net.minecraft.resources.ResourceKey; | ||
|
||
public class FabricPlatformService implements PlatformService { | ||
@Override | ||
public <T> Registry<T> createSimpleRegistry(ResourceKey<Registry<T>> key) { | ||
return FabricRegistryBuilder.createSimple(key).buildAndRegister(); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
fabric/src/main/resources/META-INF/services/dev.tocraft.ctgen.platform.PlatformService
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
dev.tocraft.ctgen.fabric.service.FabricPlatformService |
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
13 changes: 13 additions & 0 deletions
13
neoforge/src/main/java/dev/tocraft/ctgen/neoforge/service/NeoForgePlatformService.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package dev.tocraft.ctgen.neoforge.service; | ||
|
||
import dev.tocraft.ctgen.platform.PlatformService; | ||
import net.minecraft.core.Registry; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.neoforged.neoforge.registries.RegistryBuilder; | ||
|
||
public class NeoForgePlatformService implements PlatformService { | ||
@Override | ||
public <T> Registry<T> createSimpleRegistry(ResourceKey<Registry<T>> key) { | ||
return new RegistryBuilder<>(key).create(); | ||
} | ||
} |
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
1 change: 1 addition & 0 deletions
1
neoforge/src/main/resources/META-INF/services/dev.tocraft.ctgen.platform.PlatformService
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
dev.tocraft.ctgen.neoforge.service.NeoForgePlatformService |
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,12 +1,9 @@ | ||
# PreProcessor | ||
mc_id=1213 | ||
|
||
# JDK | ||
java=21 | ||
|
||
# Mappings | ||
#mappings=2024.07.28 | ||
|
||
# Loader | ||
fabric=0.107.0 | ||
neoforge=21.3.3-beta |