Skip to content

Commit

Permalink
Merge pull request #14 from FTBTeam/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
desht authored Jul 31, 2024
2 parents e5a195e + 0611dff commit 939c848
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 32 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [21.0.0]

### Changed
* Filter items are now registered to the `FTB Suite` creative tab instead of its own tab
* FTB Filter System now requires FTB Library to be installed
* Version bump from 3.0.0 to 21.0.0 reflects new version numbering scheme based on Minecraft major/minor release

### Fixed
* Fixed recipe for Smart Filter not working

## [3.0.0]

### Changed
Expand All @@ -30,4 +40,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [1.0.0]

* Initial version
* Initial version
22 changes: 22 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,30 @@ allprojects {

// needs to be done AFTER version is set
apply from: "https://raw.githubusercontent.com/FTBTeam/mods-meta/main/gradle/publishing.gradle"
// apply from: "https://raw.githubusercontent.com/FTBTeam/mods-meta/main/gradle/extra-local-mods.gradle"

repositories {
mavenLocal()
maven {
url "https://maven.architectury.dev/"
}

maven {
url "https://maven.saps.dev/releases"
content {
includeGroup "dev.latvian.mods"
includeGroup "dev.ftb.mods"
}
}

maven {
url "https://maven.saps.dev/snapshots"
content {
includeGroup "dev.latvian.mods"
includeGroup "dev.ftb.mods"
}
}

maven {
url "https://maven.blamejared.com"
content {
Expand Down
1 change: 1 addition & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
// Remove the next line if you don't want to depend on the API
modApi "dev.architectury:architectury:${rootProject.architectury_version}"
modApi("dev.ftb.mods:ftb-library:${rootProject.ftb_library_version}") { transitive false }

modCompileOnly("mezz.jei:jei-${rootProject.minecraft_version}-common-api:${rootProject.jei_version}")
modRuntimeOnly("mezz.jei:jei-${rootProject.minecraft_version}-common:${rootProject.jei_version}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import dev.ftb.mods.ftbfiltersystem.registry.FilterRegistry;
import dev.ftb.mods.ftbfiltersystem.registry.ModDataComponents;
import dev.ftb.mods.ftbfiltersystem.registry.ModItems;
import dev.ftb.mods.ftblibrary.FTBLibrary;
import net.minecraft.server.MinecraftServer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand All @@ -38,8 +39,8 @@ public FTBFilterSystem() {

FilterRegistrationEvent.REGISTER.register(this::registerBuiltinFilters);
ModDataComponents.COMPONENT_TYPES.register();
ModItems.TABS.register();
ModItems.ITEMS.register();
ModItems.init();

EnvExecutor.runInEnv(Env.CLIENT, () -> FTBFilterSystemClient.INSTANCE::init);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import dev.architectury.registry.registries.RegistrySupplier;
import dev.ftb.mods.ftbfiltersystem.api.FTBFilterSystemAPI;
import dev.ftb.mods.ftbfiltersystem.registry.item.SmartFilterItem;
import dev.ftb.mods.ftblibrary.FTBLibrary;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
Expand All @@ -17,19 +18,11 @@ public class ModItems {
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(FTBFilterSystemAPI.MOD_ID, Registries.ITEM);
public static final RegistrySupplier<Item> SMART_FILTER = ITEMS.register("smart_filter", SmartFilterItem::new);

public static final DeferredRegister<CreativeModeTab> TABS = DeferredRegister.create(FTBFilterSystemAPI.MOD_ID, Registries.CREATIVE_MODE_TAB);
public static final RegistrySupplier<CreativeModeTab> CREATIVE_TAB = RegistrarManager.get(FTBFilterSystemAPI.MOD_ID)
.get(Registries.CREATIVE_MODE_TAB)
.register(FTBFilterSystemAPI.rl("default"), ModItems::buildDefaultTab);
public static void init() {
CreativeTabRegistry.appendStack(FTBLibrary.getCreativeModeTab(), () -> new ItemStack(SMART_FILTER.get()));
}

public static Item.Properties defaultProps() {
return new Item.Properties();
}

private static CreativeModeTab buildDefaultTab() {
return CreativeTabRegistry.create(builder -> builder.title(Component.translatable(FTBFilterSystemAPI.MOD_ID))
.icon(() -> new ItemStack(ModItems.SMART_FILTER.get()))
.displayItems((params, output) -> output.accept(new ItemStack(ModItems.SMART_FILTER.get())))
);
}
}
10 changes: 7 additions & 3 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,26 @@ configurations {
dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"

// Remove the next line if you don't want to depend on the API
modApi "dev.architectury:architectury-fabric:${rootProject.architectury_version}"
modApi ("dev.ftb.mods:ftb-library-fabric:${rootProject.ftb_library_version}") { transitive false }

modCompileOnly("mezz.jei:jei-${rootProject.minecraft_version}-fabric-api:${rootProject.jei_version}")

common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
}

apply from: "https://raw.githubusercontent.com/FTBTeam/mods-meta/main/gradle/extra-local-mods.gradle"

processResources {
inputs.property "version", project.version

filesMatching("fabric.mod.json") {
expand "version": project.version
expand "version": project.version,
"archversion": project.architectury_version,
"fabricapiversionrange": project.fabric_api_version_range,
"mcversion": project.minecraft_version,
"ftblibraryversion": project.ftb_library_version
}
}

Expand Down
9 changes: 5 additions & 4 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
"ftbfiltersystem.mixins.json"
],
"depends": {
"fabric": "*",
"minecraft": ">=1.20.1",
"architectury": ">=9.1.12"
"fabric": "${fabricapiversionrange}",
"minecraft": "~${mcversion}",
"architectury": ">=${archversion}",
"ftblibrary": ">=${ftblibraryversion}"
},
"breaks": {
"jei": "<19.5.0.40"
}
}
}
2 changes: 0 additions & 2 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ dependencies {
shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false }
}

apply from: "https://raw.githubusercontent.com/FTBTeam/mods-meta/main/gradle/extra-local-mods.gradle"

processResources {
inputs.property "version", project.version

Expand Down
12 changes: 8 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ archives_base_name=ftb-filter-system
readable_name=FTB Filter System
maven_group=dev.ftb.mods

mod_version=21.0.1
mod_version=21.0.0

minecraft_version=1.21
architectury_version=13.0.2
architectury_version=13.0.6

fabric_loader_version=0.15.11
fabric_api_version=0.100.1+1.21
fabric_api_version=0.100.8+1.21
fabric_api_version_range=>=0.100.1+1.21

ftb_library_version=2100.1.4

#forge_version=49.0.31

neoforge_version=21.0.133-beta
neoforge_version=21.0.146
neoforge_version_range=[21.0.143,)
# https://maven.neoforged.net/#/releases/net/neoforged/fancymodloader/loader
neoforge_loader_version=4

Expand Down
9 changes: 5 additions & 4 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,22 @@ dependencies {
modCompileOnly("mezz.jei:jei-${rootProject.minecraft_version}-neoforge-api:${rootProject.jei_version}")
modRuntimeOnly("mezz.jei:jei-${rootProject.minecraft_version}-neoforge:${rootProject.jei_version}")

modApi ("dev.ftb.mods:ftb-library-neoforge:${rootProject.ftb_library_version}") { transitive false }

common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionNeoForge")) { transitive = false }
}

apply from: "https://raw.githubusercontent.com/FTBTeam/mods-meta/main/gradle/extra-local-mods.gradle"

processResources {
inputs.property "version", project.version

filesMatching("META-INF/neoforge.mods.toml") {
expand "version": project.version,
"archversion": project.architectury_version,
"neoforgeversion": project.neoforge_version,
"neoforgeversionrange": project.neoforge_version_range,
"neoforgeloaderversion": project.neoforge_loader_version,
"mcversion": project.minecraft_version
"mcversion": project.minecraft_version,
"ftblibraryversion": project.ftb_library_version
}
}

Expand Down
11 changes: 9 additions & 2 deletions neoforge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Smart and highly configurable item filtering system with useful GUI configuratio
[[dependencies.ftbfiltersystem]]
modId = "neoforge"
type = "required"
versionRange = "[${neoforgeversion},)"
versionRange = "${neoforgeversionrange}"
ordering = "NONE"
side = "BOTH"

Expand All @@ -34,9 +34,16 @@ versionRange = "[${archversion},)"
ordering = "AFTER"
side = "BOTH"

[[dependencies.ftbfiltersystem]]
modId = "ftblibrary"
type = "required"
versionRange = "[${ftblibraryversion},)"
ordering = "AFTER"
side = "BOTH"

[[dependencies.ftbfiltersystem]]
modId = "jei"
type = "optional"
versionRange = "[19.5.0.40,)"
ordering = "AFTER"
side = "BOTH"
side = "BOTH"

0 comments on commit 939c848

Please sign in to comment.