Compare commits

..
3 Commits
Author SHA1 Message Date
Dakota Jones 78b68dec47 Fix maintenance focus NPE (#63) 2023-07-04 03:57:15 -07:00
Martin Robertz 5053be782b update bs 2023-05-06 08:40:47 +02:00
Ryan Nasers c5a72c0dff 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.
2023-05-06 08:38:34 +02:00
10 changed files with 135 additions and 1 deletions

No files matched your search

+17 -1
View File
@@ -1,4 +1,4 @@
//version: 1682616243
//version: 1683056771
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -71,6 +71,9 @@ plugins {
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.7'
}
print("You might want to check out './gradlew :faq' if your build fails.")
boolean settingsupdated = verifySettingsGradle()
settingsupdated = verifyGitAttributes() || settingsupdated
if (settingsupdated)
@@ -1252,6 +1255,19 @@ if (!project.getGradle().startParameter.isOffline() && !Boolean.getBoolean('DISA
}
}
// If you want to add more cases to this task, implement them as arguments if total amount to print gets too large
tasks.register('faq') {
group = 'GTNH Buildscript'
description = 'Prints frequently asked questions about building a project'
doLast {
print("If your build fails to fetch dependencies, they might have been deleted and replaced by newer " +
"versions.\nCheck if the versions you try to fetch are still on the distributing sites.\n" +
"The links can be found in repositories.gradle and build.gradle:repositories, " +
"not build.gradle:buildscript.repositories - this one is for gradle plugin metadata.")
}
}
static URL availableBuildScriptUrl() {
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/build.gradle")
}
+4
View File
@@ -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");
}
}
+14
View File
@@ -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),
+11
View File
@@ -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,77 @@
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 gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.wands.FocusUpgradeType;
import thaumcraft.common.items.wands.ItemWandCasting;
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) {
if (mop == null) return itemStack;
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)
@@ -106,6 +106,7 @@ item.EMT.focus.christmas.name=Wand Focus: Kris-tmas
item.EMT.focus.shield.name=Wand Focus: Shield
item.EMT.focus.charge.name=Wand Focus: Charging
item.EMT.focus.chargeWand.name=Wand Focus: Wand Charging
item.EMT.focus.maintenance.name=Wand Focus: Maintenance
item.EMT.focus.electricCloud.name=Electric Cloud
item.EMT.focus.energyBall.name=Energy Ball Focus
@@ -251,6 +252,10 @@ emt.rsname.Shield Focus=Shield Focus
emt.tag.Shield Focus=S.H.I.E.L.D.
emt.text.Shield Focus=With some experimentation with the Portable Hole, you have found out more about the transportation of objects to alternate dimensions. You believe you can reverse these effects to summon a swath of blocks from a dimension full of matter to shield you from any oncoming disaster. Caution is to be taken when using this focus, as when bringing these blocks into our dimension, it will transpose any blocks in the way into the dimension it came from, never to return again. You will also be unable to move while this shield is in existence.
emt.rsname.Wand Focus: Maintenance=Thaumic Maintenance
emt.tag.Wand Focus: Maintenance=Who needs a toolbox when you have magic?
emt.text.Wand Focus: Maintenance=After intense study of the supposedly mechanical nature of your apparati, you've finally done it, you've discovered a method allowing the use of vis in repair. <BR> What are a few exploded cleanrooms in the face of sheer progress? Now you can get rid of those dastardly mundane tools...
emt.rsname.Potentia Generator=Potentia Generator
emt.tag.Potentia Generator=Harnessing the power-producing potential of Essentia
emt.text.Potentia Generator=After much studying and research, you have finally discovered how to create electricity from your leftover Essentia.<BR><BR>Simply place a Warded Jar containing Potentia in a 8 blocks radius of the machine and it will draw it in to create EU.<BR><BR>While Potentia seems like the most logical choice for producing Essentia with EU, you believe you will be able to generate electricity from different Essentia in the near future with a bit of tinkering.
Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B