Made Cloaking device wearable in 1.12. Closes #1314
This commit is contained in:
parent
3f1e7b9111
commit
441ac4887a
4 changed files with 13 additions and 7 deletions
|
@ -47,6 +47,8 @@ public class Reference {
|
||||||
4 }, 8, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0F);
|
4 }, 8, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0F);
|
||||||
public static ArmorMaterial PERIDOT_ARMOUR = EnumHelper.addEnum(ArmorMaterial.class, "PERIDOT", ARMOR_PARAMETERS, "techreborn:peridot", 17, new int[] { 3, 8, 3,
|
public static ArmorMaterial PERIDOT_ARMOUR = EnumHelper.addEnum(ArmorMaterial.class, "PERIDOT", ARMOR_PARAMETERS, "techreborn:peridot", 17, new int[] { 3, 8, 3,
|
||||||
2 }, 16, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0F);
|
2 }, 16, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0F);
|
||||||
|
public static ArmorMaterial CLOAKING_ARMOR = EnumHelper.addEnum(ArmorMaterial.class, "CLOAKING", ARMOR_PARAMETERS, "techreborn:cloaking", 5, new int[] { 1, 2, 3,
|
||||||
|
1 }, 0, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 0F);
|
||||||
|
|
||||||
public static ToolMaterial BRONZE = EnumHelper.addToolMaterial("BRONZE", 2, 375, 6.0F, 2.25F, 8);
|
public static ToolMaterial BRONZE = EnumHelper.addToolMaterial("BRONZE", 2, 375, 6.0F, 2.25F, 8);
|
||||||
public static ToolMaterial RUBY = EnumHelper.addToolMaterial("RUBY", 2, 320, 6.2F, 2.7F, 10);
|
public static ToolMaterial RUBY = EnumHelper.addToolMaterial("RUBY", 2, 320, 6.2F, 2.7F, 10);
|
||||||
|
|
|
@ -34,9 +34,6 @@ import techreborn.events.TRRecipeHandler;
|
||||||
*/
|
*/
|
||||||
public class ItemTRArmour extends ItemArmor {
|
public class ItemTRArmour extends ItemArmor {
|
||||||
|
|
||||||
private ArmorMaterial material = ArmorMaterial.LEATHER;
|
|
||||||
private EntityEquipmentSlot slot = EntityEquipmentSlot.HEAD;
|
|
||||||
|
|
||||||
public ItemTRArmour(ArmorMaterial material, EntityEquipmentSlot slot) {
|
public ItemTRArmour(ArmorMaterial material, EntityEquipmentSlot slot) {
|
||||||
super(material, material.getDamageReductionAmount(slot), slot);
|
super(material, material.getDamageReductionAmount(slot), slot);
|
||||||
if (slot == EntityEquipmentSlot.HEAD)
|
if (slot == EntityEquipmentSlot.HEAD)
|
||||||
|
@ -48,8 +45,6 @@ public class ItemTRArmour extends ItemArmor {
|
||||||
if (slot == EntityEquipmentSlot.FEET)
|
if (slot == EntityEquipmentSlot.FEET)
|
||||||
setUnlocalizedName(material.name().toLowerCase() + "Boots");
|
setUnlocalizedName(material.name().toLowerCase() + "Boots");
|
||||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||||
this.material = material;
|
|
||||||
this.slot = slot;
|
|
||||||
TRRecipeHandler.hideEntry(this);
|
TRRecipeHandler.hideEntry(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
package techreborn.items.tools;
|
package techreborn.items.tools;
|
||||||
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.MobEffects;
|
import net.minecraft.init.MobEffects;
|
||||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||||
|
@ -42,16 +43,17 @@ import reborncore.common.powerSystem.PoweredItem;
|
||||||
import reborncore.common.powerSystem.PoweredItemContainerProvider;
|
import reborncore.common.powerSystem.PoweredItemContainerProvider;
|
||||||
import reborncore.common.registration.RebornRegistry;
|
import reborncore.common.registration.RebornRegistry;
|
||||||
import reborncore.common.registration.impl.ConfigRegistry;
|
import reborncore.common.registration.impl.ConfigRegistry;
|
||||||
|
import techreborn.api.Reference;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.init.ModItems;
|
import techreborn.init.ModItems;
|
||||||
import techreborn.items.ItemTR;
|
import techreborn.items.armor.ItemTRArmour;
|
||||||
import techreborn.lib.ModInfo;
|
import techreborn.lib.ModInfo;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
@RebornRegistry(modID = ModInfo.MOD_ID)
|
@RebornRegistry(modID = ModInfo.MOD_ID)
|
||||||
public class ItemCloakingDevice extends ItemTR implements IEnergyItemInfo, IEnergyInterfaceItem {
|
public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo, IEnergyInterfaceItem {
|
||||||
|
|
||||||
@ConfigRegistry(config = "items", category = "cloacking_device", key = "ClockingDeviceEnergyUsage", comment = "Cloacking device energy usesage (Value in EU)")
|
@ConfigRegistry(config = "items", category = "cloacking_device", key = "ClockingDeviceEnergyUsage", comment = "Cloacking device energy usesage (Value in EU)")
|
||||||
public static int usage = 10;
|
public static int usage = 10;
|
||||||
|
@ -61,11 +63,18 @@ public class ItemCloakingDevice extends ItemTR implements IEnergyItemInfo, IEner
|
||||||
public static boolean isActive;
|
public static boolean isActive;
|
||||||
|
|
||||||
public ItemCloakingDevice() {
|
public ItemCloakingDevice() {
|
||||||
|
super(Reference.CLOAKING_ARMOR, EntityEquipmentSlot.CHEST);
|
||||||
setUnlocalizedName("techreborn.cloakingdevice");
|
setUnlocalizedName("techreborn.cloakingdevice");
|
||||||
setMaxStackSize(1);
|
setMaxStackSize(1);
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) {
|
||||||
|
return "techreborn:" + "textures/models/cloaking.png";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||||
if (PoweredItem.canUseEnergy(usage, itemStack)) {
|
if (PoweredItem.canUseEnergy(usage, itemStack)) {
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 266 B |
Loading…
Add table
Reference in a new issue