Skip to content

Commit

Permalink
5.1.4 additions, fixes and changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Azanor committed Jan 20, 2016
1 parent 6da18ea commit 053f9c0
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 10 deletions.
3 changes: 3 additions & 0 deletions ThaumcraftApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.nbt.NBTTagInt;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectHelper;
Expand Down Expand Up @@ -189,6 +190,7 @@ public static ShapelessArcaneRecipe addShapelessArcaneCraftingRecipe(String[] re
/**
* @param research the research key required for this recipe to work. Leave blank if it will work without research
* @param result the recipe output. It can either be an itemstack or an nbt compound tag that will be added to the central item
* If nbt it needs to be in the format Object[] {"nbttagname", NBT Tag Object} eg. new Object[] { "mask", new NBTTagInt(1) }
* @param instability a number that represents the N in 1000 chance for the infusion altar to spawn an
* instability effect each second while the crafting is in progress
* @param aspects the essentia cost per aspect.
Expand All @@ -208,6 +210,7 @@ public static InfusionRecipe addInfusionCraftingRecipe(String research,
/**
* @param research the research keys required for this recipe to work. Leave blank if it will work without research
* @param result the recipe output. It can either be an itemstack or an nbt compound tag that will be added to the central item
* If nbt it needs to be in the format Object[] {"nbttagname", NBT Tag Object} eg. new Object[] { "mask", new NBTTagInt(1) }
* @param instability a number that represents the N in 1000 chance for the infusion altar to spawn an
* instability effect each second while the crafting is in progress
* @param aspects the essentia cost per aspect.
Expand Down
2 changes: 2 additions & 0 deletions ThaumcraftApiHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public static boolean areItemStacksEqualForCrafting(ItemStack stack0, Object in)
if (stack0!=null && in==null) return false;
if (stack0==null && in==null) return true;

if (in instanceof Object[]) return true;

if (in instanceof String) {
List<ItemStack> l = OreDictionary.getOres((String) in);
return containsMatch(false, new ItemStack[]{stack0}, l);
Expand Down
5 changes: 2 additions & 3 deletions aspects/AspectList.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ public int visSize() {
* @return an array of all the aspects in this collection
*/
public Aspect[] getAspects() {
Aspect[] q = new Aspect[1];
return aspects.keySet().toArray(q);
return aspects.keySet().toArray(new Aspect[]{});
}


Expand Down Expand Up @@ -96,7 +95,7 @@ public Aspect[] getAspectsSortedByName() {
*/
public Aspect[] getAspectsSortedByAmount() {
try {
Aspect[] out = aspects.keySet().toArray(new Aspect[1]);
Aspect[] out = aspects.keySet().toArray(new Aspect[]{});
boolean change=false;
do {
change=false;
Expand Down
2 changes: 1 addition & 1 deletion golems/IGolemAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ public interface IGolemAPI {
*/
public void swingArm();


public boolean isInCombat();

}
11 changes: 10 additions & 1 deletion golems/ProvisionRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,16 @@ else if (!(p_equals_1_ instanceof ProvisionRequest))
else
{
ProvisionRequest pr = (ProvisionRequest)p_equals_1_;
return !this.seal.getSealPos().equals(pr.getSeal().getSealPos()) ? false : this.stack.getIsItemStackEqual(pr.getStack());
return !this.seal.getSealPos().equals(pr.getSeal().getSealPos()) ? false : isItemStackEqual(this.stack, pr.getStack());
}
}

private boolean isItemStackEqual(ItemStack first, ItemStack other)
{
return first.stackSize != other.stackSize ? false :
(first.getItem() != other.getItem() ? false :
(first.getItemDamage() != other.getItemDamage() ? false :
(first.getTagCompound() == null && other.getTagCompound() != null ? false :
first.getTagCompound() == null || first.getTagCompound().equals(other.getTagCompound()))));
}
}
27 changes: 27 additions & 0 deletions golems/parts/PartModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,33 @@ public void preRenderObjectPart(String partName, IGolemAPI golem, float partialT
public void postRenderObjectPart(String partName, IGolemAPI golem, float partialTicks, EnumLimbSide side) {

}

/**
* This method will be called just before arms are rendered to calculate the base rotation for the entire group of parts.
* @param partName the obj model part name
* @param inputRot is the base default calculated rotation for this group of parts. Return it as-is if you do not wish to alter it.
*/
public float preRenderArmRotationX(IGolemAPI golem, float partialTicks, EnumLimbSide side, float inputRot) {
return inputRot;
}

/**
* This method will be called just before arms are rendered to calculate the base rotation for the entire group of parts.
* @param partName the obj model part name
* @param inputRot is the base default calculated rotation for this group of parts. Return it as-is if you do not wish to alter it.
*/
public float preRenderArmRotationY(IGolemAPI golem, float partialTicks, EnumLimbSide side, float inputRot) {
return inputRot;
}

/**
* This method will be called just before arms are rendered to calculate the base rotation for the entire group of parts.
* @param partName the obj model part name
* @param inputRot is the base default calculated rotation for this group of parts. Return it as-is if you do not wish to alter it.
*/
public float preRenderArmRotationZ(IGolemAPI golem, float partialTicks, EnumLimbSide side, float inputRot) {
return inputRot;
}

public enum EnumLimbSide {
LEFT,RIGHT,MIDDLE;
Expand Down
6 changes: 3 additions & 3 deletions golems/tasks/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class Task {
private boolean completed;
private int data;
/**
* Lifespan in seconds. Default 120 seconds
* Lifespan in seconds. Default 300 seconds
*/
private short lifespan;
private byte priority=0;
Expand Down Expand Up @@ -65,7 +65,7 @@ public boolean isCompleted() {

public void setCompletion(boolean fulfilled) {
this.completed = fulfilled;
this.lifespan += 60;
this.lifespan += 120;
}

public UUID getGolemUUID() {
Expand Down Expand Up @@ -98,7 +98,7 @@ public boolean isReserved() {

public void setReserved(boolean res) {
this.reserved = res;
this.lifespan += 60;
this.lifespan += 120;
}

public boolean isSuspended() {
Expand Down
2 changes: 1 addition & 1 deletion items/IArchitect.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public interface IArchitect {

/**
* Returns a list of blocks that should be highlighted in world.
* Returns a list of blocks that should be highlighted in world. The starting point is whichever block the player currently has highlighted in the world.
*/
public ArrayList<BlockPos> getArchitectBlocks(ItemStack stack, World world,
BlockPos pos, EnumFacing side, EntityPlayer player);
Expand Down
20 changes: 20 additions & 0 deletions items/IArchitectExtended.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package thaumcraft.api.items;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;

public interface IArchitectExtended extends IArchitect {

/**
* Returns the location that should be used as the starting point.
*/
public MovingObjectPosition getArchitectMOP(ItemStack stack, World world, EntityLivingBase player);

/**
* @return will this trigger on block highlighting event
*/
public boolean useBlockHighlight(ItemStack stack);
}
17 changes: 17 additions & 0 deletions items/IFocusPicker.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package thaumcraft.api.items;

import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

/**
* Used by wand foci like the trade focus to get an itemstack and display it on the wand hud.
* @author azanor
*/
public interface IFocusPicker {
/**
* Get the currently picked item
* @param stack the focus stack
* @return the picked stack
*/
public ItemStack getPickedBlock(ItemStack stack);
}
4 changes: 4 additions & 0 deletions items/ItemsTC.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public class ItemsTC {
public static Item focusHole;
public static Item focusShard;
public static Item focusGrapple;
public static Item focusBuilder;

public static Item focusPouch;

Expand Down Expand Up @@ -174,6 +175,7 @@ public class ItemsTC {
public static Item crimsonRites;
public static Item runedTablet;
public static Item creativePlacer;
public static Item creativeFluxSponge;

//golems
public static Item golemBell;
Expand All @@ -185,6 +187,8 @@ public class ItemsTC {
public static Item seals;







Expand Down
2 changes: 1 addition & 1 deletion package-info.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@API(owner = "Thaumcraft", apiVersion = "5.1.0.0", provides = "Thaumcraft|API")
@API(owner = "Thaumcraft", apiVersion = "5.1.1.1", provides = "Thaumcraft|API")
package thaumcraft.api;

import net.minecraftforge.fml.common.API;
Expand Down

0 comments on commit 053f9c0

Please sign in to comment.