-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ench): register 3 new enchantments
tide, harvest, observer [skip ci]
- Loading branch information
1 parent
9078f18
commit 93b8bd9
Showing
8 changed files
with
218 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/HarvestEnchantment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Copyright (C) 2024 AUIOC.ORG | ||
* | ||
* This file is part of HarmonicEnchantments, a mod made for Minecraft. | ||
* | ||
* ArnicaLib is free software: you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free | ||
* Software Foundation, either version 3 of the License, or (at your option) | ||
* any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.auioc.mcmod.harmonicench.enchantment.impl; | ||
|
||
import net.minecraft.world.entity.EquipmentSlot; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.ShovelItem; | ||
import net.minecraft.world.item.enchantment.Enchantment; | ||
import net.minecraft.world.item.enchantment.Enchantments; | ||
import org.auioc.mcmod.arnicalib.game.enchantment.HEnchantmentCategory; | ||
import org.auioc.mcmod.harmoniclib.enchantment.api.HLEnchantment; | ||
|
||
/** | ||
* <b>收割 Harvest</b> TODO | ||
* <p> | ||
* 提高收割作物(以及生物)的速度。 | ||
* <ul> | ||
* </ul> | ||
* | ||
* @author WakelessSloth56 | ||
* @author Libellule505 | ||
* @since 2.1.0 | ||
*/ | ||
public class HarvestEnchantment extends HLEnchantment { | ||
|
||
public HarvestEnchantment() { | ||
super( | ||
Enchantment.Rarity.VERY_RARE, | ||
HEnchantmentCategory.HOE, | ||
EquipmentSlot.MAINHAND, | ||
3, | ||
(o) -> o != Enchantments.BLOCK_EFFICIENCY | ||
); | ||
} | ||
|
||
@Override | ||
public int getMinCost(int lvl) { | ||
return 15 + (lvl - 1) * 9; | ||
} | ||
|
||
@Override | ||
public int getMaxCost(int lvl) { | ||
return super.getMinCost(lvl) + 50; | ||
} | ||
|
||
@Override | ||
public boolean canEnchant(ItemStack itemStack) { | ||
return itemStack.getItem() instanceof ShovelItem || super.canEnchant(itemStack); | ||
} | ||
|
||
} |
66 changes: 66 additions & 0 deletions
66
src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/ObserverEnchantment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright (C) 2024 AUIOC.ORG | ||
* | ||
* This file is part of HarmonicEnchantments, a mod made for Minecraft. | ||
* | ||
* ArnicaLib is free software: you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free | ||
* Software Foundation, either version 3 of the License, or (at your option) | ||
* any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.auioc.mcmod.harmonicench.enchantment.impl; | ||
|
||
import net.minecraft.world.entity.EquipmentSlot; | ||
import net.minecraft.world.item.enchantment.Enchantment; | ||
import org.auioc.mcmod.arnicalib.game.enchantment.HEnchantmentCategory; | ||
import org.auioc.mcmod.harmonicench.enchantment.HEEnchantments; | ||
import org.auioc.mcmod.harmoniclib.enchantment.api.HLEnchantment; | ||
|
||
/** | ||
* <b>观测 Observer</b> TODO | ||
* <p> | ||
* 在晴朗的夜晚,了解天象。 | ||
* <ul> | ||
* </ul> | ||
* | ||
* @author WakelessSloth56 | ||
* @author Libellule505 | ||
* @since 2.1.0 | ||
*/ | ||
public class ObserverEnchantment extends HLEnchantment { | ||
|
||
public ObserverEnchantment() { | ||
super( | ||
Enchantment.Rarity.VERY_RARE, | ||
HEnchantmentCategory.SPYGLASS, | ||
new EquipmentSlot[] { EquipmentSlot.MAINHAND, EquipmentSlot.OFFHAND }, | ||
2, | ||
(o) -> o != HEEnchantments.AIM.get() | ||
); | ||
} | ||
|
||
@Override | ||
public int getMinCost(int lvl) { | ||
return lvl * 10; | ||
} | ||
|
||
@Override | ||
public int getMaxCost(int lvl) { | ||
return getMinCost(lvl) + 15; | ||
} | ||
|
||
@Override | ||
public boolean isTreasureOnly() { | ||
return true; | ||
} | ||
|
||
} |
63 changes: 63 additions & 0 deletions
63
src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/TideEnchantment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright (C) 2024 AUIOC.ORG | ||
* | ||
* This file is part of HarmonicEnchantments, a mod made for Minecraft. | ||
* | ||
* ArnicaLib is free software: you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free | ||
* Software Foundation, either version 3 of the License, or (at your option) | ||
* any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.auioc.mcmod.harmonicench.enchantment.impl; | ||
|
||
import net.minecraft.world.entity.EquipmentSlot; | ||
import net.minecraft.world.item.enchantment.Enchantment; | ||
import net.minecraft.world.item.enchantment.EnchantmentCategory; | ||
import net.minecraft.world.item.enchantment.Enchantments; | ||
import org.auioc.mcmod.harmonicench.enchantment.HEEnchantments; | ||
import org.auioc.mcmod.harmoniclib.enchantment.api.HLEnchantment; | ||
|
||
/** | ||
* <b>唤潮 Tide</b> TODO | ||
* <p> | ||
* 提高水中投掷速度,击中目标会使其窒息。 | ||
* <ul> | ||
* </ul> | ||
* | ||
* @author WakelessSloth56 | ||
* @author Libellule505 | ||
* @since 2.1.0 | ||
*/ | ||
public class TideEnchantment extends HLEnchantment { | ||
|
||
public TideEnchantment() { | ||
super( | ||
Enchantment.Rarity.RARE, | ||
EnchantmentCategory.TRIDENT, | ||
EquipmentSlot.MAINHAND, | ||
3, | ||
(o) -> o != Enchantments.LOYALTY && o != Enchantments.CHANNELING | ||
&& o != HEEnchantments.ELECTRIFICATION.get() | ||
); | ||
} | ||
|
||
@Override | ||
public int getMinCost(int lvl) { | ||
return (lvl * 7) + 5; | ||
} | ||
|
||
@Override | ||
public int getMaxCost(int lvl) { | ||
return 50; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters