Skip to content

Commit

Permalink
Fireproof shields
Browse files Browse the repository at this point in the history
  • Loading branch information
ZsoltMolnarrr committed Sep 18, 2024
1 parent b870934 commit 06a2bb8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 2.0.5

- Judgement spell json specifying target requirement
- Fireproof shields with Netherite or better material

# 2.0.4

Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fabric_api_version=0.102.0+1.21.1
# Mod
maven_group=net
archives_base_name=paladins
mod_version=2.0.4
mod_version=2.0.5
minecraft_compat_version=1.21

# Dependencies
Expand All @@ -23,8 +23,8 @@ runes_version=1.0.3+1.21.1
structure_pool_api_version=1.1.3+1.21.1
shield_api_version=2.0.2+1.21.1

spell_engine_version=1.0.4+1.21.1
spell_power_version=1.0.4+1.21.1
spell_engine_version=1.1.0+1.21.1
spell_power_version=1.0.5+1.21.1
cloth_config_version=15.0.130
player_anim_version=2.0.0-alpha1+1.21
trinkets_version=3.10.0
9 changes: 8 additions & 1 deletion src/main/java/net/paladins/item/Shields.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.paladins.config.ShieldsConfig;
import net.paladins.util.SoundHelper;
import net.spell_engine.api.item.ItemConfig;
import net.spell_engine.api.item.Tiers;
import net.spell_engine.api.item.weapon.Weapon;

import java.util.ArrayList;
Expand Down Expand Up @@ -102,6 +103,7 @@ public static void register(Map<String, ShieldsConfig.Entry> configs) {
), durability_t4);
}

var netheriteTier = Tiers.unsafe("netherite");
ArrayList<Item> shields = new ArrayList<>();
for (var entry: ENTRIES) {
var config = configs.get(entry.id.toString());
Expand All @@ -115,7 +117,12 @@ public static void register(Map<String, ShieldsConfig.Entry> configs) {
for (var modifier: Weapon.attributesFrom(config.attributes).modifiers()) {
shieldAttributes.add(new Pair<>(modifier.attribute(), modifier.modifier()));
}
var shield = new CustomShieldItem(SoundHelper.shield_equip.entry(), entry.repair, shieldAttributes, new Item.Settings().maxDamage(config.durability));
var settings = new Item.Settings().maxDamage(config.durability);
var tier = Tiers.unsafe(entry.id());
if (tier >= netheriteTier) {
settings.fireproof();
}
var shield = new CustomShieldItem(SoundHelper.shield_equip.entry(), entry.repair, shieldAttributes, settings);
Registry.register(Registries.ITEM, entry.id, shield);
shields.add(shield);
}
Expand Down

0 comments on commit 06a2bb8

Please sign in to comment.