Fix various issues relating to armor [Fixes #1952]

This commit is contained in:
Prospector 2020-01-12 19:17:35 -08:00
parent bcc9368bf9
commit 960b064b5a
22 changed files with 138 additions and 127 deletions

View file

@ -55,7 +55,7 @@ import techreborn.init.ModFluids;
import techreborn.init.TRBlockEntities;
import techreborn.init.TRContent;
import techreborn.items.DynamicCellItem;
import techreborn.items.ItemFrequencyTransmitter;
import techreborn.items.FrequencyTransmitterItem;
import javax.annotation.Nullable;
import java.util.Arrays;
@ -131,7 +131,7 @@ public class TechRebornClient implements ClientModInitializer {
GuiBase.wrenchStack = new ItemStack(TRContent.WRENCH);
GuiBase.fluidCellProvider = DynamicCellItem::getCellWithFluid;
StackInfoHUD.registerElement(new ItemFrequencyTransmitter.StackInfoFreqTransmitter());
StackInfoHUD.registerElement(new FrequencyTransmitterItem.StackInfoFreqTransmitter());
Arrays.stream(TRContent.Cables.values()).forEach(cable -> BlockRenderLayerMap.INSTANCE.putBlock(cable.block, RenderLayer.getCutout()));

View file

@ -34,12 +34,12 @@ import net.minecraft.util.Util;
import reborncore.client.gui.builder.widget.GuiButtonExtended;
import reborncore.common.network.NetworkManager;
import techreborn.config.TechRebornConfig;
import techreborn.items.ItemManual;
import techreborn.items.ManualItem;
import techreborn.packets.ServerboundPackets;
public class GuiManual extends Screen {
ItemManual manual;
ManualItem manual;
PlayerEntity player;
private static final Identifier texture = new Identifier("techreborn", "textures/gui/manual.png");

View file

@ -50,19 +50,19 @@ import techreborn.blocks.misc.RubberTrapdoorBlock;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModFluids;
import techreborn.init.ModSounds;
import techreborn.init.TRArmorMaterial;
import techreborn.init.TRArmorMaterials;
import techreborn.init.TRContent;
import techreborn.init.TRContent.*;
import techreborn.init.TRToolTier;
import techreborn.items.DynamicCellItem;
import techreborn.items.ItemFrequencyTransmitter;
import techreborn.items.ItemManual;
import techreborn.items.ItemScrapBox;
import techreborn.items.armor.ItemCloakingDevice;
import techreborn.items.armor.ItemLapotronicOrbpack;
import techreborn.items.armor.ItemLithiumIonBatpack;
import techreborn.items.armor.ItemQuantumSuit;
import techreborn.items.armor.ItemTRArmour;
import techreborn.items.FrequencyTransmitterItem;
import techreborn.items.ManualItem;
import techreborn.items.ScrapBoxItem;
import techreborn.items.armor.CloakingDeviceItem;
import techreborn.items.armor.LapotronicOrbpackItem;
import techreborn.items.armor.LithiumIonBatpackItem;
import techreborn.items.armor.QuantumSuitItem;
import techreborn.items.armor.TRArmourItem;
import techreborn.items.battery.*;
import techreborn.items.tool.DebugToolItem;
import techreborn.items.tool.PaintingToolItem;
@ -142,10 +142,10 @@ public class ModRegistry {
Arrays.stream(Parts.values()).forEach(value -> RebornRegistry.registerItem(value.item));
Arrays.stream(Upgrades.values()).forEach(value -> RebornRegistry.registerItem(value.item));
RebornRegistry.registerItem(TRContent.QUANTUM_HELMET = InitUtils.setup(new ItemQuantumSuit(TRArmorMaterial.QUANTUM, EquipmentSlot.HEAD), "quantum_helmet"));
RebornRegistry.registerItem(TRContent.QUANTUM_CHESTPLATE = InitUtils.setup(new ItemQuantumSuit(TRArmorMaterial.QUANTUM, EquipmentSlot.CHEST), "quantum_chestplate"));
RebornRegistry.registerItem(TRContent.QUANTUM_LEGGINGS = InitUtils.setup(new ItemQuantumSuit(TRArmorMaterial.QUANTUM, EquipmentSlot.LEGS), "quantum_leggings"));
RebornRegistry.registerItem(TRContent.QUANTUM_BOOTS = InitUtils.setup(new ItemQuantumSuit(TRArmorMaterial.QUANTUM, EquipmentSlot.FEET), "quantum_boots"));
RebornRegistry.registerItem(TRContent.QUANTUM_HELMET = InitUtils.setup(new QuantumSuitItem(TRArmorMaterials.QUANTUM, EquipmentSlot.HEAD), "quantum_helmet"));
RebornRegistry.registerItem(TRContent.QUANTUM_CHESTPLATE = InitUtils.setup(new QuantumSuitItem(TRArmorMaterials.QUANTUM, EquipmentSlot.CHEST), "quantum_chestplate"));
RebornRegistry.registerItem(TRContent.QUANTUM_LEGGINGS = InitUtils.setup(new QuantumSuitItem(TRArmorMaterials.QUANTUM, EquipmentSlot.LEGS), "quantum_leggings"));
RebornRegistry.registerItem(TRContent.QUANTUM_BOOTS = InitUtils.setup(new QuantumSuitItem(TRArmorMaterials.QUANTUM, EquipmentSlot.FEET), "quantum_boots"));
// Gem armor & tools
if (TechRebornConfig.enableGemArmorAndTools) {
@ -156,10 +156,10 @@ public class ModRegistry {
RebornRegistry.registerItem(TRContent.BRONZE_AXE = InitUtils.setup(new TRAxeItem(TRToolTier.BRONZE), "bronze_axe"));
RebornRegistry.registerItem(TRContent.BRONZE_HOE = InitUtils.setup(new TRHoeItem(TRToolTier.BRONZE), "bronze_hoe"));
RebornRegistry.registerItem(TRContent.BRONZE_HELMET = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.BRONZE, EquipmentSlot.HEAD), "bronze_helmet"));
RebornRegistry.registerItem(TRContent.BRONZE_CHESTPLATE = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.BRONZE, EquipmentSlot.CHEST), "bronze_chestplate"));
RebornRegistry.registerItem(TRContent.BRONZE_LEGGINGS = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.BRONZE, EquipmentSlot.LEGS), "bronze_leggings"));
RebornRegistry.registerItem(TRContent.BRONZE_BOOTS = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.BRONZE, EquipmentSlot.FEET), "bronze_boots"));
RebornRegistry.registerItem(TRContent.BRONZE_HELMET = InitUtils.setup(new TRArmourItem(TRArmorMaterials.BRONZE, EquipmentSlot.HEAD), "bronze_helmet"));
RebornRegistry.registerItem(TRContent.BRONZE_CHESTPLATE = InitUtils.setup(new TRArmourItem(TRArmorMaterials.BRONZE, EquipmentSlot.CHEST), "bronze_chestplate"));
RebornRegistry.registerItem(TRContent.BRONZE_LEGGINGS = InitUtils.setup(new TRArmourItem(TRArmorMaterials.BRONZE, EquipmentSlot.LEGS), "bronze_leggings"));
RebornRegistry.registerItem(TRContent.BRONZE_BOOTS = InitUtils.setup(new TRArmourItem(TRArmorMaterials.BRONZE, EquipmentSlot.FEET), "bronze_boots"));
RebornRegistry.registerItem(TRContent.RUBY_SWORD = InitUtils.setup(new TRSwordItem(TRToolTier.RUBY), "ruby_sword"));
RebornRegistry.registerItem(TRContent.RUBY_PICKAXE = InitUtils.setup(new TRPickaxeItem(TRToolTier.RUBY), "ruby_pickaxe"));
@ -167,10 +167,10 @@ public class ModRegistry {
RebornRegistry.registerItem(TRContent.RUBY_AXE = InitUtils.setup(new TRAxeItem(TRToolTier.RUBY), "ruby_axe"));
RebornRegistry.registerItem(TRContent.RUBY_HOE = InitUtils.setup(new TRHoeItem(TRToolTier.RUBY), "ruby_hoe"));
RebornRegistry.registerItem(TRContent.RUBY_HELMET = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.RUBY, EquipmentSlot.HEAD), "ruby_helmet"));
RebornRegistry.registerItem(TRContent.RUBY_CHESTPLATE = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.RUBY, EquipmentSlot.CHEST), "ruby_chestplate"));
RebornRegistry.registerItem(TRContent.RUBY_LEGGINGS = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.RUBY, EquipmentSlot.LEGS), "ruby_leggings"));
RebornRegistry.registerItem(TRContent.RUBY_BOOTS = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.RUBY, EquipmentSlot.FEET), "ruby_boots"));
RebornRegistry.registerItem(TRContent.RUBY_HELMET = InitUtils.setup(new TRArmourItem(TRArmorMaterials.RUBY, EquipmentSlot.HEAD), "ruby_helmet"));
RebornRegistry.registerItem(TRContent.RUBY_CHESTPLATE = InitUtils.setup(new TRArmourItem(TRArmorMaterials.RUBY, EquipmentSlot.CHEST), "ruby_chestplate"));
RebornRegistry.registerItem(TRContent.RUBY_LEGGINGS = InitUtils.setup(new TRArmourItem(TRArmorMaterials.RUBY, EquipmentSlot.LEGS), "ruby_leggings"));
RebornRegistry.registerItem(TRContent.RUBY_BOOTS = InitUtils.setup(new TRArmourItem(TRArmorMaterials.RUBY, EquipmentSlot.FEET), "ruby_boots"));
RebornRegistry.registerItem(TRContent.SAPPHIRE_SWORD = InitUtils.setup(new TRSwordItem(TRToolTier.SAPPHIRE), "sapphire_sword"));
RebornRegistry.registerItem(TRContent.SAPPHIRE_PICKAXE = InitUtils.setup(new TRPickaxeItem(TRToolTier.SAPPHIRE), "sapphire_pickaxe"));
@ -178,10 +178,10 @@ public class ModRegistry {
RebornRegistry.registerItem(TRContent.SAPPHIRE_AXE = InitUtils.setup(new TRAxeItem(TRToolTier.SAPPHIRE), "sapphire_axe"));
RebornRegistry.registerItem(TRContent.SAPPHIRE_HOE = InitUtils.setup(new TRHoeItem(TRToolTier.SAPPHIRE), "sapphire_hoe"));
RebornRegistry.registerItem(TRContent.SAPPHIRE_HELMET = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.SAPPHIRE, EquipmentSlot.HEAD), "sapphire_helmet"));
RebornRegistry.registerItem(TRContent.SAPPHIRE_CHESTPLATE = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.SAPPHIRE, EquipmentSlot.CHEST), "sapphire_chestplate"));
RebornRegistry.registerItem(TRContent.SAPPHIRE_LEGGINGS = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.SAPPHIRE, EquipmentSlot.LEGS), "sapphire_leggings"));
RebornRegistry.registerItem(TRContent.SAPPHIRE_BOOTS = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.SAPPHIRE, EquipmentSlot.FEET), "sapphire_boots"));
RebornRegistry.registerItem(TRContent.SAPPHIRE_HELMET = InitUtils.setup(new TRArmourItem(TRArmorMaterials.SAPPHIRE, EquipmentSlot.HEAD), "sapphire_helmet"));
RebornRegistry.registerItem(TRContent.SAPPHIRE_CHESTPLATE = InitUtils.setup(new TRArmourItem(TRArmorMaterials.SAPPHIRE, EquipmentSlot.CHEST), "sapphire_chestplate"));
RebornRegistry.registerItem(TRContent.SAPPHIRE_LEGGINGS = InitUtils.setup(new TRArmourItem(TRArmorMaterials.SAPPHIRE, EquipmentSlot.LEGS), "sapphire_leggings"));
RebornRegistry.registerItem(TRContent.SAPPHIRE_BOOTS = InitUtils.setup(new TRArmourItem(TRArmorMaterials.SAPPHIRE, EquipmentSlot.FEET), "sapphire_boots"));
RebornRegistry.registerItem(TRContent.PERIDOT_SWORD = InitUtils.setup(new TRSwordItem(TRToolTier.PERIDOT), "peridot_sword"));
RebornRegistry.registerItem(TRContent.PERIDOT_PICKAXE = InitUtils.setup(new TRPickaxeItem(TRToolTier.PERIDOT), "peridot_pickaxe"));
@ -189,20 +189,20 @@ public class ModRegistry {
RebornRegistry.registerItem(TRContent.PERIDOT_AXE = InitUtils.setup(new TRAxeItem(TRToolTier.PERIDOT), "peridot_axe"));
RebornRegistry.registerItem(TRContent.PERIDOT_HOE = InitUtils.setup(new TRHoeItem(TRToolTier.PERIDOT), "peridot_hoe"));
RebornRegistry.registerItem(TRContent.PERIDOT_HELMET = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.PERIDOT, EquipmentSlot.HEAD), "peridot_helmet"));
RebornRegistry.registerItem(TRContent.PERIDOT_CHESTPLATE = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.PERIDOT, EquipmentSlot.CHEST), "peridot_chestplate"));
RebornRegistry.registerItem(TRContent.PERIDOT_LEGGINGS = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.PERIDOT, EquipmentSlot.LEGS), "peridot_leggings"));
RebornRegistry.registerItem(TRContent.PERIDOT_BOOTS = InitUtils.setup(new ItemTRArmour(TRArmorMaterial.PERIDOT, EquipmentSlot.FEET), "peridot_boots"));
RebornRegistry.registerItem(TRContent.PERIDOT_HELMET = InitUtils.setup(new TRArmourItem(TRArmorMaterials.PERIDOT, EquipmentSlot.HEAD), "peridot_helmet"));
RebornRegistry.registerItem(TRContent.PERIDOT_CHESTPLATE = InitUtils.setup(new TRArmourItem(TRArmorMaterials.PERIDOT, EquipmentSlot.CHEST), "peridot_chestplate"));
RebornRegistry.registerItem(TRContent.PERIDOT_LEGGINGS = InitUtils.setup(new TRArmourItem(TRArmorMaterials.PERIDOT, EquipmentSlot.LEGS), "peridot_leggings"));
RebornRegistry.registerItem(TRContent.PERIDOT_BOOTS = InitUtils.setup(new TRArmourItem(TRArmorMaterials.PERIDOT, EquipmentSlot.FEET), "peridot_boots"));
}
// Battery
RebornRegistry.registerItem(TRContent.RED_CELL_BATTERY = InitUtils.setup(new ItemRedCellBattery(), "red_cell_battery"));
RebornRegistry.registerItem(TRContent.LITHIUM_ION_BATTERY = InitUtils.setup(new ItemLithiumIonBattery(), "lithium_ion_battery"));
RebornRegistry.registerItem(TRContent.LITHIUM_ION_BATPACK = InitUtils.setup(new ItemLithiumIonBatpack(), "lithium_ion_batpack"));
RebornRegistry.registerItem(TRContent.ENERGY_CRYSTAL = InitUtils.setup(new ItemEnergyCrystal(), "energy_crystal"));
RebornRegistry.registerItem(TRContent.LAPOTRON_CRYSTAL = InitUtils.setup(new ItemLapotronCrystal(), "lapotron_crystal"));
RebornRegistry.registerItem(TRContent.LAPOTRONIC_ORB = InitUtils.setup(new ItemLapotronicOrb(), "lapotronic_orb"));
RebornRegistry.registerItem(TRContent.LAPOTRONIC_ORBPACK = InitUtils.setup(new ItemLapotronicOrbpack(), "lapotronic_orbpack"));
RebornRegistry.registerItem(TRContent.RED_CELL_BATTERY = InitUtils.setup(new RedCellBatteryItem(), "red_cell_battery"));
RebornRegistry.registerItem(TRContent.LITHIUM_ION_BATTERY = InitUtils.setup(new LithiumIonBatteryItem(), "lithium_ion_battery"));
RebornRegistry.registerItem(TRContent.LITHIUM_ION_BATPACK = InitUtils.setup(new LithiumIonBatpackItem(), "lithium_ion_batpack"));
RebornRegistry.registerItem(TRContent.ENERGY_CRYSTAL = InitUtils.setup(new EnergyCrystalItem(), "energy_crystal"));
RebornRegistry.registerItem(TRContent.LAPOTRON_CRYSTAL = InitUtils.setup(new LapotronCrystalItem(), "lapotron_crystal"));
RebornRegistry.registerItem(TRContent.LAPOTRONIC_ORB = InitUtils.setup(new LapotronicOrbItem(), "lapotronic_orb"));
RebornRegistry.registerItem(TRContent.LAPOTRONIC_ORBPACK = InitUtils.setup(new LapotronicOrbpackItem(), "lapotronic_orbpack"));
// Tools
RebornRegistry.registerItem(TRContent.TREE_TAP = InitUtils.setup(new TreeTapItem(), "treetap"));
@ -226,12 +226,12 @@ public class ModRegistry {
RebornRegistry.registerItem(TRContent.OMNI_TOOL = InitUtils.setup(new OmniToolItem(), "omni_tool"));
// Armor
RebornRegistry.registerItem(TRContent.CLOAKING_DEVICE = InitUtils.setup(new ItemCloakingDevice(), "cloaking_device"));
RebornRegistry.registerItem(TRContent.CLOAKING_DEVICE = InitUtils.setup(new CloakingDeviceItem(), "cloaking_device"));
// Other
RebornRegistry.registerItem(TRContent.FREQUENCY_TRANSMITTER = InitUtils.setup(new ItemFrequencyTransmitter(), "frequency_transmitter"));
RebornRegistry.registerItem(TRContent.SCRAP_BOX = InitUtils.setup(new ItemScrapBox(), "scrap_box"));
RebornRegistry.registerItem(TRContent.MANUAL = InitUtils.setup(new ItemManual(), "manual"));
RebornRegistry.registerItem(TRContent.FREQUENCY_TRANSMITTER = InitUtils.setup(new FrequencyTransmitterItem(), "frequency_transmitter"));
RebornRegistry.registerItem(TRContent.SCRAP_BOX = InitUtils.setup(new ScrapBoxItem(), "scrap_box"));
RebornRegistry.registerItem(TRContent.MANUAL = InitUtils.setup(new ManualItem(), "manual"));
RebornRegistry.registerItem(TRContent.DEBUG_TOOL = InitUtils.setup(new DebugToolItem(), "debug_tool"));
RebornRegistry.registerItem(TRContent.CELL = InitUtils.setup(new DynamicCellItem(), "cell"));

View file

@ -47,7 +47,7 @@ import team.reborn.energy.EnergyHolder;
import team.reborn.energy.EnergySide;
import techreborn.TechReborn;
import techreborn.init.TRContent;
import techreborn.items.ItemUpgrade;
import techreborn.items.UpgradeItem;
import techreborn.utils.ToolTipAssistUtils;
import techreborn.utils.WIP;
@ -82,8 +82,8 @@ public class StackToolTipHandler implements ItemTooltipCallback {
ToolTipAssistUtils.addInfo(item.getTranslationKey(), components);
}
if(item instanceof ItemUpgrade){
ItemUpgrade upgrade = (ItemUpgrade)item;
if(item instanceof UpgradeItem){
UpgradeItem upgrade = (UpgradeItem)item;
ToolTipAssistUtils.addInfo(item.getTranslationKey(), components, false);
components.addAll(ToolTipAssistUtils.getUpgradeStats(TRContent.Upgrades.valueOf(upgrade.name.toUpperCase()), stack.getCount(), Screen.hasShiftDown()));

View file

@ -35,7 +35,7 @@ import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Lazy;
public enum TRArmorMaterial implements ArmorMaterial {
public enum TRArmorMaterials implements ArmorMaterial {
BRONZE(17, new int[] { 3, 6, 5, 2 }, 8, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0.0F, () -> {
return Ingredient.ofItems(TRContent.Ingots.BRONZE.asItem());
@ -50,10 +50,9 @@ public enum TRArmorMaterial implements ArmorMaterial {
return Ingredient.ofItems(TRContent.Gems.PERIDOT.asItem());
}),
QUANTUM(75, new int[] { 3, 6, 8, 3 }, 10, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 0.0F, () -> Ingredient.EMPTY),
CLOAKING(5, new int[] { 1, 2, 3, 1 }, 0, SoundEvents.ITEM_ARMOR_EQUIP_GOLD, 0.0F, () -> Ingredient.EMPTY),
LITHIUMBATPACK(25, new int[]{2, 5, 6, 2}, 10, SoundEvents.ITEM_ARMOR_EQUIP_TURTLE, 0.0F, () -> Ingredient.EMPTY),
LAPOTRONPACK(33, new int[]{3, 6, 8, 3}, 10, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 2.0F, () -> Ingredient.EMPTY);
CLOAKING_DEVICE(5, new int[] { 0, 2, 0, 0 }, 0, SoundEvents.ITEM_ARMOR_EQUIP_GOLD, 0.0F, () -> Ingredient.EMPTY),
LITHIUM_BATPACK(25, new int[]{0, 5, 0, 0}, 10, SoundEvents.ITEM_ARMOR_EQUIP_TURTLE, 0.0F, () -> Ingredient.EMPTY),
LAPOTRONIC_ORBPACK(33, new int[]{0, 6, 0, 0}, 10, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 2.0F, () -> Ingredient.EMPTY);
private static final int[] MAX_DAMAGE_ARRAY = new int[]{13, 15, 16, 11};
private final int maxDamageFactor;
@ -63,8 +62,8 @@ public enum TRArmorMaterial implements ArmorMaterial {
private final float toughness;
private final Lazy<Ingredient> repairMaterial;
TRArmorMaterial(int maxDamageFactor, int[] damageReductionAmountArray, int enchantability,
SoundEvent soundEvent, float toughness, Supplier<Ingredient> repairMaterialIn) {
TRArmorMaterials(int maxDamageFactor, int[] damageReductionAmountArray, int enchantability,
SoundEvent soundEvent, float toughness, Supplier<Ingredient> repairMaterialIn) {
this.maxDamageFactor = maxDamageFactor;
this.damageReductionAmountArray = damageReductionAmountArray;
this.enchantability = enchantability;

View file

@ -50,7 +50,9 @@ import techreborn.blockentity.machine.misc.AlarmBlockEntity;
import techreborn.blockentity.machine.misc.ChargeOMatBlockEntity;
import techreborn.blockentity.machine.multiblock.*;
import techreborn.blockentity.machine.tier1.*;
import techreborn.blockentity.machine.tier3.*;
import techreborn.blockentity.machine.tier3.ChunkLoaderBlockEntity;
import techreborn.blockentity.machine.tier3.IndustrialCentrifugeBlockEntity;
import techreborn.blockentity.machine.tier3.MatterFabricatorBlockEntity;
import techreborn.blockentity.storage.energy.AdjustableSUBlockEntity;
import techreborn.blockentity.storage.energy.HighVoltageSUBlockEntity;
import techreborn.blockentity.storage.energy.LowVoltageSUBlockEntity;

View file

@ -79,8 +79,8 @@ import techreborn.client.EGui;
import techreborn.config.TechRebornConfig;
import techreborn.entities.EntityNukePrimed;
import techreborn.items.DynamicCellItem;
import techreborn.items.ItemUpgrade;
import techreborn.items.armor.ItemQuantumSuit;
import techreborn.items.UpgradeItem;
import techreborn.items.armor.QuantumSuitItem;
import techreborn.utils.InitUtils;
import javax.annotation.Nullable;
@ -151,10 +151,10 @@ public class TRContent {
public static DynamicCellItem CELL;
//Quantum Suit
public static ItemQuantumSuit QUANTUM_HELMET;
public static ItemQuantumSuit QUANTUM_CHESTPLATE;
public static ItemQuantumSuit QUANTUM_LEGGINGS;
public static ItemQuantumSuit QUANTUM_BOOTS;
public static QuantumSuitItem QUANTUM_HELMET;
public static QuantumSuitItem QUANTUM_CHESTPLATE;
public static QuantumSuitItem QUANTUM_LEGGINGS;
public static QuantumSuitItem QUANTUM_BOOTS;
// Gem armor & tools
@Nullable
@ -839,7 +839,7 @@ public class TRContent {
Upgrades(IUpgrade upgrade) {
name = this.toString().toLowerCase(Locale.ROOT);
item = new ItemUpgrade(name, upgrade);
item = new UpgradeItem(name, upgrade);
InitUtils.setup(item, name + "_upgrade");
}

View file

@ -52,9 +52,9 @@ import techreborn.utils.MessageIDs;
import javax.annotation.Nullable;
import java.util.List;
public class ItemFrequencyTransmitter extends Item {
public class FrequencyTransmitterItem extends Item {
public ItemFrequencyTransmitter() {
public FrequencyTransmitterItem() {
super(new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1));
this.addPropertyGetter(new Identifier("techreborn", "coords"), new ItemPropertyGetter() {
@Override
@ -145,7 +145,7 @@ public class ItemFrequencyTransmitter extends Item {
String text = "";
Formatting gold = Formatting.GOLD;
Formatting grey = Formatting.GRAY;
if (stack.getItem() instanceof ItemFrequencyTransmitter) {
if (stack.getItem() instanceof FrequencyTransmitterItem) {
if (stack.hasTag() && stack.getTag() != null && stack.getTag().contains("x") && stack.getTag().contains("y") && stack.getTag().contains("z") && stack.getTag().contains("dim")) {
int coordX = stack.getTag().getInt("x");
int coordY = stack.getTag().getInt("y");

View file

@ -37,9 +37,9 @@ import net.minecraft.world.World;
import techreborn.TechReborn;
import techreborn.client.gui.GuiManual;
public class ItemManual extends Item {
public class ManualItem extends Item {
public ItemManual() {
public ManualItem() {
super(new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1));
}

View file

@ -38,9 +38,9 @@ import techreborn.init.ModRecipes;
import java.util.List;
public class ItemScrapBox extends Item {
public class ScrapBoxItem extends Item {
public ItemScrapBox() {
public ScrapBoxItem() {
super(new Item.Settings().group(TechReborn.ITEMGROUP));
}

View file

@ -44,12 +44,12 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
public class ItemUpgrade extends Item implements IUpgrade {
public class UpgradeItem extends Item implements IUpgrade {
public final String name;
public final IUpgrade behavior;
public ItemUpgrade(String name, IUpgrade process) {
public UpgradeItem(String name, IUpgrade process) {
super(new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(16));
this.name = name;
this.behavior = process;

View file

@ -26,14 +26,12 @@ package techreborn.items.armor;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DefaultedList;
import net.minecraft.world.World;
import reborncore.api.items.ArmorRemoveHandler;
import reborncore.api.items.ArmorTickable;
import reborncore.common.powerSystem.PowerSystem;
@ -42,12 +40,13 @@ import team.reborn.energy.Energy;
import team.reborn.energy.EnergyHolder;
import team.reborn.energy.EnergySide;
import team.reborn.energy.EnergyTier;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.TRArmorMaterial;
import techreborn.init.TRArmorMaterials;
import techreborn.init.TRContent;
import techreborn.utils.InitUtils;
public class ItemCloakingDevice extends ItemTRArmour implements EnergyHolder, ArmorTickable, ArmorRemoveHandler {
public class CloakingDeviceItem extends TRArmourItem implements EnergyHolder, ArmorTickable, ArmorRemoveHandler {
public static int maxCharge = TechRebornConfig.cloakingDeviceCharge;
public static int usage = TechRebornConfig.cloackingDeviceUsage;
@ -55,8 +54,13 @@ public class ItemCloakingDevice extends ItemTRArmour implements EnergyHolder, Ar
public static boolean isActive;
// 40M FE capacity with 10k FE\t charge rate
public ItemCloakingDevice() {
super(TRArmorMaterial.CLOAKING, EquipmentSlot.CHEST);
public CloakingDeviceItem() {
super(TRArmorMaterials.CLOAKING_DEVICE, EquipmentSlot.CHEST, new Item.Settings().group(TechReborn.ITEMGROUP).maxDamage(-1).maxCount(1));
}
@Override
public boolean canRepair(ItemStack stack, ItemStack ingredient) {
return false;
}
// ItemTRArmour
@ -70,6 +74,11 @@ public class ItemCloakingDevice extends ItemTRArmour implements EnergyHolder, Ar
return true;
}
@Override
public boolean isEnchantable(ItemStack stack) {
return true;
}
@Override
public int getDurabilityColor(ItemStack stack) {
return PowerSystem.getDisplayPower().colour;

View file

@ -40,18 +40,18 @@ import team.reborn.energy.EnergyHolder;
import team.reborn.energy.EnergyTier;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.TRArmorMaterial;
import techreborn.init.TRArmorMaterials;
import techreborn.init.TRContent;
import techreborn.utils.InitUtils;
public class ItemLapotronicOrbpack extends ArmorItem implements EnergyHolder, ItemDurabilityExtensions {
public class LapotronicOrbpackItem extends ArmorItem implements EnergyHolder, ItemDurabilityExtensions {
// 400M FE maxCharge and 100k FE\t charge rate. Fully charged in 3 mins.
public static final int maxCharge = TechRebornConfig.lapotronPackCharge;
public int transferLimit = 100_000;
public ItemLapotronicOrbpack() {
super(TRArmorMaterial.LAPOTRONPACK, EquipmentSlot.CHEST, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
public LapotronicOrbpackItem() {
super(TRArmorMaterials.LAPOTRONIC_ORBPACK, EquipmentSlot.CHEST, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
}
// Item
@ -62,11 +62,11 @@ public class ItemLapotronicOrbpack extends ArmorItem implements EnergyHolder, It
}
InitUtils.initPoweredItems(TRContent.LAPOTRONIC_ORBPACK, itemList);
}
@Override
public void inventoryTick(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
if (entityIn instanceof PlayerEntity) {
ItemLithiumIonBatpack.distributePowerToInventory(worldIn, (PlayerEntity) entityIn, stack, transferLimit);
LithiumIonBatpackItem.distributePowerToInventory(worldIn, (PlayerEntity) entityIn, stack, transferLimit);
}
}
@ -85,6 +85,11 @@ public class ItemLapotronicOrbpack extends ArmorItem implements EnergyHolder, It
return true;
}
@Override
public boolean isEnchantable(ItemStack stack) {
return true;
}
@Override
public int getDurabilityColor(ItemStack stack) {
return PowerSystem.getDisplayPower().colour;

View file

@ -43,18 +43,18 @@ import team.reborn.energy.EnergyHolder;
import team.reborn.energy.EnergyTier;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.TRArmorMaterial;
import techreborn.init.TRArmorMaterials;
import techreborn.init.TRContent;
import techreborn.utils.InitUtils;
public class ItemLithiumIonBatpack extends ArmorItem implements EnergyHolder, ItemDurabilityExtensions {
public class LithiumIonBatpackItem extends ArmorItem implements EnergyHolder, ItemDurabilityExtensions {
// 8M FE maxCharge and 2k FE\t charge rate. Fully charged in 3 mins.
public static final int maxCharge = TechRebornConfig.lithiumBatpackCharge;
public int transferLimit = 2_000;
public ItemLithiumIonBatpack() {
super(TRArmorMaterial.LITHIUMBATPACK, EquipmentSlot.CHEST, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
public LithiumIonBatpackItem() {
super(TRArmorMaterials.LITHIUM_BATPACK, EquipmentSlot.CHEST, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
}
public static void distributePowerToInventory(World world, PlayerEntity player, ItemStack itemStack, int maxSend) {
@ -101,6 +101,11 @@ public class ItemLithiumIonBatpack extends ArmorItem implements EnergyHolder, It
return true;
}
@Override
public boolean isEnchantable(ItemStack stack) {
return true;
}
@Override
public int getDurabilityColor(ItemStack stack) {
return PowerSystem.getDisplayPower().colour;

View file

@ -35,6 +35,7 @@ import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DefaultedList;
@ -48,17 +49,18 @@ import team.reborn.energy.Energy;
import team.reborn.energy.EnergyHolder;
import team.reborn.energy.EnergySide;
import team.reborn.energy.EnergyTier;
import techreborn.TechReborn;
import techreborn.utils.InitUtils;
public class ItemQuantumSuit extends ItemTRArmour implements ItemStackModifiers, ArmorTickable, ArmorRemoveHandler, ArmorFovHandler, EnergyHolder {
public class QuantumSuitItem extends TRArmourItem implements ItemStackModifiers, ArmorTickable, ArmorRemoveHandler, ArmorFovHandler, EnergyHolder {
public static final double ENERGY_FLY = 50;
public static final double ENERGY_SWIM = 20;
public static final double ENERGY_BREATHING = 20;
public static final double ENERGY_SPRINTING = 20;
public ItemQuantumSuit(ArmorMaterial material, EquipmentSlot slot) {
super(material, slot);
public QuantumSuitItem(ArmorMaterial material, EquipmentSlot slot) {
super(material, slot, new Item.Settings().group(TechReborn.ITEMGROUP).maxDamage(-1).maxCount(1));
}
@Override
@ -67,11 +69,11 @@ public class ItemQuantumSuit extends ItemTRArmour implements ItemStackModifiers,
if (this.slot == EquipmentSlot.LEGS && equipmentSlot == EquipmentSlot.LEGS) {
if (Energy.of(stack).getEnergy() > ENERGY_SPRINTING) {
attributes.put(EntityAttributes.MOVEMENT_SPEED.getId(), new EntityAttributeModifier(MODIFIERS[equipmentSlot.getEntitySlotId()],"Movement Speed", 0.15, EntityAttributeModifier.Operation.ADDITION));
attributes.put(EntityAttributes.MOVEMENT_SPEED.getId(), new EntityAttributeModifier(MODIFIERS[equipmentSlot.getEntitySlotId()], "Movement Speed", 0.15, EntityAttributeModifier.Operation.ADDITION));
}
}
if(equipmentSlot == this.slot && Energy.of(stack).getEnergy() > 0) {
if (equipmentSlot == this.slot && Energy.of(stack).getEnergy() > 0) {
attributes.put(EntityAttributes.ARMOR.getId(), new EntityAttributeModifier(MODIFIERS[slot.getEntitySlotId()], "Armor modifier", 20, EntityAttributeModifier.Operation.ADDITION));
attributes.put(EntityAttributes.KNOCKBACK_RESISTANCE.getId(), new EntityAttributeModifier(MODIFIERS[slot.getEntitySlotId()], "Knockback modifier", 2, EntityAttributeModifier.Operation.ADDITION));
}
@ -148,6 +150,11 @@ public class ItemQuantumSuit extends ItemTRArmour implements ItemStackModifiers,
return true;
}
@Override
public boolean isEnchantable(ItemStack stack) {
return true;
}
@Override
public int getDurabilityColor(ItemStack stack) {
return PowerSystem.getDisplayPower().colour;

View file

@ -38,37 +38,21 @@ import java.util.UUID;
/**
* Created by modmuss50 on 26/02/2016.
*/
public class ItemTRArmour extends ArmorItem implements ItemDurabilityExtensions {
public class TRArmourItem extends ArmorItem implements ItemDurabilityExtensions {
//Thanks for being private
public static final UUID[] MODIFIERS = new UUID[] {
public static final UUID[] MODIFIERS = new UUID[]{
UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"),
UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"),
UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"),
UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150")
};
String repairOreDict;
public ItemTRArmour(ArmorMaterial material, EquipmentSlot slot) {
this(material, slot, "");
public TRArmourItem(ArmorMaterial material, EquipmentSlot slot) {
this(material, slot, new Item.Settings().group(TechReborn.ITEMGROUP));
}
public ItemTRArmour(ArmorMaterial material, EquipmentSlot slot, String repairOreDict) {
super(material, slot, (new Item.Settings()).group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
this.repairOreDict = repairOreDict;
}
@Override
public boolean isDamageable() {
return false;
}
@Override
public boolean canRepair(ItemStack toRepair, ItemStack repair) {
if (toRepair.getItem() == this && !repairOreDict.isEmpty()) {
return ItemUtils.isInputEqual(repairOreDict, repair, false, true);
}
return super.canRepair(toRepair, repair);
public TRArmourItem(ArmorMaterial material, EquipmentSlot slot, Item.Settings settings) {
super(material, slot, settings);
}
}

View file

@ -42,12 +42,12 @@ import techreborn.TechReborn;
import javax.annotation.Nullable;
public class ItemBattery extends Item implements EnergyHolder, ItemDurabilityExtensions {
public class BatteryItem extends Item implements EnergyHolder, ItemDurabilityExtensions {
private final int maxEnergy;
private final EnergyTier tier;
public ItemBattery(int maxEnergy, EnergyTier tier) {
public BatteryItem(int maxEnergy, EnergyTier tier) {
super(new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamageIfAbsent(1));
this.maxEnergy = maxEnergy;
this.tier = tier;

View file

@ -34,10 +34,10 @@ import techreborn.config.TechRebornConfig;
import techreborn.init.TRContent;
import techreborn.utils.InitUtils;
public class ItemEnergyCrystal extends ItemBattery {
public class EnergyCrystalItem extends BatteryItem {
// 4M FE storage with 1k charge rate
public ItemEnergyCrystal() {
public EnergyCrystalItem() {
super(TechRebornConfig.energyCrystalMaxCharge, EnergyTier.HIGH);
}

View file

@ -34,10 +34,10 @@ import techreborn.config.TechRebornConfig;
import techreborn.init.TRContent;
import techreborn.utils.InitUtils;
public class ItemLapotronCrystal extends ItemBattery {
public class LapotronCrystalItem extends BatteryItem {
// 40M FE capacity with 10k FE\t charge rate
public ItemLapotronCrystal() {
public LapotronCrystalItem() {
super(TechRebornConfig.lapotronCrystalMaxCharge, EnergyTier.EXTREME);
}

View file

@ -34,10 +34,10 @@ import techreborn.config.TechRebornConfig;
import techreborn.init.TRContent;
import techreborn.utils.InitUtils;
public class ItemLapotronicOrb extends ItemBattery {
public class LapotronicOrbItem extends BatteryItem {
// 400M capacity with 100k FE\t charge rate
public ItemLapotronicOrb() {
public LapotronicOrbItem() {
super(TechRebornConfig.lapotronicOrbMaxCharge, EnergyTier.EXTREME);
}

View file

@ -33,10 +33,10 @@ import team.reborn.energy.EnergyTier;
import techreborn.init.TRContent;
import techreborn.utils.InitUtils;
public class ItemLithiumIonBattery extends ItemBattery {
public class LithiumIonBatteryItem extends BatteryItem {
// 400k FE with 1k FE\t charge rate
public ItemLithiumIonBattery() {
public LithiumIonBatteryItem() {
super(400_000, EnergyTier.HIGH);
}

View file

@ -33,10 +33,10 @@ import team.reborn.energy.EnergyTier;
import techreborn.init.TRContent;
import techreborn.utils.InitUtils;
public class ItemRedCellBattery extends ItemBattery {
public class RedCellBatteryItem extends BatteryItem {
// 40k FE capacity with 100 FE\t charge rate
public ItemRedCellBattery() {
public RedCellBatteryItem() {
super(40_000, EnergyTier.LOW);
}