Use custom tool materials (#2631)
* Use custom tool materials * Separate jackhammer materials
This commit is contained in:
parent
ce18aab73d
commit
7d9fb6d414
12 changed files with 94 additions and 18 deletions
src/main/java/techreborn/items/tool
|
@ -51,7 +51,7 @@ public class ChainsawItem extends AxeItem implements RcEnergyItem {
|
|||
public final Item referenceTool;
|
||||
public final RcEnergyTier tier;
|
||||
|
||||
public ChainsawItem(ToolMaterials material, int energyCapacity, RcEnergyTier tier, int cost, float poweredSpeed, float unpoweredSpeed, Item referenceTool) {
|
||||
public ChainsawItem(ToolMaterial material, int energyCapacity, RcEnergyTier tier, int cost, float poweredSpeed, float unpoweredSpeed, Item referenceTool) {
|
||||
// combat stats same as for diamond axe. Fix for #2468
|
||||
super(material, 5.0F, -3.0F, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
this.maxCharge = energyCapacity;
|
||||
|
|
|
@ -51,7 +51,7 @@ public class DrillItem extends PickaxeItem implements RcEnergyItem, DynamicAttri
|
|||
public final int miningLevel;
|
||||
public final RcEnergyTier tier;
|
||||
|
||||
public DrillItem(ToolMaterials material, int energyCapacity, RcEnergyTier tier, int cost, float poweredSpeed, float unpoweredSpeed, MiningLevel miningLevel) {
|
||||
public DrillItem(ToolMaterial material, int energyCapacity, RcEnergyTier tier, int cost, float poweredSpeed, float unpoweredSpeed, MiningLevel miningLevel) {
|
||||
// combat stats same as for diamond pickaxe. Fix for #2468
|
||||
super(material, 1, -2.8F, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
this.maxCharge = energyCapacity;
|
||||
|
|
|
@ -41,6 +41,7 @@ import reborncore.common.powerSystem.RcEnergyItem;
|
|||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.TRToolMaterials;
|
||||
import techreborn.utils.InitUtils;
|
||||
import techreborn.utils.ToolsUtil;
|
||||
|
||||
|
@ -53,9 +54,9 @@ public class JackhammerItem extends PickaxeItem implements RcEnergyItem, Dynamic
|
|||
public final int cost;
|
||||
protected final float unpoweredSpeed = 0.5F;
|
||||
|
||||
public JackhammerItem(int energyCapacity, RcEnergyTier tier, int cost) {
|
||||
public JackhammerItem(ToolMaterial material, int energyCapacity, RcEnergyTier tier, int cost) {
|
||||
// combat stats same as for diamond pickaxe. Fix for #2468
|
||||
super(ToolMaterials.DIAMOND, 1, -2.8F, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
super(material, 1, -2.8F, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
this.maxCharge = energyCapacity;
|
||||
this.tier = tier;
|
||||
this.cost = cost;
|
||||
|
|
|
@ -43,6 +43,7 @@ import reborncore.common.misc.MultiBlockBreakingTool;
|
|||
import reborncore.common.util.ItemUtils;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRToolMaterials;
|
||||
import techreborn.items.tool.JackhammerItem;
|
||||
import techreborn.utils.MessageIDs;
|
||||
import techreborn.utils.ToolsUtil;
|
||||
|
@ -55,7 +56,7 @@ import java.util.stream.Collectors;
|
|||
public class AdvancedJackhammerItem extends JackhammerItem implements MultiBlockBreakingTool {
|
||||
|
||||
public AdvancedJackhammerItem() {
|
||||
super(TechRebornConfig.advancedJackhammerCharge, RcEnergyTier.EXTREME, TechRebornConfig.advancedJackhammerCost);
|
||||
super(TRToolMaterials.ADVANCED_JACKHAMMER, TechRebornConfig.advancedJackhammerCharge, RcEnergyTier.EXTREME, TechRebornConfig.advancedJackhammerCost);
|
||||
}
|
||||
|
||||
private boolean shouldBreak(World worldIn, BlockPos originalPos, BlockPos pos, ItemStack stack) {
|
||||
|
|
|
@ -42,6 +42,7 @@ import reborncore.common.powerSystem.RcEnergyTier;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRToolMaterials;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
|
@ -53,7 +54,7 @@ public class RockCutterItem extends PickaxeItem implements RcEnergyItem {
|
|||
// 10k Energy with 128 E\t charge rate
|
||||
public RockCutterItem() {
|
||||
// combat stats same as for diamond pickaxe. Fix for #2468
|
||||
super(ToolMaterials.DIAMOND, 1, -2.8F, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
super(TRToolMaterials.ROCK_CUTTER, 1, -2.8F, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
}
|
||||
|
||||
// PickaxeItem
|
||||
|
|
|
@ -45,6 +45,7 @@ import org.jetbrains.annotations.Nullable;
|
|||
import reborncore.common.util.ItemUtils;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRToolMaterials;
|
||||
import techreborn.items.tool.ChainsawItem;
|
||||
import techreborn.utils.MessageIDs;
|
||||
import techreborn.utils.TagUtils;
|
||||
|
@ -58,7 +59,7 @@ public class IndustrialChainsawItem extends ChainsawItem {
|
|||
private static final Direction[] SEARCH_ORDER = new Direction[]{Direction.NORTH, Direction.SOUTH, Direction.EAST, Direction.WEST, Direction.UP};
|
||||
|
||||
public IndustrialChainsawItem() {
|
||||
super(ToolMaterials.DIAMOND, TechRebornConfig.industrialChainsawCharge, RcEnergyTier.EXTREME, TechRebornConfig.industrialChainsawCost, 20F, 1.0F, Items.DIAMOND_AXE);
|
||||
super(TRToolMaterials.INDUSTRIAL_CHAINSAW, TechRebornConfig.industrialChainsawCharge, RcEnergyTier.EXTREME, TechRebornConfig.industrialChainsawCost, 20F, 1.0F, Items.DIAMOND_AXE);
|
||||
}
|
||||
|
||||
private void findWood(World world, BlockPos pos, List<BlockPos> wood, List<BlockPos> leaves) {
|
||||
|
|
|
@ -46,6 +46,7 @@ import reborncore.common.util.ItemUtils;
|
|||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRToolMaterials;
|
||||
import techreborn.items.tool.DrillItem;
|
||||
import techreborn.items.tool.MiningLevel;
|
||||
import techreborn.utils.InitUtils;
|
||||
|
@ -57,7 +58,7 @@ import java.util.List;
|
|||
public class IndustrialDrillItem extends DrillItem {
|
||||
|
||||
public IndustrialDrillItem() {
|
||||
super(ToolMaterials.DIAMOND, TechRebornConfig.industrialDrillCharge, RcEnergyTier.INSANE, TechRebornConfig.industrialDrillCost, 20.0F, 1.0F, MiningLevel.DIAMOND);
|
||||
super(TRToolMaterials.INDUSTRIAL_DRILL, TechRebornConfig.industrialDrillCharge, RcEnergyTier.INSANE, TechRebornConfig.industrialDrillCost, 20.0F, 1.0F, MiningLevel.DIAMOND);
|
||||
}
|
||||
|
||||
private boolean shouldBreak(PlayerEntity playerIn, World worldIn, BlockPos originalPos, BlockPos pos) {
|
||||
|
|
|
@ -47,6 +47,7 @@ import reborncore.common.util.ChatUtils;
|
|||
import reborncore.common.util.ItemUtils;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRToolMaterials;
|
||||
import techreborn.items.tool.JackhammerItem;
|
||||
import techreborn.utils.MessageIDs;
|
||||
import techreborn.utils.ToolsUtil;
|
||||
|
@ -59,7 +60,7 @@ import java.util.stream.Collectors;
|
|||
public class IndustrialJackhammerItem extends JackhammerItem implements MultiBlockBreakingTool {
|
||||
|
||||
public IndustrialJackhammerItem() {
|
||||
super(TechRebornConfig.industrialJackhammerCharge, RcEnergyTier.INSANE, TechRebornConfig.industrialJackhammerCost);
|
||||
super(TRToolMaterials.INDUSTRIAL_JACKHAMMER, TechRebornConfig.industrialJackhammerCharge, RcEnergyTier.INSANE, TechRebornConfig.industrialJackhammerCost);
|
||||
}
|
||||
|
||||
// Cycle Inactive, Active 3*3 and Active 5*5
|
||||
|
|
|
@ -52,6 +52,7 @@ import reborncore.common.powerSystem.RcEnergyTier;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRToolMaterials;
|
||||
import techreborn.utils.MessageIDs;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -62,7 +63,7 @@ public class NanosaberItem extends SwordItem implements RcEnergyItem, ItemStackM
|
|||
|
||||
// 4ME max charge with 1k charge rate
|
||||
public NanosaberItem() {
|
||||
super(ToolMaterials.DIAMOND, 1, 1, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
super(TRToolMaterials.NANOSABER, 1, 1, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
}
|
||||
|
||||
// SwordItem
|
||||
|
|
|
@ -52,6 +52,7 @@ import reborncore.common.powerSystem.RcEnergyTier;
|
|||
import techreborn.TechReborn;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.init.TRToolMaterials;
|
||||
import techreborn.items.tool.MiningLevel;
|
||||
import techreborn.utils.InitUtils;
|
||||
|
||||
|
@ -66,7 +67,7 @@ public class OmniToolItem extends PickaxeItem implements RcEnergyItem, DynamicAt
|
|||
|
||||
// 4M FE max charge with 1k charge rate
|
||||
public OmniToolItem() {
|
||||
super(ToolMaterials.DIAMOND, 3, 1, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
super(TRToolMaterials.OMNI_TOOL, 3, 1, new Item.Settings().group(TechReborn.ITEMGROUP).maxCount(1).maxDamage(-1));
|
||||
this.miningLevel = MiningLevel.DIAMOND.intLevel;
|
||||
}
|
||||
|
||||
|
@ -81,7 +82,7 @@ public class OmniToolItem extends PickaxeItem implements RcEnergyItem, DynamicAt
|
|||
@Override
|
||||
public float getMiningSpeedMultiplier(ItemStack stack, BlockState state) {
|
||||
if (getStoredEnergy(stack) >= cost) {
|
||||
return ToolMaterials.DIAMOND.getMiningSpeedMultiplier();
|
||||
return getMaterial().getMiningSpeedMultiplier();
|
||||
}
|
||||
return super.getMiningSpeedMultiplier(stack, state);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue