Skip to content

Commit

Permalink
Port to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Crystal-Spider committed Jul 10, 2024
1 parent 687f072 commit ec64280
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 246 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ and this project adheres to [Crystal Nest Semantic Versioning](https://crystalne

## [Unreleased]

[//]: # (- Nothing new.)
- Nothing new.

[//]: # (## [5.0.0] - 2024/07/dd)
## [5.0.0] - 2024/07/10

- Ported to 1.21
- Dropped support for Forge.
Expand All @@ -18,6 +18,7 @@ and this project adheres to [Crystal Nest Semantic Versioning](https://crystalne
- Added new exclusive_set tags to easily add enchantment exclusion with other custom fire aspect and flame enchantments.
- DDFires can now support enchantments (as enchantments are now separated from Fire instances and are server sided).
- Added new Ignite EnchantmentEntityEffect to ignite while setting a fire type.
- Removed mod configuration, and FCAP dependency, since now enchantment configuration needs to be done via data pack.
- Added support for upside down english and shakespearean english.
- Removed mixins related to handling enchantment effects.
- Added new fire property for the campfire damage source.
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ This mod makes Soul Fire actually work as one would expect, all whilst providing
![Arrows](https://raw.githubusercontent.com/crystal-nest/mod-fancy-assets/main/soul-fire-d/arrow.gif)
- **Two new enchantments: Soul Fire Aspect and Soul Flame.**
As their name suggests, they work exactly the same as Fire Aspect and Flame with the only difference being the kind of fire the target will burn from, with the consequent damage increase.
Both these enchantments can be highly configured individually, enabling (default) or disabling them and more.
Both these enchantments can be highly configured individually, enabling (default) or disabling them and more.
*Configuration is done via data pack since `1.21`*
- **API for custom fire types:**
For mod/datapack creators who want to add their own custom fire(s), or implement another mod's fire, this mod provides an *easy-to-use* API to register your fire(s) and have it(them) behave consistently **automatically**.
Furthermore for each new fire registered using this API there can be new custom Fire Aspect and Flame enchantments available in game **automatically**.
Expand All @@ -50,10 +51,10 @@ If you want your mod to appear in this list, open an issue [here](https://github

## **Dependencies**

| Mod | Loader | Requirement |
|:------------------------------------------------------------------------|:----------------------:|:-----------:|
| [Cobweb](https://modrinth.com/mod/cobweb) | All | Required |
| [Forge Config API Port](https://modrinth.com/mod/forge-config-api-port) | Fabric; Forge ≥ 1.20.2 | Required |
| Mod | Loader | Requirement |
|:------------------------------------------------------------------------|:-----------------------------:|:-----------:|
| [Cobweb](https://modrinth.com/mod/cobweb) | All | Required |
| [Forge Config API Port](https://modrinth.com/mod/forge-config-api-port) | Fabric < 1.21; Forge ≥ 1.20.2 | Required |

## **License and right of use**

Expand Down
7 changes: 0 additions & 7 deletions buildSrc/src/main/groovy/multiloader-common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ repositories {
name = "Crystal Nest"
url = "https://maven.crystalnest.it"
}
maven {
name = "Fuzs Mod Resources"
url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/"
}
}

if (name != "fabric") {
Expand Down Expand Up @@ -119,7 +115,6 @@ processResources {
"neoforge_version" : neoforge_version,
"neoforge_loader_version_range": neoforge_loader_version_range,
"cobweb_version" : cobweb_version,
"fcap_version" : fcap_version,
]
filesMatching(["pack.mcmeta", "fabric.mod.json", "META-INF/neoforge.mods.toml", "*.mixins.json"]) {
expand expandProps
Expand Down Expand Up @@ -221,7 +216,6 @@ publisher {
switch (loader) {
case "Fabric":
required "fabric-api"
required "forge-config-api-port"
break
case "NeoForge":
break
Expand All @@ -232,7 +226,6 @@ publisher {
switch (loader) {
case "Fabric":
required "fabric-api"
required "forge-config-api-port-fabric"
break
case "NeoForge":
break
Expand Down
1 change: 0 additions & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ dependencies {
compileOnly group: "org.spongepowered", name: "mixin", version: "0.8.5"
compileOnly group: "io.github.llamalad7", name: "mixinextras-common", version: "0.3.5"
annotationProcessor group: "io.github.llamalad7", name: "mixinextras-common", version: "0.3.5"
implementation "fuzs.forgeconfigapiport:forgeconfigapiport-common-neoforgeapi:$fcap_version"
}

configurations {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import it.crystalnest.soul_fire_d.api.FireManager;
import it.crystalnest.soul_fire_d.api.enchantment.EnchantmentRegistry;
import it.crystalnest.soul_fire_d.config.ModConfig;
import it.crystalnest.soul_fire_d.platform.Services;
import org.jetbrains.annotations.ApiStatus;

Expand All @@ -11,21 +10,13 @@
*/
@ApiStatus.Internal
public final class CommonModLoader {
static {
FireManager.registerFire(FireManager.fireBuilder(FireManager.SOUL_FIRE_TYPE)
.setLight(10)
.setDamage(2)
.build()
);
}

private CommonModLoader() {}

/**
* Initialize common operations across loaders.
*/
public static void init() {
ModConfig.CONFIG.register();
FireManager.registerFire(FireManager.fireBuilder(FireManager.SOUL_FIRE_TYPE).setLight(10).setDamage(2).build());
Services.NETWORK.register();
EnchantmentRegistry.register();
}
Expand Down
205 changes: 0 additions & 205 deletions common/src/main/java/it/crystalnest/soul_fire_d/config/ModConfig.java

This file was deleted.

1 change: 0 additions & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:$fabric_loader_version"
modImplementation "net.fabricmc.fabric-api:fabric-api:$fabric_version"
modImplementation "it.crystalnest:cobweb-$name:$minecraft_version-$cobweb_version"
modImplementation "fuzs.forgeconfigapiport:forgeconfigapiport-fabric:$fcap_version"
}

loom {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package it.crystalnest.soul_fire_d.handler;

import it.crystalnest.soul_fire_d.config.ModConfig;
import net.fabricmc.fabric.api.loot.v3.LootTableEvents;
import net.fabricmc.fabric.api.loot.v3.LootTableSource;
import net.minecraft.core.Holder;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.level.storage.loot.LootPool;
import net.minecraft.world.level.storage.loot.LootTable;
import net.minecraft.world.level.storage.loot.entries.LootItem;
Expand Down Expand Up @@ -35,13 +36,14 @@ private LootTableEventsHandler() {}
* @param source loot table source.
*/
public static void handle(ResourceKey<LootTable> key, LootTable.Builder builder, LootTableSource source, HolderLookup.Provider provider) {
if (ModConfig.getEnableSoulFlame() && key.location().equals(BASTION_CHEST_IDENTIFIER)) {
Holder.Reference<Enchantment> soulFlame = provider.lookupOrThrow(Registries.ENCHANTMENT).getOrThrow(ResourceKey.create(Registries.ENCHANTMENT, ResourceLocation.withDefaultNamespace("soul_flame")));
if (soulFlame.value().getSupportedItems().size() > 0 && key.location().equals(BASTION_CHEST_IDENTIFIER)) {
builder.pool(
LootPool.lootPool()
.setRolls(ConstantValue.exactly(1))
.conditionally(LootItemRandomChanceCondition.randomChance(0.05F).build())
.with(LootItem.lootTableItem(Items.BOOK).build())
.apply(new EnchantRandomlyFunction.Builder().withEnchantment(provider.lookupOrThrow(Registries.ENCHANTMENT).getOrThrow(ResourceKey.create(Registries.ENCHANTMENT, ResourceLocation.withDefaultNamespace("soul_flame")))))
.apply(new EnchantRandomlyFunction.Builder().withEnchantment(soulFlame))
.apply(SetItemCountFunction.setCount(ConstantValue.exactly(1)))
.build()
);
Expand Down
5 changes: 2 additions & 3 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"fabricloader": ">=${fabric_loader_version}",
"fabric-api": "*",
"minecraft": "${minecraft_version}",
"java": ">=17",
"cobweb": "^${cobweb_version}",
"forgeconfigapiport": "~${fcap_version}"
"java": ">=${java_version}",
"cobweb": "^${cobweb_version}"
}
}
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ neoforge_loader_version_range = [21.0,)

# Dependencies
cobweb_version = 1.0.0
fcap_version = 21.0.1

# Gradle
org.gradle.jvmargs = -Xmx4G
Expand Down
Loading

0 comments on commit ec64280

Please sign in to comment.