diff --git a/CHANGELOG b/CHANGELOG index 1d2b829..dbb6690 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -25,8 +25,10 @@ - cotton and cotton armour are now obtainable - cotton seeds can be obtained from breaking grass -## 1.20.1-1.0.10 +## 1.20.1-1.0.10 (maybe 1.20.1-1.1.0) - fixed two kitsune powers being on the same key - (internal) corrected class capitalisation - (internal)added terraoriginum:wings power -- increased protection effectiveness from 1.1 to 1.2 on latian origins for sun protection \ No newline at end of file +- increased protection effectiveness from 1.1 to 1.2 on latian origins for sun protection +- added light protection for spirit based origins +- added a description for sun protection enchant \ No newline at end of file diff --git a/src/main/java/com/smithy/terraoriginum/enchantment/LightProtectionEnchantment.java b/src/main/java/com/smithy/terraoriginum/enchantment/LightProtectionEnchantment.java new file mode 100644 index 0000000..1be3552 --- /dev/null +++ b/src/main/java/com/smithy/terraoriginum/enchantment/LightProtectionEnchantment.java @@ -0,0 +1,39 @@ +package com.smithy.terraoriginum.enchantment; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentTarget; +import net.minecraft.enchantment.ProtectionEnchantment; +import net.minecraft.entity.EquipmentSlot; + +public class LightProtectionEnchantment extends Enchantment{ + + public LightProtectionEnchantment(Rarity weight, EnchantmentTarget type, EquipmentSlot[] slotTypes) { + super(weight, type, slotTypes); + } + + public int getMinPower(int level) { + return 8 + level * 5; + } + + public int getMaxPower(int level) { + return this.getMinPower(level) + 8; + } + + public boolean isTreasure() { + return true; + } + + public int getMaxLevel() { + return 1; + } + + @Override + protected boolean canAccept(Enchantment other) { + if(other == this || ((other instanceof ProtectionEnchantment && !(((ProtectionEnchantment)other).protectionType == ProtectionEnchantment.Type.ALL)))) { + return false; + } + return super.canAccept(other); + } + + +} diff --git a/src/main/java/com/smithy/terraoriginum/registry/ModEnchantments.java b/src/main/java/com/smithy/terraoriginum/registry/ModEnchantments.java index d1a4bfe..4ed4b90 100644 --- a/src/main/java/com/smithy/terraoriginum/registry/ModEnchantments.java +++ b/src/main/java/com/smithy/terraoriginum/registry/ModEnchantments.java @@ -1,6 +1,7 @@ package com.smithy.terraoriginum.registry; import com.smithy.terraoriginum.TerraOriginum; +import com.smithy.terraoriginum.enchantment.LightProtectionEnchantment; import com.smithy.terraoriginum.enchantment.SunProtectionEnchantment; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentTarget; @@ -12,9 +13,11 @@ import net.minecraft.registry.Registry; public class ModEnchantments { public static final Enchantment SUN_PROTECTION = new SunProtectionEnchantment(Enchantment.Rarity.RARE, EnchantmentTarget.ARMOR, new EquipmentSlot[]{EquipmentSlot.HEAD, EquipmentSlot.CHEST, EquipmentSlot.LEGS, EquipmentSlot.FEET}); + public static final Enchantment LIGHT_PROTECTION = new LightProtectionEnchantment(Enchantment.Rarity.RARE, EnchantmentTarget.ARMOR_CHEST, new EquipmentSlot[]{EquipmentSlot.CHEST}); public static void register() { register("sun_protection", SUN_PROTECTION); + register("light_protection", LIGHT_PROTECTION); } private static Enchantment register(String path, Enchantment enchantment) { diff --git a/src/main/resources/assets/terraoriginum/lang/en_us.json b/src/main/resources/assets/terraoriginum/lang/en_us.json index bb701e0..8554d04 100644 --- a/src/main/resources/assets/terraoriginum/lang/en_us.json +++ b/src/main/resources/assets/terraoriginum/lang/en_us.json @@ -16,6 +16,9 @@ "death.attack.boiling": "%1$s boiled up", "death.attack.boiling.player": "%1$s boiled up whilst trying to fight off %2$s", "enchantment.terraoriginum.sun_protection": "Sun Protection", + "enchantment.terraoriginum.sun_protection.description": "Protects Latians from the sun temporarily", + "enchantment.terraoriginum.light_protection": "Light Protection", + "enchantment.terraoriginum.light_protection.description": "Reduces Ectoplasm loss for spirits", "item.terraoriginum.ghostly_helmet": "Ghostly Hood", "item.terraoriginum.ghostly_chestplate": "Ghostly Robe", "item.terraoriginum.ghostly_leggings": "Ghostly Pants", diff --git a/src/main/resources/data/terraoriginum/powers/spirit-powers/ectodiff.json b/src/main/resources/data/terraoriginum/powers/spirit-powers/ectodiff.json index e5790f3..469abef 100644 --- a/src/main/resources/data/terraoriginum/powers/spirit-powers/ectodiff.json +++ b/src/main/resources/data/terraoriginum/powers/spirit-powers/ectodiff.json @@ -1,6 +1,6 @@ { "type": "origins:action_over_time", - "interval": 20, + "interval": 40, "entity_action": { "type": "origins:if_else_list", "actions": [ @@ -68,7 +68,27 @@ { "type": "origins:change_resource", "resource": "terraoriginum:spirit-powers/ectoplasm", - "change": 2, + "change": 4, + "operation": "add" + } + ] + } + }, + { + "condition": { + "type": "origins:enchantment", + "enchantment": "terraoriginum:light_protection", + "calculation": "sum", + "comparison": ">=", + "compare_to": 1 + }, + "action": { + "type": "origins:and", + "actions": [ + { + "type": "origins:change_resource", + "resource": "terraoriginum:spirit-powers/ectoplasm", + "change": -1, "operation": "add" } ] @@ -86,7 +106,7 @@ { "type": "origins:change_resource", "resource": "terraoriginum:spirit-powers/ectoplasm", - "change": -1, + "change": -2, "operation": "add" } ] @@ -109,7 +129,7 @@ { "type": "origins:change_resource", "resource": "terraoriginum:spirit-powers/ectoplasm", - "change": 2, + "change": 4, "operation": "add" } ]