Shift-Right click on non-block to clear freq. transmitter and advanced drill/chainsaw recipes.

This commit is contained in:
Prospector 2016-05-15 21:24:35 -07:00
parent 58037e3c9c
commit 3cf950d491
6 changed files with 63 additions and 52 deletions

View file

@ -13,6 +13,7 @@ import org.apache.commons.lang3.ArrayUtils;
import reborncore.api.recipe.RecipeHandler; import reborncore.api.recipe.RecipeHandler;
import reborncore.common.util.CraftingHelper; import reborncore.common.util.CraftingHelper;
import reborncore.common.util.OreUtil; import reborncore.common.util.OreUtil;
import reborncore.common.util.StringUtils;
import techreborn.Core; import techreborn.Core;
import techreborn.api.ScrapboxList; import techreborn.api.ScrapboxList;
import techreborn.api.TechRebornAPI; import techreborn.api.TechRebornAPI;
@ -40,6 +41,18 @@ public class ModRecipes
public static ItemStack dyes = new ItemStack(Items.DYE, 1, OreDictionary.WILDCARD_VALUE); public static ItemStack dyes = new ItemStack(Items.DYE, 1, OreDictionary.WILDCARD_VALUE);
public static Item hammer = ModItems.hammer; public static Item hammer = ModItems.hammer;
public static Item ironDrill = TechRebornAPI.recipeCompact.getItem("miningDrill").getItem();
public static ItemStack ironDrillStack = new ItemStack(ironDrill, 1, OreDictionary.WILDCARD_VALUE);
public static Item diamondDrill = ModItems.diamondDrill;
public static ItemStack diamondDrillStack = new ItemStack(diamondDrill, 1, OreDictionary.WILDCARD_VALUE);
public static Item ironChainsaw = ModItems.ironChainsaw;
public static ItemStack ironChainsawStack = new ItemStack(ironChainsaw, 1, OreDictionary.WILDCARD_VALUE);
public static Item diamondChainsaw = ModItems.diamondChainsaw;
public static ItemStack diamondChainsawStack = new ItemStack(diamondChainsaw, 1, OreDictionary.WILDCARD_VALUE);
public static void init() public static void init()
{ {
addShapelessRecipes(); addShapelessRecipes();
@ -746,7 +759,7 @@ public class ModRecipes
{ {
CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName(part), " O ", "OIO", " O ", 'I', CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName(part), " O ", "OIO", " O ", 'I',
new ItemStack(Items.IRON_INGOT), 'O', new ItemStack(Items.IRON_INGOT), 'O',
"ingot" + capitalizeFirstLetter(part.replace("Gear", ""))); "ingot" + StringUtils.toFirstCapital(part.replace("Gear", "")));
} }
} }
@ -851,14 +864,14 @@ public class ModRecipes
'C', ItemParts.getPartByName("CoolantSimple"), 'S', ItemCells.getCellByName("sodium"), 'P', 'C', ItemParts.getPartByName("CoolantSimple"), 'S', ItemCells.getCellByName("sodium"), 'P',
ItemCells.getCellByName("potassium")); ItemCells.getCellByName("potassium"));
Core.logHelper.info("Shapped Recipes Added"); CraftingHelper
} .addShapedOreRecipe(new ItemStack(ModItems.advancedDrill), "ODO", "AOA", 'O', ItemUpgrades.getUpgradeByName("Overclock"),
'D', diamondDrillStack, 'A', "circuitAdvanced");
CraftingHelper
.addShapedOreRecipe(new ItemStack(ModItems.advancedChainsaw), "ODO", "AOA", 'O', ItemUpgrades.getUpgradeByName("Overclock"),
'D', diamondChainsawStack, 'A', "circuitAdvanced");
public static String capitalizeFirstLetter(String original) Core.logHelper.info("Shapped Recipes Added");
{
if (original.length() == 0)
return original;
return original.substring(0, 1).toUpperCase() + original.substring(1);
} }
static void addShapelessRecipes() static void addShapelessRecipes()
@ -1157,8 +1170,8 @@ public class ModRecipes
if (OreUtil.hasBlock(ore) && OreUtil.hasPlate(ore)) if (OreUtil.hasBlock(ore) && OreUtil.hasPlate(ore))
{ {
RecipeHandler.addRecipe( RecipeHandler.addRecipe(
new PlateCuttingMachineRecipe(OreUtil.getStackFromName("block" + capitalizeFirstLetter(ore)), new PlateCuttingMachineRecipe(OreUtil.getStackFromName("block" + StringUtils.toFirstCapital(ore)),
OreUtil.getStackFromName("plate" + capitalizeFirstLetter(ore), 9), 200, 16)); OreUtil.getStackFromName("plate" + StringUtils.toFirstCapital(ore), 9), 200, 16));
} }
} }
@ -1487,17 +1500,17 @@ public class ModRecipes
if (OreUtil.hasIngot(ore) && OreUtil.hasDustSmall(ore) && OreUtil.hasBlock(ore)) if (OreUtil.hasIngot(ore) && OreUtil.hasDustSmall(ore) && OreUtil.hasBlock(ore))
{ {
RecipeHandler.addRecipe( RecipeHandler.addRecipe(
new IndustrialGrinderRecipe(OreUtil.getStackFromName("block" + capitalizeFirstLetter(ore)), new IndustrialGrinderRecipe(OreUtil.getStackFromName("block" + StringUtils.toFirstCapital(ore)),
null, new FluidStack(FluidRegistry.WATER, 1000), null, new FluidStack(FluidRegistry.WATER, 1000),
OreUtil.getStackFromName("ingot" + capitalizeFirstLetter(ore)), OreUtil.getStackFromName("ingot" + StringUtils.toFirstCapital(ore)),
OreUtil.getStackFromName("dustSmall" + capitalizeFirstLetter(ore), 6), OreUtil.getStackFromName("dustSmall" + StringUtils.toFirstCapital(ore), 6),
OreUtil.getStackFromName("dustSmall" + capitalizeFirstLetter(ore), 2), null, 100, 120)); OreUtil.getStackFromName("dustSmall" + StringUtils.toFirstCapital(ore), 2), null, 100, 120));
RecipeHandler.addRecipe( RecipeHandler.addRecipe(
new IndustrialGrinderRecipe(OreUtil.getStackFromName("block" + capitalizeFirstLetter(ore)), new IndustrialGrinderRecipe(OreUtil.getStackFromName("block" + StringUtils.toFirstCapital(ore)),
new ItemStack(Items.WATER_BUCKET), null, new ItemStack(Items.WATER_BUCKET), null,
OreUtil.getStackFromName("ingot" + capitalizeFirstLetter(ore)), OreUtil.getStackFromName("ingot" + StringUtils.toFirstCapital(ore)),
OreUtil.getStackFromName("dustSmall" + capitalizeFirstLetter(ore), 6), OreUtil.getStackFromName("dustSmall" + StringUtils.toFirstCapital(ore), 6),
OreUtil.getStackFromName("dustSmall" + capitalizeFirstLetter(ore), 2), OreUtil.getStackFromName("dustSmall" + StringUtils.toFirstCapital(ore), 2),
new ItemStack(Items.BUCKET), 100, 120)); new ItemStack(Items.BUCKET), 100, 120));
} }
} }
@ -3319,7 +3332,7 @@ public class ModRecipes
if (ConfigTechReborn.ExpensiveDiamondDrill) if (ConfigTechReborn.ExpensiveDiamondDrill)
CraftingHelper CraftingHelper
.addShapedOreRecipe(TechRebornAPI.recipeCompact.getItem("diamondDrill"), " D ", "DBD", "TCT", 'D', .addShapedOreRecipe(TechRebornAPI.recipeCompact.getItem("diamondDrill"), " D ", "DBD", "TCT", 'D',
"gemDiamond", 'T', "ingotTitanium", 'B', drillStack, 'C', "diamondTR", 'T', "ingotTitanium", 'B', drillStack, 'C',
TechRebornAPI.recipeCompact.getItem("advancedCircuit")); TechRebornAPI.recipeCompact.getItem("advancedCircuit"));
if (ConfigTechReborn.ExpensiveSolar) if (ConfigTechReborn.ExpensiveSolar)

View file

@ -4,6 +4,7 @@ import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
@ -50,11 +51,29 @@ public class ItemFrequencyTransmitter extends ItemTextureBase implements ITextur
TextFormatting.GRAY + " Z: " + TextFormatting.GRAY + " Z: " +
TextFormatting.GOLD + pos.getZ() + TextFormatting.GOLD + pos.getZ() +
TextFormatting.GRAY + " " + I18n.translateToLocal("techreborn.message.in") + " " + TextFormatting.GRAY + " " + I18n.translateToLocal("techreborn.message.in") + " " +
TextFormatting.GOLD + DimensionManager.getProviderType(world.provider.getDimension()).getName() + " ("+world.provider.getDimension()+")")); TextFormatting.GOLD + DimensionManager.getProviderType(world.provider.getDimension())
.getName() + " (" + world.provider.getDimension() + ")"));
} }
return EnumActionResult.SUCCESS; return EnumActionResult.SUCCESS;
} }
@Override public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player,
EnumHand hand)
{
if (player.isSneaking())
{
stack.setTagCompound(null);
if (!world.isRemote && ConfigTechReborn.FreqTransmitterChat)
{
ChatUtils.sendNoSpamClient(new TextComponentString(
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.coordsHaveBeen") + " "
+ TextFormatting.GOLD + I18n.translateToLocal("techreborn.message.cleared")));
}
}
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
}
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{ {
if (ConfigTechReborn.FreqTransmitterTooltip) if (ConfigTechReborn.FreqTransmitterTooltip)
@ -73,7 +92,7 @@ public class ItemFrequencyTransmitter extends ItemTextureBase implements ITextur
} else } else
{ {
list.add(TextFormatting.GRAY + "No Coordinates Set"); list.add(TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.noCoordsSet"));
} }
} }
} }

View file

@ -1,8 +1,5 @@
package techreborn.items; package techreborn.items;
import java.security.InvalidParameterException;
import java.util.List;
import me.modmuss50.jsonDestroyer.api.ITexturedItem; import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -10,9 +7,12 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import reborncore.common.recipes.RecipeCrafter; import reborncore.common.recipes.RecipeCrafter;
import techreborn.utils.upgrade.IMachineUpgrade;
import techreborn.client.TechRebornCreativeTabMisc; import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModItems; import techreborn.init.ModItems;
import techreborn.utils.upgrade.IMachineUpgrade;
import java.security.InvalidParameterException;
import java.util.List;
public class ItemUpgrades extends ItemTextureBase implements IMachineUpgrade, ITexturedItem public class ItemUpgrades extends ItemTextureBase implements IMachineUpgrade, ITexturedItem
{ {
@ -93,6 +93,8 @@ public class ItemUpgrades extends ItemTextureBase implements IMachineUpgrade, IT
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
{ {
tooltip.add(TextFormatting.RED + "WIP Coming Soon"); tooltip.add(TextFormatting.RED + "WIP Coming Soon");
tooltip.add(TextFormatting.RED + "Upgrades DO NOT function!");
tooltip.add(TextFormatting.RED + "Currently only a crafting ingredient");
} }
@Override @Override

View file

@ -1,15 +1,8 @@
package techreborn.items.tools; package techreborn.items.tools;
import java.util.List;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import net.minecraft.item.Item.ToolMaterial;
public class ItemAdvancedChainsaw extends ItemChainsaw public class ItemAdvancedChainsaw extends ItemChainsaw
{ {
@ -37,10 +30,4 @@ public class ItemAdvancedChainsaw extends ItemChainsaw
{ {
return 1; return 1;
} }
@Override
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
{
tooltip.add(TextFormatting.RED + "WIP Coming Soon");
}
} }

View file

@ -1,15 +1,8 @@
package techreborn.items.tools; package techreborn.items.tools;
import java.util.List;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import net.minecraft.item.Item.ToolMaterial;
public class ItemAdvancedDrill extends ItemDrill public class ItemAdvancedDrill extends ItemDrill
{ {
@ -37,10 +30,4 @@ public class ItemAdvancedDrill extends ItemDrill
{ {
return 1; return 1;
} }
@Override
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
{
tooltip.add(TextFormatting.RED + "WIP Coming Soon");
}
} }

View file

@ -983,6 +983,9 @@ techreborn.recipe.implosioncompressor=Implosion Compressor
techreborn.message.missingmultiblock=Incomplete Multiblock techreborn.message.missingmultiblock=Incomplete Multiblock
techreborn.message.setTo=Set to techreborn.message.setTo=Set to
techreborn.message.in=in techreborn.message.in=in
techreborn.message.noCoordsSet=No Coordinates Set
techreborn.message.coordsHaveBeen=Coordinates have been
techreborn.message.cleared=Cleared
#Cables #Cables
Cable.copperCable.name=Copper Cable Cable.copperCable.name=Copper Cable