-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Prometheum Auto Repair happen onInventoryTick Makes it so that it repairs slowly while in your inventory, regardless of being equipped or not Also fixes a potential bug where the attribute for the armor was client only, and would not apply on servers Signed-off-by: Noaaan <[email protected]>
- Loading branch information
Showing
8 changed files
with
199 additions
and
101 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
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
20 changes: 20 additions & 0 deletions
20
src/main/java/nourl/mythicmetals/armor/PrometheumArmorItem.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,20 @@ | ||
package nourl.mythicmetals.armor; | ||
|
||
import net.minecraft.entity.Entity; | ||
import net.minecraft.item.ArmorItem; | ||
import net.minecraft.item.ArmorMaterial; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.world.World; | ||
import nourl.mythicmetals.item.tools.PrometheumToolSet; | ||
|
||
public class PrometheumArmorItem extends ArmorItem { | ||
public PrometheumArmorItem(ArmorMaterial material, Type type, Settings settings) { | ||
super(material, type, settings); | ||
} | ||
|
||
@Override | ||
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) { | ||
if (!world.isClient()) PrometheumToolSet.tickAutoRepair(stack, world.getRandom()); | ||
super.inventoryTick(stack, world, entity, slot, selected); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/nourl/mythicmetals/armor/PrometheumArmorSet.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,16 @@ | ||
package nourl.mythicmetals.armor; | ||
|
||
import io.wispforest.owo.itemgroup.OwoItemSettings; | ||
import net.minecraft.item.ArmorItem; | ||
import net.minecraft.item.ArmorMaterial; | ||
|
||
public class PrometheumArmorSet extends ArmorSet { | ||
public PrometheumArmorSet(ArmorMaterial material) { | ||
super(material); | ||
} | ||
|
||
@Override | ||
protected ArmorItem makeItem(ArmorMaterial material, ArmorItem.Type slot, OwoItemSettings settings) { | ||
return new PrometheumArmorItem(material, slot, settings); | ||
} | ||
} |
Oops, something went wrong.