[ci skip] spotlessApply with the new settings

This commit is contained in:
Jason Mitchell committed 2023-01-29 22:45:03 -08:00
1 parent 382deb3610
commit aa5b4b89b8
12 files changed
+262 -278

No files matched your search

+1 -1
View File
@@ -8,5 +8,5 @@ dependencies {
compile("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
runtime("com.github.GTNewHorizons:Baubles:master-SNAPSHOT:dev")
runtimeOnly("com.github.GTNewHorizons:Baubles:master-SNAPSHOT:dev")
}
@@ -1,24 +1,31 @@
package shukaro.nodalmechanics;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.StatCollector;
import org.apache.logging.log4j.Logger;
import shukaro.nodalmechanics.gui.NodalTab;
import shukaro.nodalmechanics.items.NodalItems;
import shukaro.nodalmechanics.net.CommonProxy;
import shukaro.nodalmechanics.recipe.NodalRecipes;
import shukaro.nodalmechanics.research.NodalResearch;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
@Mod(modid = NodalMechanics.modID, name = NodalMechanics.modName, version = NodalMechanics.modVersion,
@Mod(
modid = NodalMechanics.modID,
name = NodalMechanics.modName,
version = NodalMechanics.modVersion,
dependencies = "required-after:Thaumcraft; required-after:ForbiddenMagic; required-after:TaintedMagic; required-after:AWWayofTime; required-after: IC2")
public class NodalMechanics
{
@SidedProxy(clientSide = "shukaro.nodalmechanics.net.ClientProxy", serverSide = "shukaro.nodalmechanics.net.CommonProxy")
public class NodalMechanics {
@SidedProxy(
clientSide = "shukaro.nodalmechanics.net.ClientProxy",
serverSide = "shukaro.nodalmechanics.net.CommonProxy")
public static CommonProxy proxy;
public static final String modID = "NodalMechanics";
@@ -33,23 +40,20 @@ public class NodalMechanics
public static NodalMechanics instance;
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent evt)
{
public void preInit(FMLPreInitializationEvent evt) {
logger = evt.getModLog();
NodalItems.initItems();
}
@Mod.EventHandler
public void init(FMLInitializationEvent evt)
{
public void init(FMLInitializationEvent evt) {
NodalRecipes recipes = new NodalRecipes();
recipes.initRecipes();
proxy.init();
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent evt)
{
public void postInit(FMLPostInitializationEvent evt) {
NodalResearch.initResearch();
}
}
@@ -2,18 +2,17 @@ package shukaro.nodalmechanics.gui;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import shukaro.nodalmechanics.items.NodalItems;
public class NodalTab extends CreativeTabs
{
public NodalTab(String label)
{
public class NodalTab extends CreativeTabs {
public NodalTab(String label) {
super(label);
}
@Override
public Item getTabIconItem()
{
public Item getTabIconItem() {
return NodalItems.itemMatrix;
}
}
@@ -1,9 +1,8 @@
package shukaro.nodalmechanics.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gnu.trove.map.TMap;
import gnu.trove.map.hash.THashMap;
import java.util.List;
import java.util.Locale;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@@ -11,51 +10,46 @@ import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import org.apache.commons.lang3.text.WordUtils;
import shukaro.nodalmechanics.NodalMechanics;
import shukaro.nodalmechanics.util.FormatCodes;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import java.util.Locale;
public class ItemMatrix extends Item {
public class ItemMatrix
extends Item
{
@SideOnly(Side.CLIENT)
private IIcon icon;
public ItemMatrix()
{
public ItemMatrix() {
super();
this.setHasSubtypes(true);
this.setCreativeTab(NodalMechanics.mainTab);
this.setUnlocalizedName("nodalmechanics.matrix");
this.setMaxStackSize(1);
}
@Override
public String getUnlocalizedName(ItemStack stack)
{
if (stack.hasTagCompound())
{
public String getUnlocalizedName(ItemStack stack) {
if (stack.hasTagCompound()) {
return this.getUnlocalizedName() + ".attuned";
}
else
{
} else {
return this.getUnlocalizedName() + ".unattuned";
}
}
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings("unchecked")
public void getSubItems(Item item, CreativeTabs creativeTab, List list)
{
public void getSubItems(Item item, CreativeTabs creativeTab, List list) {
list.add(new ItemStack(item, 1, 0));
for (Aspect aspect : Aspect.getPrimalAspects())
{
for (Aspect aspect : Aspect.getPrimalAspects()) {
ItemStack itemStack = new ItemStack(item, 1, 0);
AspectList aspectList = new AspectList().add(aspect, 8);
NBTTagCompound tagCompound = new NBTTagCompound();
@@ -64,55 +58,58 @@ public class ItemMatrix
list.add(itemStack);
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta)
{
public IIcon getIconFromDamage(int meta) {
return this.icon;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
public void registerIcons(IIconRegister iconRegister) {
this.icon = iconRegister.registerIcon(NodalMechanics.modID.toLowerCase(Locale.ENGLISH) + ":" + "itemMatrix");
}
@Override
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack itemStack)
{
public EnumRarity getRarity(ItemStack itemStack) {
return itemStack.hasTagCompound() ? EnumRarity.uncommon : EnumRarity.common;
}
@Override
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack itemStack, int pass)
{
public boolean hasEffect(ItemStack itemStack, int pass) {
return itemStack.hasTagCompound();
}
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings("unchecked")
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean advancedTooltips)
{
if (itemStack.hasTagCompound())
{
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean advancedTooltips) {
if (itemStack.hasTagCompound()) {
NBTTagCompound tagCompound = itemStack.getTagCompound();
AspectList aspectList = new AspectList();
aspectList.readFromNBT(tagCompound);
for (Aspect aspect : aspectList.getAspects())
{
list.add("\u00A7" + (aspect.getChatcolor() != null ? aspect.getChatcolor() : "7") +
WordUtils.capitalize(aspect.getName()) + FormatCodes.Reset.code + FormatCodes.White.code +
" x " + aspectList.getAmount(aspect));
for (Aspect aspect : aspectList.getAspects()) {
list.add(
"\u00A7" + (aspect.getChatcolor() != null ? aspect.getChatcolor() : "7")
+ WordUtils.capitalize(aspect.getName())
+ FormatCodes.Reset.code
+ FormatCodes.White.code
+ " x "
+ aspectList.getAmount(aspect));
}
list.add(FormatCodes.DarkGrey.code + FormatCodes.Italic.code +
StatCollector.translateToLocal("tooltip.nodalmechanics.matrix.attuned"));
list.add(
FormatCodes.DarkGrey.code + FormatCodes.Italic.code
+ StatCollector.translateToLocal("tooltip.nodalmechanics.matrix.attuned"));
} else {
list.add(
FormatCodes.DarkGrey.code + FormatCodes.Italic.code
+ StatCollector.translateToLocal("tooltip.nodalmechanics.matrix.unattuned"));
}
else
{
list.add(FormatCodes.DarkGrey.code + FormatCodes.Italic.code +
StatCollector.translateToLocal("tooltip.nodalmechanics.matrix.unattuned"));
}
list.add(FormatCodes.Grey.code + FormatCodes.Italic.code +
StatCollector.translateToLocal("tooltip.nodalmechanics.matrix.recipe"));
list.add(
FormatCodes.Grey.code + FormatCodes.Italic.code
+ StatCollector.translateToLocal("tooltip.nodalmechanics.matrix.recipe"));
}
}
@@ -2,12 +2,11 @@ package shukaro.nodalmechanics.items;
import cpw.mods.fml.common.registry.GameRegistry;
public class NodalItems
{
public class NodalItems {
public static ItemMatrix itemMatrix;
public static void initItems()
{
public static void initItems() {
itemMatrix = new ItemMatrix();
GameRegistry.registerItem(itemMatrix, itemMatrix.getUnlocalizedName());
}
@@ -1,9 +1,8 @@
package shukaro.nodalmechanics.net;
public class ClientProxy extends CommonProxy
{
public void init()
{
public class ClientProxy extends CommonProxy {
public void init() {
super.init();
}
}
@@ -1,9 +1,8 @@
package shukaro.nodalmechanics.net;
public class CommonProxy
{
public void init()
{
public class CommonProxy {
public void init() {
}
}
@@ -1,11 +1,11 @@
package shukaro.nodalmechanics.recipe;
import fox.spiteful.forbidden.DarkAspects;
import fox.spiteful.forbidden.items.ForbiddenItems;
import ic2.core.Ic2Items;
import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.oredict.OreDictionary;
import shukaro.nodalmechanics.items.NodalItems;
import thaumcraft.api.ItemApi;
import thaumcraft.api.ThaumcraftApi;
@@ -13,12 +13,12 @@ import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.crafting.InfusionRecipe;
import thaumcraft.api.crafting.ShapedArcaneRecipe;
import thaumcraft.common.Thaumcraft;
import fox.spiteful.forbidden.DarkAspects;
import fox.spiteful.forbidden.items.ForbiddenItems;
import ic2.core.Ic2Items;
import java.util.ArrayList;
public class NodalRecipes {
public class NodalRecipes
{
public static InfusionRecipe matrixRecipe;
public static ShapedArcaneRecipe variedAttuneRecipe;
public static ShapedArcaneRecipe sameAttuneRecipe;
@@ -27,33 +27,28 @@ public class NodalRecipes
private ItemStack lapotronCrystal;
private ArrayList<ItemStack> circuitAdvancedList;
private ItemStack balancedShard;
public NodalRecipes()
{
public NodalRecipes() {
lapotronCrystal = new ItemStack(Ic2Items.lapotronCrystal.getItem(), 1, OreDictionary.WILDCARD_VALUE);
circuitAdvancedList = OreDictionary.getOres("circuitAdvanced");
balancedShard = ItemApi.getItem("itemShard",6);
matrixRecipe = new InfusionRecipe("NODECATALYZATION", new ItemStack(NodalItems.itemMatrix), 10, new AspectList()
.add(DarkAspects.SLOTH, 16)
.add(DarkAspects.PRIDE, 16)
.add(Aspect.AURA, 32)
.add(Aspect.MAGIC,32) ,lapotronCrystal, new ItemStack[] {new ItemStack(ForbiddenItems.deadlyShards, 1, 3),
balancedShard,
new ItemStack(ForbiddenItems.deadlyShards, 1, 5),
balancedShard,
new ItemStack(ForbiddenItems.deadlyShards, 1, 5),
balancedShard});
AspectList attuneAspectList = new AspectList().add(Aspect.AIR, 2)
.add(Aspect.WATER, 2)
.add(Aspect.FIRE, 2)
.add(Aspect.ORDER, 2)
.add(Aspect.ENTROPY, 2)
.add(Aspect.EARTH, 2);
balancedShard = ItemApi.getItem("itemShard", 6);
matrixRecipe = new InfusionRecipe(
"NODECATALYZATION",
new ItemStack(NodalItems.itemMatrix),
10,
new AspectList().add(DarkAspects.SLOTH, 16).add(DarkAspects.PRIDE, 16).add(Aspect.AURA, 32)
.add(Aspect.MAGIC, 32),
lapotronCrystal,
new ItemStack[] { new ItemStack(ForbiddenItems.deadlyShards, 1, 3), balancedShard,
new ItemStack(ForbiddenItems.deadlyShards, 1, 5), balancedShard,
new ItemStack(ForbiddenItems.deadlyShards, 1, 5), balancedShard });
AspectList attuneAspectList = new AspectList().add(Aspect.AIR, 2).add(Aspect.WATER, 2).add(Aspect.FIRE, 2)
.add(Aspect.ORDER, 2).add(Aspect.ENTROPY, 2).add(Aspect.EARTH, 2);
ItemStack variedAttune = new ItemStack(NodalItems.itemMatrix);
ItemStack[] phials = new ItemStack[6];
ArrayList<Aspect> primalAspects = Aspect.getPrimalAspects();
AspectList variedAspectList = new AspectList();
for (int i = 0; i < primalAspects.size(); i++)
{
for (int i = 0; i < primalAspects.size(); i++) {
variedAspectList.add(primalAspects.get(i), 2);
phials[i] = ItemApi.getItem("itemEssence", 1);
NBTTagCompound tagCompound = new NBTTagCompound();
@@ -64,10 +59,27 @@ public class NodalRecipes
NBTTagCompound variedTagCompound = new NBTTagCompound();
variedAspectList.writeToNBT(variedTagCompound);
variedAttune.setTagCompound(variedTagCompound);
variedAttuneRecipe =
new ShapedArcaneRecipe("NODECATALYZATION", variedAttune, attuneAspectList, "ABC", " X ", "DEF", 'A',
phials[0], 'B', phials[1], 'C', phials[2], 'D', phials[3], 'E', phials[4], 'F',
phials[5], 'X', NodalItems.itemMatrix);
variedAttuneRecipe = new ShapedArcaneRecipe(
"NODECATALYZATION",
variedAttune,
attuneAspectList,
"ABC",
" X ",
"DEF",
'A',
phials[0],
'B',
phials[1],
'C',
phials[2],
'D',
phials[3],
'E',
phials[4],
'F',
phials[5],
'X',
NodalItems.itemMatrix);
ItemStack sameAttune = new ItemStack(NodalItems.itemMatrix);
AspectList sameAspectList = new AspectList().add(Aspect.FIRE, 16);
NBTTagCompound sameTagCompound = new NBTTagCompound();
@@ -78,60 +90,62 @@ public class NodalRecipes
NBTTagCompound phialTagCompound = new NBTTagCompound();
phialAspectList.writeToNBT(phialTagCompound);
phial.setTagCompound(phialTagCompound);
sameAttuneRecipe =
new ShapedArcaneRecipe("NODECATALYZATION", sameAttune, attuneAspectList, "AAA", "ABA", "AAA", 'A',
phial.copy(), 'B', NodalItems.itemMatrix);
sameAttuneRecipe = new ShapedArcaneRecipe(
"NODECATALYZATION",
sameAttune,
attuneAspectList,
"AAA",
"ABA",
"AAA",
'A',
phial.copy(),
'B',
NodalItems.itemMatrix);
NBTTagCompound variedNodeTagCompound = new NBTTagCompound();
AspectList variedNodeAspectList = new AspectList().add(Aspect.AIR, 2)
.add(Aspect.EARTH, 2)
.add(Aspect.FIRE, 2)
.add(Aspect.WATER, 2)
.add(Aspect.ORDER, 2)
.add(Aspect.ENTROPY, 2);
AspectList variedNodeAspectList = new AspectList().add(Aspect.AIR, 2).add(Aspect.EARTH, 2).add(Aspect.FIRE, 2)
.add(Aspect.WATER, 2).add(Aspect.ORDER, 2).add(Aspect.ENTROPY, 2);
variedNodeAspectList.writeToNBT(variedNodeTagCompound);
variedNodeTagCompound.setInteger("nodetype", 0);
ItemStack variedNode = ItemApi.getItem("itemJarNode", 0);
variedNode.setTagCompound(variedNodeTagCompound);
variedNodeRecipe = new InfusionRecipe("NODECATALYZATION", variedNode, 10, new AspectList().add(Aspect.AIR, 8)
.add(Aspect.EARTH, 8)
.add(Aspect.FIRE, 8)
.add(Aspect.WATER, 8)
.add(Aspect.ORDER, 8)
.add(Aspect.ENTROPY,
8), variedAttune,
new ItemStack[] {ItemApi.getItem("itemResource", 14),
ItemApi.getItem("itemResource", 14),
ItemApi.getItem("itemResource", 14),
ItemApi.getItem("itemResource", 14)});
variedNodeRecipe = new InfusionRecipe(
"NODECATALYZATION",
variedNode,
10,
new AspectList().add(Aspect.AIR, 8).add(Aspect.EARTH, 8).add(Aspect.FIRE, 8).add(Aspect.WATER, 8)
.add(Aspect.ORDER, 8).add(Aspect.ENTROPY, 8),
variedAttune,
new ItemStack[] { ItemApi.getItem("itemResource", 14), ItemApi.getItem("itemResource", 14),
ItemApi.getItem("itemResource", 14), ItemApi.getItem("itemResource", 14) });
NBTTagCompound sameNodeTagCompound = new NBTTagCompound();
AspectList sameNodeAspectList = new AspectList().add(Aspect.FIRE, 16);
sameNodeAspectList.writeToNBT(sameNodeTagCompound);
sameNodeTagCompound.setInteger("nodetype", 0);
ItemStack sameNode = ItemApi.getItem("itemJarNode", 0);
sameNode.setTagCompound(sameNodeTagCompound);
sameNodeRecipe =
new InfusionRecipe("NODECATALYZATION", sameNode, 10, new AspectList().add(Aspect.FIRE, 64), sameAttune,
new ItemStack[] {ItemApi.getItem("itemResource", 14),
ItemApi.getItem("itemResource", 14),
ItemApi.getItem("itemResource", 14),
ItemApi.getItem("itemResource", 14)});
sameNodeRecipe = new InfusionRecipe(
"NODECATALYZATION",
sameNode,
10,
new AspectList().add(Aspect.FIRE, 64),
sameAttune,
new ItemStack[] { ItemApi.getItem("itemResource", 14), ItemApi.getItem("itemResource", 14),
ItemApi.getItem("itemResource", 14), ItemApi.getItem("itemResource", 14) });
}
@SuppressWarnings("unchecked")
public void initRecipes()
{
for (ItemStack circuitAdvanced : circuitAdvancedList)
{
ThaumcraftApi.addInfusionCraftingRecipe("NODECATALYZATION", new ItemStack(NodalItems.itemMatrix), 10,
new AspectList()
.add(DarkAspects.SLOTH, 16)
.add(DarkAspects.PRIDE, 16)
.add(Aspect.AURA, 32)
.add(Aspect.MAGIC,32), lapotronCrystal, new ItemStack[] {new ItemStack(ForbiddenItems.deadlyShards, 1, 3),
balancedShard,
new ItemStack(ForbiddenItems.deadlyShards, 1, 5),
balancedShard,
new ItemStack(ForbiddenItems.deadlyShards, 1, 5),
balancedShard});
public void initRecipes() {
for (ItemStack circuitAdvanced : circuitAdvancedList) {
ThaumcraftApi.addInfusionCraftingRecipe(
"NODECATALYZATION",
new ItemStack(NodalItems.itemMatrix),
10,
new AspectList().add(DarkAspects.SLOTH, 16).add(DarkAspects.PRIDE, 16).add(Aspect.AURA, 32)
.add(Aspect.MAGIC, 32),
lapotronCrystal,
new ItemStack[] { new ItemStack(ForbiddenItems.deadlyShards, 1, 3), balancedShard,
new ItemStack(ForbiddenItems.deadlyShards, 1, 5), balancedShard,
new ItemStack(ForbiddenItems.deadlyShards, 1, 5), balancedShard });
}
RecipeAttune recipeAttune = new RecipeAttune();
ThaumcraftApi.getCraftingRecipes().add(recipeAttune);
@@ -6,6 +6,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import shukaro.nodalmechanics.items.NodalItems;
import thaumcraft.api.ItemApi;
import thaumcraft.api.ThaumcraftApiHelper;
@@ -13,68 +14,53 @@ import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.crafting.IArcaneRecipe;
public class RecipeAttune
implements IArcaneRecipe
{
public class RecipeAttune implements IArcaneRecipe {
private static final int ESSENTIA_MULTIPLIER = 4;
private ItemStack output;
@Override
public boolean matches(IInventory inventory, World world, EntityPlayer player)
{
if (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), getResearch()))
{
public boolean matches(IInventory inventory, World world, EntityPlayer player) {
if (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), getResearch())) {
return false;
}
ItemStack matrix = null;
ItemStack targetMatrix = new ItemStack(NodalItems.itemMatrix);
ItemStack phial = ItemApi.getItem("itemEssence", 1);
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
ItemStack slotStack = ThaumcraftApiHelper.getStackInRowAndColumn(inventory, i, j);
if (OreDictionary.itemMatches(targetMatrix, slotStack, true))
{
if (matrix != null)
{
if (OreDictionary.itemMatches(targetMatrix, slotStack, true)) {
if (matrix != null) {
return false;
}
matrix = slotStack;
}
}
}
if (matrix == null)
{
if (matrix == null) {
return false;
}
AspectList aspectList = new AspectList();
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
ItemStack slotStack = ThaumcraftApiHelper.getStackInRowAndColumn(inventory, i, j);
if (slotStack == null || slotStack.getItem() == null)
{
if (slotStack == null || slotStack.getItem() == null) {
continue;
}
if (OreDictionary.itemMatches(matrix, slotStack, true))
{
if (OreDictionary.itemMatches(matrix, slotStack, true)) {
continue;
}
if (OreDictionary.itemMatches(phial, slotStack, true))
{
if (!slotStack.hasTagCompound())
{
if (OreDictionary.itemMatches(phial, slotStack, true)) {
if (!slotStack.hasTagCompound()) {
return false;
}
AspectList phialAspectList = new AspectList();
phialAspectList.readFromNBT(slotStack.getTagCompound());
if (phialAspectList.size() == 0)
{
if (phialAspectList.size() == 0) {
return false;
}
for (Aspect aspect : phialAspectList.getAspects())
{
for (Aspect aspect : phialAspectList.getAspects()) {
aspectList.add(aspect, phialAspectList.getAmount(aspect) / ESSENTIA_MULTIPLIER);
}
continue;
@@ -82,8 +68,7 @@ public class RecipeAttune
return false;
}
}
if (aspectList.size() > 0)
{
if (aspectList.size() > 0) {
output = matrix.copy();
NBTTagCompound tagCompound = output.hasTagCompound() ? output.getTagCompound() : new NBTTagCompound();
AspectList initialAspectList = new AspectList();
@@ -95,39 +80,35 @@ public class RecipeAttune
}
return false;
}
@Override
public ItemStack getCraftingResult(IInventory inventory)
{
public ItemStack getCraftingResult(IInventory inventory) {
return output.copy();
}
@Override
public int getRecipeSize()
{
public int getRecipeSize() {
return 9;
}
@Override
public ItemStack getRecipeOutput()
{
public ItemStack getRecipeOutput() {
return output;
}
@Override
public AspectList getAspects()
{
return new AspectList().add(Aspect.AIR, 2)
.add(Aspect.WATER, 2)
.add(Aspect.FIRE, 2)
.add(Aspect.ORDER, 2)
.add(Aspect.ENTROPY, 2)
.add(Aspect.EARTH, 2);
public AspectList getAspects() {
return new AspectList().add(Aspect.AIR, 2).add(Aspect.WATER, 2).add(Aspect.FIRE, 2).add(Aspect.ORDER, 2)
.add(Aspect.ENTROPY, 2).add(Aspect.EARTH, 2);
}
@Override
public AspectList getAspects(IInventory inventory)
{
public AspectList getAspects(IInventory inventory) {
return getAspects();
}
@Override
public String getResearch()
{
public String getResearch() {
return "NODECATALYZATION";
}
}
@@ -1,10 +1,14 @@
package shukaro.nodalmechanics.recipe;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import shukaro.nodalmechanics.items.NodalItems;
import thaumcraft.api.ItemApi;
import thaumcraft.api.ThaumcraftApiHelper;
@@ -14,63 +18,54 @@ import thaumcraft.api.crafting.InfusionRecipe;
import thaumcraft.api.nodes.NodeModifier;
import thaumcraft.api.nodes.NodeType;
import java.util.ArrayList;
import java.util.Random;
public class RecipeNode extends InfusionRecipe {
public class RecipeNode
extends InfusionRecipe
{
private static final int ESSENTIA_MULTIPLIER = 4;
private static final int INSTABILITY = 10;
private final Random random;
public RecipeNode()
{
super("NODECATALYZATION", ItemApi.getItem("itemJarNode", 0), INSTABILITY, new AspectList(),
new ItemStack(NodalItems.itemMatrix),
new ItemStack[] {ItemApi.getItem("itemResource", 14), ItemApi.getItem("itemResource", 14),
ItemApi.getItem("itemResource", 14), ItemApi.getItem("itemResource", 14)});
public RecipeNode() {
super(
"NODECATALYZATION",
ItemApi.getItem("itemJarNode", 0),
INSTABILITY,
new AspectList(),
new ItemStack(NodalItems.itemMatrix),
new ItemStack[] { ItemApi.getItem("itemResource", 14), ItemApi.getItem("itemResource", 14),
ItemApi.getItem("itemResource", 14), ItemApi.getItem("itemResource", 14) });
random = new Random();
}
@Override
public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player)
{
if (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), getResearch()))
{
public boolean matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) {
if (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), getResearch())) {
return false;
}
ItemStack[] components = getComponents();
if (input == null || input.size() != components.length)
{
if (input == null || input.size() != components.length) {
return false;
}
for (int i = 0; i < components.length; i++)
{
if (!OreDictionary.itemMatches(components[i], input.get(i), true))
{
for (int i = 0; i < components.length; i++) {
if (!OreDictionary.itemMatches(components[i], input.get(i), true)) {
return false;
}
}
if (central != null && central.getItem().equals(NodalItems.itemMatrix))
{
if (central.hasTagCompound())
{
if (central != null && central.getItem().equals(NodalItems.itemMatrix)) {
if (central.hasTagCompound()) {
AspectList nodeAspectList = new AspectList();
nodeAspectList.readFromNBT(central.getTagCompound());
if (nodeAspectList.size() == 0)
{
if (nodeAspectList.size() == 0) {
return false;
}
AspectList recipeAspectList = new AspectList();
for (Aspect aspect : nodeAspectList.getAspects())
{
for (Aspect aspect : nodeAspectList.getAspects()) {
recipeAspectList.add(aspect, nodeAspectList.getAmount(aspect) * ESSENTIA_MULTIPLIER);
}
this.aspects = recipeAspectList;
NBTTagCompound tagCompound = new NBTTagCompound();
nodeAspectList.writeToNBT(tagCompound);
tagCompound.setInteger("nodetype", getNodeType());
if (random.nextInt(100) < 75)
{
if (random.nextInt(100) < 75) {
tagCompound.setInteger("nodemod", getNodeModifier());
}
((ItemStack) this.recipeOutput).setTagCompound(tagCompound);
@@ -79,40 +74,33 @@ public class RecipeNode
}
return false;
}
private int getNodeType()
{
private int getNodeType() {
int chance = random.nextInt(100);
if (chance < 75)
{
if (chance < 75) {
return NodeType.NORMAL.ordinal();
}
if (chance < 80)
{
if (chance < 80) {
return NodeType.UNSTABLE.ordinal();
}
if (chance < 85)
{
if (chance < 85) {
return NodeType.DARK.ordinal();
}
if (chance < 90)
{
if (chance < 90) {
return NodeType.TAINTED.ordinal();
}
if (chance < 95)
{
if (chance < 95) {
return NodeType.HUNGRY.ordinal();
}
return NodeType.PURE.ordinal();
}
private int getNodeModifier()
{
private int getNodeModifier() {
int chance = random.nextInt(100);
if (chance < 75)
{
if (chance < 75) {
return NodeModifier.FADING.ordinal();
}
if (chance < 90)
{
if (chance < 90) {
return NodeModifier.PALE.ordinal();
}
return NodeModifier.BRIGHT.ordinal();
@@ -2,6 +2,7 @@ package shukaro.nodalmechanics.research;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import shukaro.nodalmechanics.items.NodalItems;
import shukaro.nodalmechanics.recipe.NodalRecipes;
import thaumcraft.api.ThaumcraftApi;
@@ -10,23 +11,27 @@ import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchItem;
import thaumcraft.api.research.ResearchPage;
public class NodalResearch
{
public class NodalResearch {
private static ResearchItem researchNodeCatalyzation;
public static void initResearch()
{
researchNodeCatalyzation = new ResearchItem("NODECATALYZATION", "BASICS",
new AspectList().add(Aspect.AURA, 20)
.add(Aspect.VOID, 15)
.add(Aspect.GREED, 12)
.add(Aspect.ELDRITCH, 9)
.add(Aspect.MIND, 6)
.add(Aspect.MAGIC, 3),
-5, 4, 3, new ItemStack(NodalItems.itemMatrix)).setPages(
new ResearchPage(StatCollector.translateToLocal("nodalmechanics.nodecatalyzation.research")),
new ResearchPage(NodalRecipes.matrixRecipe), new ResearchPage(NodalRecipes.variedAttuneRecipe),
new ResearchPage(NodalRecipes.sameAttuneRecipe), new ResearchPage(NodalRecipes.variedNodeRecipe),
new ResearchPage(NodalRecipes.sameNodeRecipe)).setParents("NODEJAR", "NODETAPPER2").setParentsHidden("JARLABEL").setSpecial();
public static void initResearch() {
researchNodeCatalyzation = new ResearchItem(
"NODECATALYZATION",
"BASICS",
new AspectList().add(Aspect.AURA, 20).add(Aspect.VOID, 15).add(Aspect.GREED, 12).add(Aspect.ELDRITCH, 9)
.add(Aspect.MIND, 6).add(Aspect.MAGIC, 3),
-5,
4,
3,
new ItemStack(NodalItems.itemMatrix)).setPages(
new ResearchPage(StatCollector.translateToLocal("nodalmechanics.nodecatalyzation.research")),
new ResearchPage(NodalRecipes.matrixRecipe),
new ResearchPage(NodalRecipes.variedAttuneRecipe),
new ResearchPage(NodalRecipes.sameAttuneRecipe),
new ResearchPage(NodalRecipes.variedNodeRecipe),
new ResearchPage(NodalRecipes.sameNodeRecipe)).setParents("NODEJAR", "NODETAPPER2")
.setParentsHidden("JARLABEL").setSpecial();
researchNodeCatalyzation.registerResearchItem();
ThaumcraftApi.addWarpToResearch("NODECATALYZATION", 8);
ThaumcraftApi.addWarpToItem(new ItemStack(NodalItems.itemMatrix), 8);
@@ -5,8 +5,8 @@ package shukaro.nodalmechanics.util;
*
* @author MachineMuse
*/
public enum FormatCodes
{
public enum FormatCodes {
Black("\u00A70"),
DarkBlue("\u00A71"),
DarkGreen("\u00A72"),
@@ -32,8 +32,7 @@ public enum FormatCodes
public String code;
private FormatCodes(String s)
{
private FormatCodes(String s) {
this.code = s;
}
}