added light prot
This commit is contained in:
@@ -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
|
||||
- added light protection for spirit based origins
|
||||
- added a description for sun protection enchant
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user