-
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.
- Use Neoforge due to issues with running forge
- Loading branch information
1 parent
24013f6
commit fc2164d
Showing
19 changed files
with
281 additions
and
33 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
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
2 changes: 1 addition & 1 deletion
2
forge/src/main/java/io/wispforest/condensed_creative/forge/CondensedCreativeClientForge.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
2 changes: 1 addition & 1 deletion
2
forge/src/main/java/io/wispforest/condensed_creative/forge/CondensedCreativeForge.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
2 changes: 1 addition & 1 deletion
2
forge/src/main/java/io/wispforest/condensed_creative/forge/LoaderSpecificUtilsImpl.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
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 |
---|---|---|
@@ -0,0 +1,108 @@ | ||
plugins { | ||
id "com.github.johnrengelman.shadow" version "7.1.2" | ||
} | ||
|
||
architectury { | ||
platformSetupLoomIde() | ||
neoForge() | ||
} | ||
|
||
repositories { | ||
maven { url "https://maven.neoforged.net/releases/" } | ||
} | ||
|
||
loom { | ||
accessWidenerPath = project(":common").loom.accessWidenerPath | ||
|
||
neoForge { | ||
// convertAccessWideners = true | ||
// extraAccessWideners.add loom.accessWidenerPath.get().asFile.name | ||
// | ||
// mixinConfig "condensedCreativeCommon.mixins.json" | ||
// mixinConfig "condensedCreativeForge.mixins.json" | ||
} | ||
} | ||
|
||
configurations { | ||
common | ||
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this. | ||
compileClasspath.extendsFrom common | ||
runtimeClasspath.extendsFrom common | ||
developmentNeoForge.extendsFrom common | ||
} | ||
|
||
dependencies { | ||
neoForge "net.neoforged:neoforge:${rootProject.neoforge_version}" | ||
// Remove the next line if you don't want to depend on the API | ||
//modApi "dev.architectury:architectury-forge:${rootProject.architectury_version}" | ||
|
||
common(project(path: ":common", configuration: "namedElements")) { transitive false } | ||
shadowCommon(project(path: ":common", configuration: "transformProductionNeoForge")) { transitive = false } | ||
|
||
modApi("me.shedaniel.cloth:cloth-config-neoforge:${rootProject.cloth_config}") | ||
|
||
modImplementation("me.shedaniel.cloth:cloth-config-neoforge:${rootProject.cloth_config}") | ||
} | ||
|
||
processResources { | ||
inputs.property "version", project.version | ||
|
||
filesMatching("META-INF/mods.toml") { | ||
expand "version": project.version | ||
} | ||
} | ||
|
||
shadowJar { | ||
exclude "fabric.mod.json" | ||
exclude "architectury.common.json" | ||
|
||
configurations = [project.configurations.shadowCommon] | ||
archiveClassifier.set "neoforge-dev-shadow" | ||
} | ||
|
||
remapJar { | ||
input.set shadowJar.archiveFile | ||
dependsOn shadowJar | ||
archiveClassifier.set "neoforge" | ||
|
||
atAccessWideners.add(loom.accessWidenerPath.get().asFile.name)//atAccessWideners.add('my_mod.accesswidener') | ||
} | ||
|
||
jar { | ||
archiveClassifier.set "neoforge-dev" | ||
} | ||
|
||
sourcesJar { | ||
def commonSources = project(":common").sourcesJar | ||
dependsOn commonSources | ||
from commonSources.archiveFile.map { zipTree(it) } | ||
archiveClassifier.set "neoforge-sources" | ||
} | ||
|
||
components.java { | ||
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { | ||
skip() | ||
} | ||
} | ||
|
||
def ENV = System.getenv() | ||
|
||
publishing { | ||
publications { | ||
mavenForge(MavenPublication) { | ||
artifactId = rootProject.archives_base_name + "-" + project.name | ||
from components.java | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
url ENV.MAVEN_URL | ||
|
||
credentials { | ||
username ENV.MAVEN_USER | ||
password ENV.MAVEN_PASSWORD | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
loom.platform=neoforge |
38 changes: 38 additions & 0 deletions
38
...src/main/java/io/wispforest/condensed_creative/neoforge/CondensedCreativeClientForge.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,38 @@ | ||
package io.wispforest.condensed_creative.neoforge; | ||
|
||
|
||
import io.wispforest.condensed_creative.CondensedCreative; | ||
import io.wispforest.condensed_creative.compat.CondensedCreativeConfig; | ||
import io.wispforest.condensed_creative.data.CondensedEntriesLoader; | ||
import me.shedaniel.autoconfig.AutoConfig; | ||
import net.neoforged.api.distmarker.Dist; | ||
import net.neoforged.api.distmarker.OnlyIn; | ||
import net.neoforged.bus.api.SubscribeEvent; | ||
import net.neoforged.fml.ModLoadingContext; | ||
import net.neoforged.fml.common.Mod; | ||
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; | ||
import net.neoforged.fml.loading.FMLEnvironment; | ||
import net.neoforged.neoforge.client.ConfigScreenHandler; | ||
import net.neoforged.neoforge.client.event.RegisterClientReloadListenersEvent; | ||
|
||
@Mod.EventBusSubscriber(modid = CondensedCreative.MODID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) | ||
public class CondensedCreativeClientForge { | ||
|
||
@OnlyIn(Dist.CLIENT) | ||
@SubscribeEvent | ||
public static void setupClient(final FMLClientSetupEvent event){ | ||
event.enqueueWork(() -> { | ||
CondensedCreative.onInitializeClient(!FMLEnvironment.production); | ||
|
||
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, | ||
() -> new ConfigScreenHandler.ConfigScreenFactory( | ||
(client, parent) -> AutoConfig.getConfigScreen(CondensedCreativeConfig.class, parent).get())); | ||
}); | ||
} | ||
|
||
@OnlyIn(Dist.CLIENT) | ||
@SubscribeEvent | ||
public static void registerReloadListener(RegisterClientReloadListenersEvent event){ | ||
event.registerReloadListener(new CondensedEntriesLoader()); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
neoforge/src/main/java/io/wispforest/condensed_creative/neoforge/CondensedCreativeForge.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,11 @@ | ||
package io.wispforest.condensed_creative.neoforge; | ||
|
||
import io.wispforest.condensed_creative.CondensedCreative; | ||
import net.neoforged.fml.common.Mod; | ||
|
||
@Mod(CondensedCreative.MODID) | ||
public class CondensedCreativeForge { | ||
|
||
public CondensedCreativeForge() {} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
...orge/src/main/java/io/wispforest/condensed_creative/neoforge/LoaderSpecificUtilsImpl.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,46 @@ | ||
package io.wispforest.condensed_creative.neoforge; | ||
|
||
import com.mojang.logging.LogUtils; | ||
import io.wispforest.condensed_creative.registry.CondensedCreativeInitializer; | ||
import net.neoforged.fml.ModList; | ||
import net.neoforged.neoforgespi.language.ModFileScanData; | ||
import org.objectweb.asm.Type; | ||
import org.slf4j.Logger; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class LoaderSpecificUtilsImpl { | ||
|
||
public static final Logger LOGGER = LogUtils.getLogger(); | ||
|
||
public static List<CondensedCreativeInitializer> getEntryPoints(){ | ||
final List<CondensedCreativeInitializer> condensedCreativeInitializers = new ArrayList<>(); | ||
|
||
for(ModFileScanData data : ModList.get().getAllScanData()) { | ||
for (ModFileScanData.AnnotationData annotationData : data.getAnnotations()) { | ||
if(!annotationData.annotationType().equals(Type.getType(CondensedCreativeInitializer.InitializeCondensedEntries.class))){ | ||
continue; | ||
} | ||
|
||
try { | ||
Class<?> clazz = Class.forName(annotationData.memberName()); | ||
|
||
if(CondensedCreativeInitializer.class.isAssignableFrom(clazz)){ | ||
try { | ||
condensedCreativeInitializers.add((CondensedCreativeInitializer) clazz.getDeclaredConstructor().newInstance()); | ||
} catch (Throwable e){ | ||
LOGGER.error("Failed to load CondensedEntryInit: " + annotationData.memberName(), e); | ||
} | ||
} | ||
} catch (Throwable e) { | ||
LOGGER.error("No class from such annotation: " + annotationData.memberName(), e); | ||
} | ||
|
||
break; | ||
} | ||
} | ||
|
||
return condensedCreativeInitializers; | ||
} | ||
} |
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,32 @@ | ||
modLoader = "javafml" | ||
loaderVersion = "[1,)" | ||
issueTrackerURL = "https://github.com/wisp-forest/condensed-creative/issues" | ||
license = "MIT license" | ||
|
||
[[mods]] | ||
modId = "condensed_creative" | ||
version = "${version}" | ||
displayName = "Condensed Creative" | ||
authors = "Blodhgarm" | ||
description = ''' | ||
A Mod that allows for Modders to Condense there many blocks into Bedrock like Item Entry's! | ||
''' | ||
logoFile = "icon.png" | ||
[[mixins]] | ||
config = 'condensedCreativeCommon.mixins.json' | ||
[[mixins]] | ||
config = 'condensedCreativeForge.mixins.json' | ||
|
||
[[dependencies.condensed_creative]] | ||
modId = "neoforge" | ||
required = true | ||
versionRange = "[20,)" | ||
ordering = "NONE" | ||
side = "BOTH" | ||
|
||
[[dependencies.condensed_creative]] | ||
modId = "minecraft" | ||
required = true | ||
versionRange = "[1.20,)" | ||
ordering = "NONE" | ||
side = "BOTH" |
13 changes: 13 additions & 0 deletions
13
neoforge/src/main/resources/condensedCreativeForge.mixins.json
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 @@ | ||
{ | ||
"required": true, | ||
"package": "io.wispforest.condensed_creative.neoforge.mixins", | ||
"compatibilityLevel": "JAVA_17", | ||
"minVersion": "0.8", | ||
"client": [ | ||
], | ||
"mixins": [ | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,6 @@ | ||
{ | ||
"pack": { | ||
"description": "Condensed Creative", | ||
"pack_format": 9 | ||
} | ||
} |
Oops, something went wrong.