mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-18 19:29:29 +00:00
Adding a maintenance foci, thaumic alternative to carrying a toolbox/duct-tape (#60)
* Added maintenance focus. * Changing some lang to alastor's liking. * Some tweaks and spotless apply. * Some tweaks and spotless apply. * Removed as many extra calls as I could.
This commit is contained in:
1 parent
e20ae4f103
commit
c5a72c0dff
9 files changed
+117
No files matched your search
@@ -58,6 +58,7 @@ public class EMTItems {
|
||||
public static Item christmasFocus;
|
||||
public static Item shieldFocus;
|
||||
public static Item energyBallFocus;
|
||||
public static Item maintenanceFocus;
|
||||
public static Item electricGoggles;
|
||||
public static Item streamChainsaw;
|
||||
public static Item rockbreakerDrill;
|
||||
@@ -197,5 +198,8 @@ public class EMTItems {
|
||||
|
||||
energyBallFocus = new ItemEnergyBallFocus();
|
||||
GameRegistry.registerItem(energyBallFocus, "EnergyBallFocus");
|
||||
|
||||
maintenanceFocus = new ItemMaintenanceFocus();
|
||||
GameRegistry.registerItem(maintenanceFocus, "MaintenanceFocus");
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import emt.EMT;
|
||||
import emt.util.EMTConfigHandler;
|
||||
import emt.util.EMTCraftingAspects;
|
||||
import emt.util.EMTResearchAspects;
|
||||
import gregtech.api.enums.ItemList;
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.api.recipe.IRecipeInput;
|
||||
import ic2.api.recipe.RecipeInputItemStack;
|
||||
@@ -67,6 +68,7 @@ public class EMTRecipes {
|
||||
public static InfusionRecipe thaumicNanoHelmet;
|
||||
public static InfusionRecipe explosionFocus;
|
||||
public static InfusionRecipe shieldFocus;
|
||||
public static InfusionRecipe maintenanceFocus;
|
||||
public static InfusionRecipe potentiaGenerator;
|
||||
public static InfusionRecipe streamChainsaw;
|
||||
public static InfusionRecipe rockbreakerDrill;
|
||||
@@ -534,6 +536,18 @@ public class EMTRecipes {
|
||||
new ItemStack(Blocks.soul_sand), new ItemStack(Blocks.obsidian),
|
||||
new ItemStack(Blocks.obsidian) });
|
||||
|
||||
maintenanceFocus = addInfusionCraftingRecipe(
|
||||
"Wand Focus: Maintenance",
|
||||
new ItemStack(EMTItems.maintenanceFocus),
|
||||
6,
|
||||
EMTCraftingAspects.maintenanceFocus,
|
||||
new ItemStack(EMTItems.chargeFocus),
|
||||
new ItemStack[] { new ItemStack(ConfigItems.itemShard, 1, 5),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 4), new ItemStack(ConfigItems.itemShard, 1, 3),
|
||||
new ItemStack(EMTItems.itemEMTItems, 1, 9), new ItemStack(ConfigItems.itemShard, 1, 2),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 1), new ItemStack(ConfigItems.itemShard, 1, 0),
|
||||
ItemList.Duct_Tape.get(1) });
|
||||
|
||||
potentiaGenerator = addInfusionCraftingRecipe(
|
||||
"Potentia Generator",
|
||||
new ItemStack(EMTBlocks.essentiaGens, 1, 0),
|
||||
|
||||
@@ -648,6 +648,17 @@ public class EMTResearches {
|
||||
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.chargeFocus));
|
||||
}
|
||||
|
||||
if (!EMTConfigHandler.maintenanceFocusResearch) {
|
||||
new EMTResearchItem(
|
||||
"Wand Focus: Maintenance",
|
||||
EMTResearchAspects.maintenanceFocus,
|
||||
7,
|
||||
4,
|
||||
4,
|
||||
new ItemStack(EMTItems.maintenanceFocus)).setParents("Wand Focus: Charging").setConcealed()
|
||||
.registerResearchItem()
|
||||
.setPages(new ResearchPage(""), new ResearchPage(EMTRecipes.maintenanceFocus));
|
||||
}
|
||||
if (!EMTConfigHandler.wandChargeFocusResearch) {
|
||||
new EMTResearchItem(
|
||||
"Wand Focus: Wand Charging",
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package emt.item.focus;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
|
||||
import gregtech.api.metatileentity.BaseMetaTileEntity;
|
||||
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
|
||||
|
||||
public class ItemMaintenanceFocus extends ItemBaseFocus {
|
||||
|
||||
private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 2500).add(Aspect.EARTH, 2500)
|
||||
.add(Aspect.ORDER, 2500);
|
||||
|
||||
public ItemMaintenanceFocus() {
|
||||
super("maintenance");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor(ItemStack stack) {
|
||||
return 0xC0C0C0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost(ItemStack focusstack) {
|
||||
return visCost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack) {
|
||||
return "MAINTENANCE";
|
||||
}
|
||||
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onFocusRightClick(ItemStack itemStack, World world, EntityPlayer player,
|
||||
MovingObjectPosition mop) {
|
||||
|
||||
ItemWandCasting wand = (ItemWandCasting) itemStack.getItem();
|
||||
|
||||
if (!world.isRemote) {
|
||||
if (!player.isSneaking()) {
|
||||
return itemStack;
|
||||
}
|
||||
TileEntity hatchCandidateTile = world.getTileEntity(mop.blockX, mop.blockY, mop.blockZ);
|
||||
if (hatchCandidateTile instanceof BaseMetaTileEntity) {
|
||||
IMetaTileEntity hatchCandidateMetaTile = ((BaseMetaTileEntity) hatchCandidateTile).getMetaTileEntity();
|
||||
if (hatchCandidateMetaTile instanceof GT_MetaTileEntity_Hatch_Maintenance) {
|
||||
GT_MetaTileEntity_Hatch_Maintenance hatch = (GT_MetaTileEntity_Hatch_Maintenance) hatchCandidateMetaTile;
|
||||
if (player.capabilities.isCreativeMode
|
||||
|| wand.consumeAllVis(itemStack, player, getVisCost(itemStack), true, true)) {
|
||||
hatch.mCrowbar = true;
|
||||
hatch.mScrewdriver = true;
|
||||
hatch.mHardHammer = true;
|
||||
hatch.mSolderingTool = true;
|
||||
hatch.mWrench = true;
|
||||
hatch.mSoftHammer = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
player.swingItem();
|
||||
return itemStack;
|
||||
}
|
||||
}
|
||||
@@ -107,6 +107,7 @@ public class EMTConfigHandler {
|
||||
public static boolean christmasFocusResearch;
|
||||
public static boolean energyBallFocusResearch;
|
||||
public static boolean shieldFocusResearch;
|
||||
public static boolean maintenanceFocusResearch;
|
||||
public static boolean shieldBlockResearch;
|
||||
public static boolean potentiaGeneratorResearch;
|
||||
public static boolean ignisGeneratorResearch;
|
||||
@@ -390,6 +391,8 @@ public class EMTConfigHandler {
|
||||
christmasFocusResearch = config.get(RESEARCH, "Kris-tmas Focus", false).getBoolean(christmasFocusResearch);
|
||||
energyBallFocusResearch = config.get(RESEARCH, "EnergyBall Focus", false).getBoolean(christmasFocusResearch);
|
||||
shieldFocusResearch = config.get(RESEARCH, "Shield Focus", false).getBoolean(shieldFocusResearch);
|
||||
maintenanceFocusResearch = config.get(RESEARCH, "Maintenance Focus", false)
|
||||
.getBoolean(maintenanceFocusResearch);
|
||||
shieldBlockResearch = config.get(RESEARCH, "Shield Block", false).getBoolean(shieldBlockResearch);
|
||||
potentiaGeneratorResearch = config.get(RESEARCH, "Potentia Generator", false)
|
||||
.getBoolean(potentiaGeneratorResearch);
|
||||
|
||||
@@ -83,6 +83,8 @@ public class EMTCraftingAspects {
|
||||
.add(Aspect.MECHANISM, 32);
|
||||
public static AspectList wandChargeFocus = new AspectList().add(Aspect.ENERGY, 48).add(Aspect.AURA, 32)
|
||||
.add(Aspect.EXCHANGE, 48).add(Aspect.GREED, 64);
|
||||
public static AspectList maintenanceFocus = new AspectList().add(Aspect.CRAFT, 32).add(Aspect.EXCHANGE, 48)
|
||||
.add(Aspect.TOOL, 64).add(Aspect.MAGIC, 64).add(Aspect.MECHANISM, 32).add(Aspect.ENERGY, 32);
|
||||
public static AspectList inventoryChargingRing = new AspectList().add(Aspect.ENERGY, 64).add(Aspect.CRYSTAL, 32)
|
||||
.add(Aspect.MAGIC, 48);
|
||||
public static AspectList armorChargingRing = new AspectList().add(Aspect.ENERGY, 64).add(Aspect.ARMOR, 32)
|
||||
|
||||
@@ -25,6 +25,8 @@ public class EMTResearchAspects {
|
||||
.add(Aspect.LIFE, 6);
|
||||
public static AspectList shieldFocusResearch = new AspectList().add(Aspect.ARMOR, 5).add(Aspect.AIR, 2)
|
||||
.add(Aspect.CRYSTAL, 3).add(Aspect.TRAP, 2);
|
||||
public static AspectList maintenanceFocus = new AspectList().add(Aspect.MECHANISM, 5).add(Aspect.FIRE, 3)
|
||||
.add(Aspect.ORDER, 3).add(Aspect.ENERGY, 5).add(Aspect.MAGIC, 5).add(Aspect.TOOL, 5);
|
||||
public static AspectList electricGogglesResearch = new AspectList().add(Aspect.ARMOR, 8).add(Aspect.ENERGY, 5)
|
||||
.add(Aspect.SENSES, 6);
|
||||
public static AspectList potentiaGeneratorResearch = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.EXCHANGE, 4)
|
||||
|
||||
Reference in new issue
Block a user