Skip to content

Commit

Permalink
Crystal mount armor tweaks
Browse files Browse the repository at this point in the history
-Crystal Mount Armor no longer can stack
-Added a description to the Crystal Mount Armor tooltip.
-Changed rarity of Crystal Mount Armor to 'Rare'
-Renamed Crystal Mount Armor to Crystal Horse Armor
  • Loading branch information
IcarussOne committed Jan 7, 2024
1 parent bca629d commit c82de1d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/drzhark/mocreatures/init/MoCItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class MoCItems {
public static final MoCItem heartfire = new MoCItem("heartfire");
public static final MoCItem heartundead = new MoCItem("heartundead");
public static final MoCItem unicornhorn = new MoCItem("unicornhorn");
public static final MoCItem horsearmorcrystal = new MoCItem("horsearmorcrystal");
public static final MoCItem horsearmorcrystal = (MoCItem) new MoCItem("horsearmorcrystal", 0, true).setMaxStackSize(1);
public static final MoCItem animalHide = new MoCItem("hide");
public static final MoCItem chitinCave = new MoCItem("chitinblack");
public static final MoCItem chitinFrost = new MoCItem("chitinfrost");
Expand Down
38 changes: 36 additions & 2 deletions src/main/java/drzhark/mocreatures/item/MoCItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,56 @@
*/
package drzhark.mocreatures.item;

import java.util.List;

import javax.annotation.Nullable;

import drzhark.mocreatures.MoCConstants;
import drzhark.mocreatures.MoCreatures;
import drzhark.mocreatures.init.MoCItems;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class MoCItem extends Item {
protected String Tooltip = null;

public MoCItem() {
}

public MoCItem(String name) {
this(name, 0);
this(name, 0, false);
}

public MoCItem(String name, int meta) {
public MoCItem(String name, int meta, boolean hasTooltip) {
this.setCreativeTab(MoCreatures.tabMoC);
this.setRegistryName(MoCConstants.MOD_ID, name);
this.setTranslationKey(name);

if (hasTooltip) {
this.Tooltip = "info." + MoCConstants.MOD_ID + "." + name;
}
}

public EnumRarity getRarity(ItemStack stack) {
if (stack.getItem() == MoCItems.horsearmorcrystal) {
return EnumRarity.RARE;
}

return EnumRarity.COMMON;
}

@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> list, ITooltipFlag flag) {
if (Tooltip != null) {
list.add(TextFormatting.WHITE + I18n.format(Tooltip));
}
}
}
5 changes: 3 additions & 2 deletions src/main/resources/assets/mocreatures/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ item.hideboots.name=Hide Shoes
item.hidechest.name=Hide Tunic
item.hidehelmet.name=Hide Cap
item.hidelegs.name=Hide Pants
item.horsearmorcrystal.name=Crystal Mount Armor
item.horsearmorcrystal.name=Crystal Horse Armor
item.horsesaddle.name=Crafted Saddle
item.katana.name=Ninja Katana
item.key.name=Key
Expand Down Expand Up @@ -114,7 +114,7 @@ item.mocegg.23.name=Orange Snake Egg
item.mocegg.24.name=Green Snake Egg
item.mocegg.25.name=Coral Snake Egg
item.mocegg.26.name=Cobra Snake Egg
item.mocegg.27.name=Rattle Snake Egg
item.mocegg.27.name=Rattlesnake Egg
item.mocegg.28.name=Python Snake Egg
item.mocegg.3.name=Light Blue Fish Egg
item.mocegg.30.name=Ostrich Egg
Expand Down Expand Up @@ -360,6 +360,7 @@ msg.mocreatures.egg=Egg hatching soon! KEEP WATCH! The hatched creature located
msg.mocreatures.foreignpet=This pet does not belong to you.

# INFO
info.mocreatures.horsearmorcrystal=Only equipable by certain rare horse breeds
info.mocreatures.setbonus=Set Bonus:
info.mocreatures.setbonusscorp1=Permanent Health Boost II
info.mocreatures.setbonusscorp2=Permanent Resistance
Expand Down

0 comments on commit c82de1d

Please sign in to comment.