Fixing Sanguine armour, adding some fancy rendering, doing other random bug fixes
This commit is contained in:
parent
4f9fad22c5
commit
14f9e3c61b
|
@ -1,6 +1,5 @@
|
|||
package thaumcraft.api;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
|
|
|
@ -115,7 +115,7 @@ public class ThaumcraftApi {
|
|||
*/
|
||||
public static void addSmeltingBonus(ItemStack in, ItemStack out) {
|
||||
smeltingBonus.put(
|
||||
Arrays.asList(Item.getIdFromItem(in.getItem()),in.getItemDamage()),
|
||||
Arrays.asList(in.getItem(),in.getItemDamage()),
|
||||
new ItemStack(out.getItem(),0,out.getItemDamage()));
|
||||
}
|
||||
|
||||
|
@ -135,9 +135,9 @@ public class ThaumcraftApi {
|
|||
* @return the The bonus item that can be produced
|
||||
*/
|
||||
public static ItemStack getSmeltingBonus(ItemStack in) {
|
||||
ItemStack out = smeltingBonus.get(Arrays.asList(Item.getIdFromItem(in.getItem()),in.getItemDamage()));
|
||||
ItemStack out = smeltingBonus.get(Arrays.asList(in.getItem(),in.getItemDamage()));
|
||||
if (out==null) {
|
||||
out = smeltingBonus.get(Arrays.asList(Item.getIdFromItem(in.getItem()),OreDictionary.WILDCARD_VALUE));
|
||||
out = smeltingBonus.get(Arrays.asList(in.getItem(),OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
if (out==null) {
|
||||
String od = OreDictionary.getOreName( OreDictionary.getOreID(in));
|
||||
|
@ -232,6 +232,7 @@ public class ThaumcraftApi {
|
|||
/**
|
||||
* @param key the research key required for this recipe to work.
|
||||
* @param result the output result
|
||||
* @param catalyst an itemstack of the catalyst or a string if it is an ore dictionary item
|
||||
* @param cost the vis cost
|
||||
* @param tags the aspects required to craft this
|
||||
*/
|
||||
|
@ -388,6 +389,43 @@ public class ThaumcraftApi {
|
|||
registerObjectTag(item,tmp);
|
||||
}
|
||||
}
|
||||
|
||||
//WARP ///////////////////////////////////////////////////////////////////////////////////////
|
||||
private static HashMap<Object,Integer> warpMap = new HashMap<Object,Integer>();
|
||||
|
||||
/**
|
||||
* This method is used to determine how much warp is gained if the item is crafted
|
||||
* @param craftresult The item crafted
|
||||
* @param amount how much warp is gained
|
||||
*/
|
||||
public static void addWarpToItem(ItemStack craftresult, int amount) {
|
||||
warpMap.put(Arrays.asList(craftresult.getItem(),craftresult.getItemDamage()),amount);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to determine how much warp is gained if the sent item is crafted
|
||||
* @param in The item crafted
|
||||
* @param amount how much warp is gained
|
||||
*/
|
||||
public static void addWarpToResearch(String research, int amount) {
|
||||
warpMap.put(research, amount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns how much warp is gained from the item or research passed in
|
||||
* @param in itemstack or string
|
||||
* @return how much warp it will give
|
||||
*/
|
||||
public static int getWarp(Object in) {
|
||||
if (in==null) return 0;
|
||||
if (in instanceof ItemStack && warpMap.containsKey(Arrays.asList(((ItemStack)in).getItem(),((ItemStack)in).getItemDamage()))) {
|
||||
return warpMap.get(Arrays.asList(((ItemStack)in).getItem(),((ItemStack)in).getItemDamage()));
|
||||
} else
|
||||
if (in instanceof String && warpMap.containsKey((String)in)) {
|
||||
return warpMap.get((String)in);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//CROPS //////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
|
|
@ -140,7 +140,8 @@ public class ThaumcraftApiHelper {
|
|||
{
|
||||
return false;
|
||||
}
|
||||
return (target.getItem() == input.getItem() && ((target.getItemDamage() == OreDictionary.WILDCARD_VALUE && !strict) || target.getItemDamage() == input.getItemDamage()));
|
||||
return (target.getItem() == input.getItem() &&
|
||||
((target.getItemDamage() == OreDictionary.WILDCARD_VALUE && !strict) || target.getItemDamage() == input.getItemDamage()));
|
||||
}
|
||||
|
||||
|
||||
|
|
63
1.7.10/api/java/thaumcraft/api/TileThaumcraft.java
Normal file
63
1.7.10/api/java/thaumcraft/api/TileThaumcraft.java
Normal file
|
@ -0,0 +1,63 @@
|
|||
package thaumcraft.api;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author azanor
|
||||
*
|
||||
* Custom tile entity class I use for most of my tile entities. Setup in such a way that only
|
||||
* the nbt data within readCustomNBT / writeCustomNBT will be sent to the client when the tile
|
||||
* updates. Apart from all the normal TE data that gets sent that is.
|
||||
*
|
||||
*/
|
||||
public class TileThaumcraft extends TileEntity {
|
||||
|
||||
//NBT stuff
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
super.readFromNBT(nbttagcompound);
|
||||
readCustomNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
public void readCustomNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
super.writeToNBT(nbttagcompound);
|
||||
writeCustomNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
public void writeCustomNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
//Client Packet stuff
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
this.writeCustomNBT(nbttagcompound);
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, -999, nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
super.onDataPacket(net, pkt);
|
||||
this.readCustomNBT(pkt.func_148857_g());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
117
1.7.10/api/java/thaumcraft/api/WorldCoordinates.java
Normal file
117
1.7.10/api/java/thaumcraft/api/WorldCoordinates.java
Normal file
|
@ -0,0 +1,117 @@
|
|||
package thaumcraft.api;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class WorldCoordinates implements Comparable
|
||||
{
|
||||
public int x;
|
||||
|
||||
/** the y coordinate */
|
||||
public int y;
|
||||
|
||||
/** the z coordinate */
|
||||
public int z;
|
||||
|
||||
public int dim;
|
||||
|
||||
public WorldCoordinates() {}
|
||||
|
||||
public WorldCoordinates(int par1, int par2, int par3, int d)
|
||||
{
|
||||
this.x = par1;
|
||||
this.y = par2;
|
||||
this.z = par3;
|
||||
this.dim = d;
|
||||
}
|
||||
|
||||
public WorldCoordinates(TileEntity tile)
|
||||
{
|
||||
this.x = tile.xCoord;
|
||||
this.y = tile.yCoord;
|
||||
this.z = tile.zCoord;
|
||||
this.dim = tile.getWorldObj().provider.dimensionId;
|
||||
}
|
||||
|
||||
public WorldCoordinates(WorldCoordinates par1ChunkCoordinates)
|
||||
{
|
||||
this.x = par1ChunkCoordinates.x;
|
||||
this.y = par1ChunkCoordinates.y;
|
||||
this.z = par1ChunkCoordinates.z;
|
||||
this.dim = par1ChunkCoordinates.dim;
|
||||
}
|
||||
|
||||
public boolean equals(Object par1Obj)
|
||||
{
|
||||
if (!(par1Obj instanceof WorldCoordinates))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
WorldCoordinates coordinates = (WorldCoordinates)par1Obj;
|
||||
return this.x == coordinates.x && this.y == coordinates.y && this.z == coordinates.z && this.dim == coordinates.dim ;
|
||||
}
|
||||
}
|
||||
|
||||
public int hashCode()
|
||||
{
|
||||
return this.x + this.y << 8 + this.z << 16 + this.dim << 24;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare the coordinate with another coordinate
|
||||
*/
|
||||
public int compareWorldCoordinate(WorldCoordinates par1)
|
||||
{
|
||||
return this.dim == par1.dim ? (
|
||||
this.y == par1.y ? (this.z == par1.z ? this.x - par1.x : this.z - par1.z) : this.y - par1.y) : -1;
|
||||
}
|
||||
|
||||
public void set(int par1, int par2, int par3, int d)
|
||||
{
|
||||
this.x = par1;
|
||||
this.y = par2;
|
||||
this.z = par3;
|
||||
this.dim = d;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the squared distance between this coordinates and the coordinates given as argument.
|
||||
*/
|
||||
public float getDistanceSquared(int par1, int par2, int par3)
|
||||
{
|
||||
float f = (float)(this.x - par1);
|
||||
float f1 = (float)(this.y - par2);
|
||||
float f2 = (float)(this.z - par3);
|
||||
return f * f + f1 * f1 + f2 * f2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the squared distance between this coordinates and the ChunkCoordinates given as argument.
|
||||
*/
|
||||
public float getDistanceSquaredToWorldCoordinates(WorldCoordinates par1ChunkCoordinates)
|
||||
{
|
||||
return this.getDistanceSquared(par1ChunkCoordinates.x, par1ChunkCoordinates.y, par1ChunkCoordinates.z);
|
||||
}
|
||||
|
||||
public int compareTo(Object par1Obj)
|
||||
{
|
||||
return this.compareWorldCoordinate((WorldCoordinates)par1Obj);
|
||||
}
|
||||
|
||||
public void readNBT(NBTTagCompound nbt) {
|
||||
this.x = nbt.getInteger("w_x");
|
||||
this.y = nbt.getInteger("w_y");
|
||||
this.z = nbt.getInteger("w_z");
|
||||
this.dim = nbt.getInteger("w_d");
|
||||
}
|
||||
|
||||
public void writeNBT(NBTTagCompound nbt) {
|
||||
nbt.setInteger("w_x",x);
|
||||
nbt.setInteger("w_y",y);
|
||||
nbt.setInteger("w_z",z);
|
||||
nbt.setInteger("w_d",dim);
|
||||
}
|
||||
|
||||
}
|
|
@ -9,6 +9,7 @@ import cpw.mods.fml.common.FMLLog;
|
|||
public class AspectSourceHelper {
|
||||
|
||||
static Method drainEssentia;
|
||||
static Method findEssentia;
|
||||
/**
|
||||
* This method is what is used to drain essentia from jars and other sources for things like
|
||||
* infusion crafting or powering the arcane furnace. A record of possible sources are kept track of
|
||||
|
@ -23,14 +24,35 @@ public class AspectSourceHelper {
|
|||
public static boolean drainEssentia(TileEntity tile, Aspect aspect, ForgeDirection direction, int range) {
|
||||
try {
|
||||
if(drainEssentia == null) {
|
||||
Class fake = Class.forName("thaumcraft.common.lib.EssentiaHandler");
|
||||
Class fake = Class.forName("thaumcraft.common.lib.events.EssentiaHandler");
|
||||
drainEssentia = fake.getMethod("drainEssentia", TileEntity.class, Aspect.class, ForgeDirection.class, int.class);
|
||||
}
|
||||
return (Boolean) drainEssentia.invoke(null, tile, aspect, direction, range);
|
||||
} catch(Exception ex) {
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.EssentiaHandler method drainEssentia");
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.events.EssentiaHandler method drainEssentia");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns if there is any essentia of the passed type that can be drained. It in no way checks how
|
||||
* much there is, only if an essentia container nearby contains at least 1 point worth.
|
||||
* @param tile the tile entity that is checking the essentia
|
||||
* @param aspect the aspect that you are looking for
|
||||
* @param direction the direction from which you wish to drain. Forgedirection.Unknown simply seeks in all directions.
|
||||
* @param range how many blocks you wish to search for essentia sources.
|
||||
* @return boolean returns true if essentia was found and removed from a source.
|
||||
*/
|
||||
public static boolean findEssentia(TileEntity tile, Aspect aspect, ForgeDirection direction, int range) {
|
||||
try {
|
||||
if(findEssentia == null) {
|
||||
Class fake = Class.forName("thaumcraft.common.lib.events.EssentiaHandler");
|
||||
findEssentia = fake.getMethod("findEssentia", TileEntity.class, Aspect.class, ForgeDirection.class, int.class);
|
||||
}
|
||||
return (Boolean) findEssentia.invoke(null, tile, aspect, direction, range);
|
||||
} catch(Exception ex) {
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.events.EssentiaHandler method findEssentia");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,8 @@ public class CrucibleRecipe {
|
|||
return false;
|
||||
} else
|
||||
if (catalyst instanceof ArrayList && ((ArrayList<ItemStack>)catalyst).size()>0) {
|
||||
if (!ThaumcraftApiHelper.containsMatch(true, ((ArrayList<ItemStack>)catalyst).toArray(new ItemStack[]{}), cat)) return false;
|
||||
ItemStack[] ores = ((ArrayList<ItemStack>)catalyst).toArray(new ItemStack[]{});
|
||||
if (!ThaumcraftApiHelper.containsMatch(false, new ItemStack[]{cat},ores)) return false;
|
||||
}
|
||||
if (itags==null) return false;
|
||||
for (Aspect tag:aspects.getAspects()) {
|
||||
|
@ -48,8 +49,8 @@ public class CrucibleRecipe {
|
|||
return true;
|
||||
} else
|
||||
if (catalyst instanceof ArrayList && ((ArrayList<ItemStack>)catalyst).size()>0) {
|
||||
if (ThaumcraftApiHelper.containsMatch(true,
|
||||
((ArrayList<ItemStack>)catalyst).toArray(new ItemStack[]{}), cat)) return true;
|
||||
ItemStack[] ores = ((ArrayList<ItemStack>)catalyst).toArray(new ItemStack[]{});
|
||||
if (ThaumcraftApiHelper.containsMatch(false, new ItemStack[]{cat},ores)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -71,4 +72,24 @@ public class CrucibleRecipe {
|
|||
return recipeOutput;
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// public int hashCode() {
|
||||
// String hash = "";
|
||||
// if (catalyst instanceof ItemStack) {
|
||||
// hash += ((ItemStack)catalyst).toString();
|
||||
// } else if (catalyst instanceof ArrayList && ((ArrayList<ItemStack>)catalyst).size()>0) {
|
||||
// for (ItemStack s:(ArrayList<ItemStack>)catalyst) {
|
||||
// hash += s.toString();
|
||||
// }
|
||||
// } else {
|
||||
// hash += catalyst.hashCode();
|
||||
// }
|
||||
// hash += getRecipeOutput().toString();
|
||||
// for (Aspect a:aspects.getAspectsSorted()) {
|
||||
// hash += a.getTag() + aspects.getAmount(a);
|
||||
// }
|
||||
// return hash.hashCode();
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package thaumcraft.api.damagesource;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EntityDamageSourceIndirect;
|
||||
|
||||
public class DamageSourceIndirectThaumcraftEntity extends EntityDamageSourceIndirect {
|
||||
|
||||
private boolean fireDamage;
|
||||
private float hungerDamage;
|
||||
private boolean isUnblockable;
|
||||
|
||||
|
||||
public DamageSourceIndirectThaumcraftEntity(String par1Str,
|
||||
Entity par2Entity, Entity par3Entity) {
|
||||
super(par1Str, par2Entity, par3Entity);
|
||||
}
|
||||
|
||||
|
||||
public DamageSource setFireDamage()
|
||||
{
|
||||
this.fireDamage = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DamageSource setDamageBypassesArmor()
|
||||
{
|
||||
this.isUnblockable = true;
|
||||
this.hungerDamage = 0.0F;
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package thaumcraft.api.damagesource;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EntityDamageSource;
|
||||
|
||||
public class DamageSourceThaumcraft extends DamageSource
|
||||
{
|
||||
|
||||
public static DamageSource taint = new DamageSourceThaumcraft("taint").setDamageBypassesArmor().setMagicDamage();
|
||||
public static DamageSource tentacle = new DamageSourceThaumcraft("tentacle");
|
||||
public static DamageSource swarm = new DamageSourceThaumcraft("swarm");
|
||||
|
||||
protected DamageSourceThaumcraft(String par1Str) {
|
||||
super(par1Str);
|
||||
}
|
||||
|
||||
/** This kind of damage can be blocked or not. */
|
||||
private boolean isUnblockable = false;
|
||||
private boolean isDamageAllowedInCreativeMode = false;
|
||||
private float hungerDamage = 0.3F;
|
||||
|
||||
/** This kind of damage is based on fire or not. */
|
||||
private boolean fireDamage;
|
||||
|
||||
/** This kind of damage is based on a projectile or not. */
|
||||
private boolean projectile;
|
||||
|
||||
/**
|
||||
* Whether this damage source will have its damage amount scaled based on the current difficulty.
|
||||
*/
|
||||
private boolean difficultyScaled;
|
||||
private boolean magicDamage = false;
|
||||
private boolean explosion = false;
|
||||
|
||||
public static DamageSource causeSwarmDamage(EntityLivingBase par0EntityLiving)
|
||||
{
|
||||
return new EntityDamageSource("swarm", par0EntityLiving);
|
||||
}
|
||||
|
||||
public static DamageSource causeTentacleDamage(EntityLivingBase par0EntityLiving)
|
||||
{
|
||||
return new EntityDamageSource("tentacle", par0EntityLiving);
|
||||
}
|
||||
|
||||
}
|
5
1.7.10/api/java/thaumcraft/api/entities/ITaintedMob.java
Normal file
5
1.7.10/api/java/thaumcraft/api/entities/ITaintedMob.java
Normal file
|
@ -0,0 +1,5 @@
|
|||
package thaumcraft.api.entities;
|
||||
|
||||
public interface ITaintedMob {
|
||||
|
||||
}
|
4
1.7.10/api/java/thaumcraft/api/package-info.java
Normal file
4
1.7.10/api/java/thaumcraft/api/package-info.java
Normal file
|
@ -0,0 +1,4 @@
|
|||
@API(owner = "Thaumcraft", apiVersion = "4.2.0.0", provides = "Thaumcraft|API")
|
||||
package thaumcraft.api;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
67
1.7.10/api/java/thaumcraft/api/potions/PotionFluxTaint.java
Normal file
67
1.7.10/api/java/thaumcraft/api/potions/PotionFluxTaint.java
Normal file
|
@ -0,0 +1,67 @@
|
|||
package thaumcraft.api.potions;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import thaumcraft.api.damagesource.DamageSourceThaumcraft;
|
||||
import thaumcraft.api.entities.ITaintedMob;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class PotionFluxTaint extends Potion
|
||||
{
|
||||
public static PotionFluxTaint instance = null; // will be instantiated at runtime
|
||||
private int statusIconIndex = -1;
|
||||
|
||||
public PotionFluxTaint(int par1, boolean par2, int par3)
|
||||
{
|
||||
super(par1,par2,par3);
|
||||
setIconIndex(0, 0);
|
||||
}
|
||||
|
||||
public static void init()
|
||||
{
|
||||
instance.setPotionName("potion.fluxtaint");
|
||||
instance.setIconIndex(3, 1);
|
||||
instance.setEffectiveness(0.25D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBadEffect() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getStatusIconIndex() {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(rl);
|
||||
return super.getStatusIconIndex();
|
||||
}
|
||||
|
||||
ResourceLocation rl = new ResourceLocation("thaumcraft","textures/misc/potions.png");
|
||||
|
||||
@Override
|
||||
public void performEffect(EntityLivingBase target, int par2) {
|
||||
if (target instanceof ITaintedMob) {
|
||||
target.heal(1);
|
||||
} else
|
||||
if (!target.isEntityUndead() && !(target instanceof EntityPlayer))
|
||||
{
|
||||
target.attackEntityFrom(DamageSourceThaumcraft.taint, 1);
|
||||
}
|
||||
else
|
||||
if (!target.isEntityUndead() && (target.getMaxHealth() > 1 || (target instanceof EntityPlayer)))
|
||||
{
|
||||
target.attackEntityFrom(DamageSourceThaumcraft.taint, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isReady(int par1, int par2)
|
||||
{
|
||||
int k = 40 >> par2;
|
||||
return k > 0 ? par1 % k == 0 : true;
|
||||
}
|
||||
|
||||
}
|
|
@ -3,6 +3,7 @@ package thaumcraft.api.research;
|
|||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
@ -24,7 +25,8 @@ public class ResearchPage {
|
|||
NORMAL_CRAFTING,
|
||||
INFUSION_CRAFTING,
|
||||
COMPOUND_CRAFTING,
|
||||
INFUSION_ENCHANTMENT
|
||||
INFUSION_ENCHANTMENT,
|
||||
SMELTING
|
||||
}
|
||||
|
||||
public PageType type = PageType.TEXT;
|
||||
|
@ -79,6 +81,14 @@ public class ResearchPage {
|
|||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recipe a collection of arcane crafting recipes.
|
||||
*/
|
||||
public ResearchPage(CrucibleRecipe[] recipe) {
|
||||
this.type = PageType.CRUCIBLE_CRAFTING;
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recipe a collection of infusion crafting recipes.
|
||||
*/
|
||||
|
@ -113,6 +123,15 @@ public class ResearchPage {
|
|||
this.recipeOutput = recipe.getRecipeOutput();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recipe a furnace smelting crafting recipe.
|
||||
*/
|
||||
public ResearchPage(ItemStack input) {
|
||||
this.type = PageType.SMELTING;
|
||||
this.recipe = input;
|
||||
this.recipeOutput = FurnaceRecipes.smelting().getSmeltingResult(input);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param recipe an infusion crafting recipe.
|
||||
*/
|
||||
|
|
188
1.7.10/api/java/thaumcraft/api/visnet/TileVisNode.java
Normal file
188
1.7.10/api/java/thaumcraft/api/visnet/TileVisNode.java
Normal file
|
@ -0,0 +1,188 @@
|
|||
package thaumcraft.api.visnet;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import thaumcraft.api.TileThaumcraft;
|
||||
import thaumcraft.api.WorldCoordinates;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
/**
|
||||
* @author Azanor
|
||||
*
|
||||
* The tile entity used by nodes in the vis energy network. A node is either a source (like an aura node),
|
||||
* a transport relay or vis receiver (like the infernal furnace).
|
||||
*
|
||||
*/
|
||||
public abstract class TileVisNode extends TileThaumcraft {
|
||||
|
||||
WeakReference<TileVisNode> parent = null;
|
||||
ArrayList<WeakReference<TileVisNode>> children = new ArrayList<WeakReference<TileVisNode>>();
|
||||
|
||||
/**
|
||||
* @return the WorldCoordinates location of where this node is located
|
||||
*/
|
||||
public WorldCoordinates getLocation() {
|
||||
return new WorldCoordinates(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the number of blocks away this node will check for parent nodes to connect to.
|
||||
*/
|
||||
public abstract int getRange();
|
||||
|
||||
/**
|
||||
* @return true if this is the source or root node of the vis network.
|
||||
*/
|
||||
public abstract boolean isSource();
|
||||
|
||||
/**
|
||||
* This method should never be called directly. Use VisNetHandler.drainVis() instead
|
||||
* @param aspect what aspect to drain
|
||||
* @param vis how much to drain
|
||||
* @return how much was actually drained
|
||||
*/
|
||||
public int consumeVis(Aspect aspect, int vis) {
|
||||
if (VisNetHandler.isNodeValid(getParent())) {
|
||||
int out = getParent().get().consumeVis(aspect, vis);
|
||||
if (out>0) {
|
||||
triggerConsumeEffect(aspect);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void removeThisNode() {
|
||||
for (WeakReference<TileVisNode> n:getChildren()) {
|
||||
if (n!=null && n.get()!=null) {
|
||||
n.get().removeThisNode();
|
||||
}
|
||||
}
|
||||
|
||||
children = new ArrayList<WeakReference<TileVisNode>>();
|
||||
if (VisNetHandler.isNodeValid(this.getParent())) {
|
||||
this.getParent().get().nodeRefresh=true;
|
||||
}
|
||||
this.setParent(null);
|
||||
this.parentChanged();
|
||||
|
||||
if (this.isSource()) {
|
||||
HashMap<WorldCoordinates, WeakReference<TileVisNode>> sourcelist = VisNetHandler.sources.get(worldObj.provider.dimensionId);
|
||||
if (sourcelist==null) {
|
||||
sourcelist = new HashMap<WorldCoordinates, WeakReference<TileVisNode>>();
|
||||
}
|
||||
sourcelist.remove(getLocation());
|
||||
VisNetHandler.sources.put( worldObj.provider.dimensionId, sourcelist );
|
||||
}
|
||||
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
removeThisNode();
|
||||
super.invalidate();
|
||||
}
|
||||
|
||||
public void triggerConsumeEffect(Aspect aspect) { }
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public WeakReference<TileVisNode> getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public WeakReference<TileVisNode> getRootSource() {
|
||||
return VisNetHandler.isNodeValid(getParent()) ?
|
||||
getParent().get().getRootSource() : this.isSource() ?
|
||||
new WeakReference(this) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param parent
|
||||
*/
|
||||
public void setParent(WeakReference<TileVisNode> parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public ArrayList<WeakReference<TileVisNode>> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected int nodeCounter = 0;
|
||||
private boolean nodeRegged = false;
|
||||
public boolean nodeRefresh = false;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if (!worldObj.isRemote && ((nodeCounter++) % 40==0 || nodeRefresh)) {
|
||||
//check for changes
|
||||
if (!nodeRefresh && children.size()>0) {
|
||||
for (WeakReference<TileVisNode> n:children) {
|
||||
if (n==null || n.get()==null) {
|
||||
nodeRefresh=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//refresh linked nodes
|
||||
if (nodeRefresh) {
|
||||
for (WeakReference<TileVisNode> n:children) {
|
||||
if (n.get()!=null) {
|
||||
n.get().nodeRefresh=true;
|
||||
}
|
||||
}
|
||||
children.clear();
|
||||
parent=null;
|
||||
}
|
||||
|
||||
//redo stuff
|
||||
if (isSource() && !nodeRegged) {
|
||||
VisNetHandler.addSource(getWorldObj(), this);
|
||||
nodeRegged = true;
|
||||
} else
|
||||
if (!isSource() && !VisNetHandler.isNodeValid(getParent())) {
|
||||
setParent(VisNetHandler.addNode(getWorldObj(), this));
|
||||
nodeRefresh=true;
|
||||
}
|
||||
|
||||
if (nodeRefresh) {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
parentChanged();
|
||||
}
|
||||
nodeRefresh=false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void parentChanged() { }
|
||||
|
||||
/**
|
||||
* @return the type of shard this is attuned to:
|
||||
* none -1, air 0, fire 1, water 2, earth 3, order 4, entropy 5
|
||||
* Should return -1 for most implementations
|
||||
*/
|
||||
public byte getAttunement() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
}
|
284
1.7.10/api/java/thaumcraft/api/visnet/VisNetHandler.java
Normal file
284
1.7.10/api/java/thaumcraft/api/visnet/VisNetHandler.java
Normal file
|
@ -0,0 +1,284 @@
|
|||
package thaumcraft.api.visnet;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.WorldCoordinates;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
public class VisNetHandler {
|
||||
|
||||
// / NODE DRAINING
|
||||
/**
|
||||
* This method drains vis from a relay or source near the passed in
|
||||
* location. The amount received can be less than the amount requested so
|
||||
* take that into account.
|
||||
*
|
||||
* @param world
|
||||
* @param x the x position of the draining block or entity
|
||||
* @param y the y position of the draining block or entity
|
||||
* @param z the z position of the draining block or entity
|
||||
* @param aspect what aspect to drain
|
||||
* @param vis how much to drain
|
||||
* @return how much was actually drained
|
||||
*/
|
||||
public static int drainVis(World world, int x, int y, int z, Aspect aspect, int amount) {
|
||||
|
||||
int drainedAmount = 0;
|
||||
|
||||
WorldCoordinates drainer = new WorldCoordinates(x, y, z,
|
||||
world.provider.dimensionId);
|
||||
if (!nearbyNodes.containsKey(drainer)) {
|
||||
calculateNearbyNodes(world, x, y, z);
|
||||
}
|
||||
|
||||
ArrayList<WeakReference<TileVisNode>> nodes = nearbyNodes.get(drainer);
|
||||
if (nodes!=null && nodes.size()>0)
|
||||
for (WeakReference<TileVisNode> noderef : nodes) {
|
||||
|
||||
TileVisNode node = noderef.get();
|
||||
|
||||
if (node == null) continue;
|
||||
|
||||
int a = node.consumeVis(aspect, amount);
|
||||
drainedAmount += a;
|
||||
amount -= a;
|
||||
if (a>0) {
|
||||
int color = Aspect.getPrimalAspects().indexOf(aspect);
|
||||
generateVisEffect(world.provider.dimensionId, x, y, z, node.xCoord, node.yCoord, node.zCoord, color);
|
||||
}
|
||||
if (amount <= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return drainedAmount;
|
||||
}
|
||||
|
||||
static Method generateVisEffect;
|
||||
public static void generateVisEffect(int dim, int x, int y, int z, int x2, int y2, int z2, int color) {
|
||||
try {
|
||||
if(generateVisEffect == null) {
|
||||
Class fake = Class.forName("thaumcraft.common.lib.Utils");
|
||||
generateVisEffect = fake.getMethod("generateVisEffect", int.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class);
|
||||
}
|
||||
generateVisEffect.invoke(null, dim, x,y,z,x2,y2,z2,color);
|
||||
} catch(Exception ex) {
|
||||
FMLLog.warning("[Thaumcraft API] Could not invoke thaumcraft.common.lib.Utils method generateVisEffect");
|
||||
}
|
||||
}
|
||||
|
||||
public static HashMap<Integer, HashMap<WorldCoordinates, WeakReference<TileVisNode>>> sources = new HashMap<Integer, HashMap<WorldCoordinates, WeakReference<TileVisNode>>>();
|
||||
|
||||
public static void addSource(World world, TileVisNode vs) {
|
||||
HashMap<WorldCoordinates, WeakReference<TileVisNode>> sourcelist = sources
|
||||
.get(world.provider.dimensionId);
|
||||
if (sourcelist == null) {
|
||||
sourcelist = new HashMap<WorldCoordinates, WeakReference<TileVisNode>>();
|
||||
}
|
||||
sourcelist.put(vs.getLocation(), new WeakReference(vs));
|
||||
sources.put(world.provider.dimensionId, sourcelist);
|
||||
nearbyNodes.clear();
|
||||
}
|
||||
|
||||
public static boolean isNodeValid(WeakReference<TileVisNode> node) {
|
||||
if (node == null || node.get() == null || node.get().isInvalid())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static WeakReference<TileVisNode> addNode(World world, TileVisNode vn) {
|
||||
WeakReference ref = new WeakReference(vn);
|
||||
|
||||
HashMap<WorldCoordinates, WeakReference<TileVisNode>> sourcelist = sources
|
||||
.get(world.provider.dimensionId);
|
||||
if (sourcelist == null) {
|
||||
sourcelist = new HashMap<WorldCoordinates, WeakReference<TileVisNode>>();
|
||||
return null;
|
||||
}
|
||||
|
||||
ArrayList<Object[]> nearby = new ArrayList<Object[]>();
|
||||
|
||||
for (WeakReference<TileVisNode> root : sourcelist.values()) {
|
||||
if (!isNodeValid(root))
|
||||
continue;
|
||||
|
||||
TileVisNode source = root.get();
|
||||
|
||||
float r = inRange(world, vn.getLocation(), source.getLocation(),
|
||||
vn.getRange());
|
||||
if (r > 0) {
|
||||
nearby.add(new Object[] { source, r - vn.getRange() * 2 });
|
||||
}
|
||||
nearby = findClosestNodes(vn, source, nearby);
|
||||
}
|
||||
|
||||
float dist = Float.MAX_VALUE;
|
||||
TileVisNode closest = null;
|
||||
if (nearby.size() > 0) {
|
||||
for (Object[] o : nearby) {
|
||||
if ((Float) o[1] < dist) {// && canNodeBeSeen(vn,(TileVisNode)
|
||||
// o[0])) {
|
||||
dist = (Float) o[1];
|
||||
closest = (TileVisNode) o[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (closest != null) {
|
||||
closest.getChildren().add(ref);
|
||||
nearbyNodes.clear();
|
||||
return new WeakReference(closest);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ArrayList<Object[]> findClosestNodes(TileVisNode target,
|
||||
TileVisNode root, ArrayList<Object[]> in) {
|
||||
TileVisNode closestChild = null;
|
||||
|
||||
for (WeakReference<TileVisNode> child : root.getChildren()) {
|
||||
TileVisNode n = child.get();
|
||||
|
||||
if (n != null
|
||||
&& !n.equals(target)
|
||||
&& !n.equals(root)
|
||||
&& (target.getAttunement() == -1 || n.getAttunement() == -1 || n
|
||||
.getAttunement() == target.getAttunement())) {
|
||||
|
||||
float r2 = inRange(n.getWorldObj(), n.getLocation(),
|
||||
target.getLocation(), target.getRange());
|
||||
if (r2 > 0) {
|
||||
in.add(new Object[] { n, r2 });
|
||||
}
|
||||
|
||||
in = findClosestNodes(target, n, in);
|
||||
}
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
private static float inRange(World world, WorldCoordinates cc1,
|
||||
WorldCoordinates cc2, int range) {
|
||||
float distance = cc1.getDistanceSquaredToWorldCoordinates(cc2);
|
||||
return distance > range * range ? -1 : distance;
|
||||
}
|
||||
|
||||
private static HashMap<WorldCoordinates, ArrayList<WeakReference<TileVisNode>>> nearbyNodes = new HashMap<WorldCoordinates, ArrayList<WeakReference<TileVisNode>>>();
|
||||
|
||||
private static void calculateNearbyNodes(World world, int x, int y, int z) {
|
||||
|
||||
HashMap<WorldCoordinates, WeakReference<TileVisNode>> sourcelist = sources
|
||||
.get(world.provider.dimensionId);
|
||||
if (sourcelist == null) {
|
||||
sourcelist = new HashMap<WorldCoordinates, WeakReference<TileVisNode>>();
|
||||
return;
|
||||
}
|
||||
|
||||
ArrayList<WeakReference<TileVisNode>> cn = new ArrayList<WeakReference<TileVisNode>>();
|
||||
WorldCoordinates drainer = new WorldCoordinates(x, y, z,
|
||||
world.provider.dimensionId);
|
||||
|
||||
ArrayList<Object[]> nearby = new ArrayList<Object[]>();
|
||||
|
||||
for (WeakReference<TileVisNode> root : sourcelist.values()) {
|
||||
|
||||
if (!isNodeValid(root))
|
||||
continue;
|
||||
|
||||
TileVisNode source = root.get();
|
||||
|
||||
TileVisNode closest = null;
|
||||
float range = Float.MAX_VALUE;
|
||||
|
||||
float r = inRange(world, drainer, source.getLocation(),
|
||||
source.getRange());
|
||||
if (r > 0) {
|
||||
range = r;
|
||||
closest = source;
|
||||
}
|
||||
|
||||
ArrayList<WeakReference<TileVisNode>> children = new ArrayList<WeakReference<TileVisNode>>();
|
||||
children = getAllChildren(source,children);
|
||||
|
||||
for (WeakReference<TileVisNode> child : children) {
|
||||
TileVisNode n = child.get();
|
||||
if (n != null && !n.equals(root)) {
|
||||
|
||||
float r2 = inRange(n.getWorldObj(), n.getLocation(),
|
||||
drainer, n.getRange());
|
||||
if (r2 > 0 && r2 < range) {
|
||||
range = r2;
|
||||
closest = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (closest != null) {
|
||||
|
||||
cn.add(new WeakReference(closest));
|
||||
}
|
||||
}
|
||||
|
||||
nearbyNodes.put(drainer, cn);
|
||||
}
|
||||
|
||||
private static ArrayList<WeakReference<TileVisNode>> getAllChildren(TileVisNode source, ArrayList<WeakReference<TileVisNode>> list) {
|
||||
for (WeakReference<TileVisNode> child : source.getChildren()) {
|
||||
TileVisNode n = child.get();
|
||||
if (n != null) {
|
||||
list.add(child);
|
||||
list = getAllChildren(n,list);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
// public static boolean canNodeBeSeen(TileVisNode source,TileVisNode
|
||||
// target)
|
||||
// {
|
||||
// double d = Math.sqrt(source.getDistanceFrom(target.xCoord, target.yCoord,
|
||||
// target.zCoord));
|
||||
// double xd = (source.xCoord-target.xCoord) / d;
|
||||
// double yd = (source.yCoord-target.yCoord) / d;
|
||||
// double zd = (source.zCoord-target.zCoord) / d;
|
||||
// return source.getWorldObj().rayTraceBlocks(
|
||||
// Vec3.createVectorHelper(source.xCoord-xd+.5+.5, source.yCoord-yd,
|
||||
// source.zCoord-zd),
|
||||
// Vec3.createVectorHelper(target.xCoord+.5, target.yCoord+.5,
|
||||
// target.zCoord+.5)) == null;
|
||||
// }
|
||||
|
||||
// public static HashMap<WorldCoordinates,WeakReference<TileVisNode>>
|
||||
// noderef = new HashMap<WorldCoordinates,WeakReference<TileVisNode>>();
|
||||
//
|
||||
// public static TileVisNode getClosestNodeWithinRadius(World world, int x,
|
||||
// int y, int z, int radius) {
|
||||
// TileVisNode out = null;
|
||||
// WorldCoordinates wc = null;
|
||||
// float cd = Float.MAX_VALUE;
|
||||
// for (int sx = x - radius; sx <= x + radius; sx++) {
|
||||
// for (int sy = y - radius; sy <= y + radius; sy++) {
|
||||
// for (int sz = z - radius; sz <= z + radius; sz++) {
|
||||
// wc = new WorldCoordinates(sx,sy,sz,world.provider.dimensionId);
|
||||
// if (noderef.containsKey(wc)) {
|
||||
// float d = wc.getDistanceSquared(x, y, z);
|
||||
// if (d<radius*radius && noderef.get(wc).get()!=null &&
|
||||
// !noderef.get(wc).get().isReceiver() &&
|
||||
// isNodeValid(noderef.get(wc).get().getParent())
|
||||
// ) {
|
||||
// out = noderef.get(wc).get();
|
||||
// cd = d;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return out;
|
||||
// }
|
||||
|
||||
}
|
|
@ -115,6 +115,13 @@ public class WandCap {
|
|||
this.craftCost = craftCost;
|
||||
}
|
||||
|
||||
/**
|
||||
* The research a player needs to have finished to be able to craft a wand with this cap.
|
||||
*/
|
||||
public String getResearch() {
|
||||
return "CAP_"+getTag();
|
||||
}
|
||||
|
||||
// Some examples:
|
||||
// WandCap WAND_CAP_IRON = new WandCap("iron", 1.1f, Arrays.asList(Aspect.ORDER),1, new ItemStack(ConfigItems.itemWandCap,1,0),1);
|
||||
// WandCap WAND_CAP_GOLD = new WandCap("gold", 1f, new ItemStack(ConfigItems.itemWandCap,1,1),3);
|
||||
|
|
|
@ -144,6 +144,13 @@ public class WandRod {
|
|||
public void setGlowing(boolean hasGlow) {
|
||||
this.glow = hasGlow;
|
||||
}
|
||||
|
||||
/**
|
||||
* The research a player needs to have finished to be able to craft a wand with this rod.
|
||||
*/
|
||||
public String getResearch() {
|
||||
return "ROD_"+getTag();
|
||||
}
|
||||
|
||||
// Some examples:
|
||||
// WandRod WAND_ROD_WOOD = new WandRod("wood",25,new ItemStack(Item.stick),1);
|
||||
|
|
|
@ -18,6 +18,7 @@ import net.minecraft.item.Item.ToolMaterial;
|
|||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
@ -44,6 +45,7 @@ import WayofTime.alchemicalWizardry.common.LifeBucketHandler;
|
|||
import WayofTime.alchemicalWizardry.common.LifeEssence;
|
||||
import WayofTime.alchemicalWizardry.common.ModLivingDropsEvent;
|
||||
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
|
||||
import WayofTime.alchemicalWizardry.common.alchemy.CombinedPotionRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.block.ArmourForge;
|
||||
import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityBileDemon;
|
||||
|
@ -77,6 +79,8 @@ import WayofTime.alchemicalWizardry.common.potion.PotionPlanarBinding;
|
|||
import WayofTime.alchemicalWizardry.common.potion.PotionProjectileProtect;
|
||||
import WayofTime.alchemicalWizardry.common.potion.PotionReciprocation;
|
||||
import WayofTime.alchemicalWizardry.common.potion.PotionSoulFray;
|
||||
import WayofTime.alchemicalWizardry.common.potion.PotionSoulHarden;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.AlchemyCircleRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectAnimalGrowth;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectAutoAlchemy;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectBiomeChanger;
|
||||
|
@ -124,6 +128,7 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
|||
import WayofTime.alchemicalWizardry.common.tileEntity.TEOrientable;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESchematicSaver;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock;
|
||||
|
@ -148,7 +153,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
|||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.0.1g")
|
||||
@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.1.1")
|
||||
//@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = {"BloodAltar", "particle", "SetLifeEssence", "GetLifeEssence", "Ritual", "GetAltarEssence", "TESocket", "TEWritingTable", "CustomParticle", "SetPlayerVel", "SetPlayerPos", "TEPedestal", "TEPlinth", "TETeleposer", "InfiniteLPPath", "TEOrientor"}, packetHandler = PacketHandler.class)
|
||||
|
||||
public class AlchemicalWizardry
|
||||
|
@ -177,6 +182,7 @@ public class AlchemicalWizardry
|
|||
public static Potion customPotionFireFuse;
|
||||
public static Potion customPotionPlanarBinding;
|
||||
public static Potion customPotionSoulFray;
|
||||
public static Potion customPotionSoulHarden;
|
||||
|
||||
public static int customPotionDrowningID;
|
||||
public static int customPotionBoostID;
|
||||
|
@ -190,12 +196,14 @@ public class AlchemicalWizardry
|
|||
public static int customPotionFireFuseID;
|
||||
public static int customPotionPlanarBindingID;
|
||||
public static int customPotionSoulFrayID;
|
||||
public static int customPotionSoulHardenID;
|
||||
|
||||
public static boolean isThaumcraftLoaded;
|
||||
public static boolean isForestryLoaded;
|
||||
|
||||
public static boolean wimpySettings;
|
||||
public static boolean respawnWithDebuff;
|
||||
public static boolean lockdownAltar;
|
||||
|
||||
public static CreativeTabs tabBloodMagic = new CreativeTabs("tabBloodMagic")
|
||||
{
|
||||
|
@ -213,7 +221,7 @@ public class AlchemicalWizardry
|
|||
};
|
||||
|
||||
public static ToolMaterial bloodBoundToolMaterial = EnumHelper.addToolMaterial("BoundBlood", 4, 1000, 12.0f, 8.0f, 50);
|
||||
public static ArmorMaterial sanguineArmourArmourMaterial = EnumHelper.addArmorMaterial("SanguineArmour", 1000, new int[]{3, 6, 5, 2}, 30);
|
||||
public static ArmorMaterial sanguineArmourArmourMaterial = EnumHelper.addArmorMaterial("SanguineArmour", 33, new int[]{3, 8, 6, 3}, 30);
|
||||
|
||||
//Dungeon loot chances
|
||||
public static int standardBindingAgentDungeonChance;
|
||||
|
@ -545,6 +553,7 @@ public class AlchemicalWizardry
|
|||
customPotionFireFuse = (new PotionFireFuse(customPotionFireFuseID,true,0).setIconIndex(0, 0).setPotionName("Fire Fuse"));
|
||||
customPotionPlanarBinding = (new PotionPlanarBinding(customPotionPlanarBindingID,true,0).setIconIndex(0,0).setPotionName("Planar Binding"));
|
||||
customPotionSoulFray = (new PotionSoulFray(customPotionSoulFrayID,true,0).setIconIndex(0,0).setPotionName("Soul Fray"));
|
||||
customPotionSoulHarden = (new PotionSoulHarden(customPotionSoulHardenID,false,0).setIconIndex(0,0).setPotionName("Soul Harden"));
|
||||
|
||||
ItemStack masterBloodOrbStack = new ItemStack(ModItems.masterBloodOrb);
|
||||
|
||||
|
@ -581,6 +590,7 @@ public class AlchemicalWizardry
|
|||
GameRegistry.registerTileEntity(TEDemonPortal.class, "containerDemonPortal");
|
||||
GameRegistry.registerTileEntity(TESchematicSaver.class, "containerSchematicSaver");
|
||||
GameRegistry.registerTileEntity(TESpectralBlock.class, "containerSpectralBlock");
|
||||
GameRegistry.registerTileEntity(TEReagentConduit.class, "containerReagentConduit");
|
||||
//GameRegistry.registerBlock(ModBlocks.blockSpellEffect,"blockSpellEffect");
|
||||
ModBlocks.bloodRune.setHarvestLevel("pickaxe", 2);
|
||||
ModBlocks.speedRune.setHarvestLevel("pickaxe", 2);
|
||||
|
@ -616,6 +626,7 @@ public class AlchemicalWizardry
|
|||
this.initRituals();
|
||||
this.initBindingRecipes();
|
||||
this.initHarvestRegistry();
|
||||
this.initCombinedAlchemyPotionRecipes();
|
||||
|
||||
//MinecraftForge.setToolClass(ModItems.boundPickaxe, "pickaxe", 5);
|
||||
//MinecraftForge.setToolClass(ModItems.boundAxe, "axe", 5);
|
||||
|
@ -862,15 +873,39 @@ public class AlchemicalWizardry
|
|||
try
|
||||
{
|
||||
//do stuff
|
||||
ModItems.sanguineHelmet = new ItemSanguineArmour().setUnlocalizedName("sanguineHelmet");
|
||||
ModItems.sanguineHelmet = new ItemSanguineArmour(0).setUnlocalizedName("sanguineHelmet");
|
||||
ModItems.sanguineRobe = new ItemSanguineArmour(1).setUnlocalizedName("sanguineRobe");
|
||||
ModItems.sanguinePants = new ItemSanguineArmour(2).setUnlocalizedName("sanguinePants");
|
||||
ModItems.sanguineBoots = new ItemSanguineArmour(3).setUnlocalizedName("sanguineBoots");
|
||||
GameRegistry.registerItem(ModItems.sanguineHelmet, "sanguineHelmet");
|
||||
GameRegistry.registerItem(ModItems.sanguineRobe, "sanguineRobe");
|
||||
GameRegistry.registerItem(ModItems.sanguinePants, "sanguinePants");
|
||||
GameRegistry.registerItem(ModItems.sanguineBoots, "sanguineBoots");
|
||||
|
||||
ItemStack itemGoggles = ItemApi.getItem("itemGoggles", 0);
|
||||
Item itemThaumChest = GameRegistry.findItem("Thaumcraft", "ItemChestplateThaumium");
|
||||
Item itemThaumLeggings = GameRegistry.findItem("Thaumcraft", "ItemLeggingsThaumium");
|
||||
Item itemThaumBoots = GameRegistry.findItem("Thaumcraft", "ItemBootsThaumium");
|
||||
|
||||
|
||||
if (itemGoggles != null)
|
||||
{
|
||||
BindingRegistry.registerRecipe(new ItemStack(ModItems.sanguineHelmet), itemGoggles);
|
||||
|
||||
}
|
||||
|
||||
if(itemThaumChest != null)
|
||||
{
|
||||
BindingRegistry.registerRecipe(new ItemStack(ModItems.sanguineRobe), new ItemStack(itemThaumChest));
|
||||
}
|
||||
|
||||
if(itemThaumLeggings != null)
|
||||
{
|
||||
BindingRegistry.registerRecipe(new ItemStack(ModItems.sanguinePants), new ItemStack(itemThaumLeggings));
|
||||
}
|
||||
|
||||
if(itemThaumBoots != null)
|
||||
{
|
||||
BindingRegistry.registerRecipe(new ItemStack(ModItems.sanguineBoots), new ItemStack(itemThaumBoots));
|
||||
}
|
||||
|
||||
//LogHelper.log(Level.INFO, "Loaded RP2 World addon");
|
||||
|
@ -899,7 +934,7 @@ public class AlchemicalWizardry
|
|||
}else
|
||||
{
|
||||
this.isForestryLoaded = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void initAlchemyPotionRecipes()
|
||||
|
@ -928,6 +963,7 @@ public class AlchemicalWizardry
|
|||
AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.arrow), AlchemicalWizardry.customPotionReciprocation.id, 1 * 60 * 20);
|
||||
AlchemicalPotionCreationHandler.addPotion(new ItemStack(Items.ender_pearl),AlchemicalWizardry.customPotionPlanarBinding.id,1*60*20);
|
||||
AlchemicalPotionCreationHandler.addPotion(new ItemStack(Blocks.soul_sand),AlchemicalWizardry.customPotionSoulFray.id,30*20);
|
||||
AlchemicalPotionCreationHandler.addPotion(new ItemStack(ModItems.baseItems,1,16),AlchemicalWizardry.customPotionSoulHarden.id,30*20);
|
||||
}
|
||||
|
||||
public static void initAltarRecipes()
|
||||
|
@ -965,19 +1001,19 @@ public class AlchemicalWizardry
|
|||
|
||||
public static void initRituals()
|
||||
{
|
||||
Rituals.registerRitual("AW001Water", 1, 500, new RitualEffectWater(), "Ritual of the Full Spring");
|
||||
Rituals.registerRitual("AW002Lava", 1, 10000, new RitualEffectLava(), "Serenade of the Nether");
|
||||
Rituals.registerRitual("AW003GreenGrove", 1, 1000, new RitualEffectGrowth(), "Ritual of the Green Grove");
|
||||
Rituals.registerRitual("AW004Interdiction", 1, 1000, new RitualEffectInterdiction(), "Interdiction Ritual");
|
||||
Rituals.registerRitual("AW001Water", 1, 500, new RitualEffectWater(), "Ritual of the Full Spring", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,30,255,255,0,0.501,0.8,0, 1.5));
|
||||
Rituals.registerRitual("AW002Lava", 1, 10000, new RitualEffectLava(), "Serenade of the Nether", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),255,0,0,255,0,0.501,0.8,0, 1.5));
|
||||
Rituals.registerRitual("AW003GreenGrove", 1, 1000, new RitualEffectGrowth(), "Ritual of the Green Grove", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),244,164,96,255,0,1.0,1.6,0, 1.5));
|
||||
Rituals.registerRitual("AW004Interdiction", 1, 1000, new RitualEffectInterdiction(), "Interdiction Ritual", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/SimpleTransCircle.png"),0,0,255,255,0,0.501,0.8,0, 1.5));
|
||||
Rituals.registerRitual("AW005Containment", 1, 2000, new RitualEffectContainment(), "Ritual of Containment");
|
||||
Rituals.registerRitual("AW006Binding", 1, 5000, new RitualEffectSoulBound(), "Ritual of Binding");
|
||||
Rituals.registerRitual("AW006Binding", 1, 5000, new RitualEffectSoulBound(), "Ritual of Binding", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/TransCircleBinding.png"),193,7,7,255,0,0.501,1.0,0, 2.5));
|
||||
Rituals.registerRitual("AW007Unbinding", 1, 30000, new RitualEffectUnbinding(), "Ritual of Unbinding");
|
||||
Rituals.registerRitual("AW008HighJump", 1, 1000, new RitualEffectJumping(), "Ritual of the High Jump");
|
||||
Rituals.registerRitual("AW009Magnetism", 1, 5000, new RitualEffectMagnetic(), "Ritual of Magnetism");
|
||||
Rituals.registerRitual("AW010Crusher", 1, 2500, new RitualEffectCrushing(), "Ritual of the Crusher");
|
||||
Rituals.registerRitual("AW011Speed", 1, 1000, new RitualEffectLeap(), "Ritual of Speed");
|
||||
Rituals.registerRitual("AW012AnimalGrowth", 1, 10000, new RitualEffectAnimalGrowth(), "Ritual of the Shepherd");
|
||||
Rituals.registerRitual("AW013Suffering", 1, 50000, new RitualEffectWellOfSuffering(), "Well of Suffering");
|
||||
Rituals.registerRitual("AW012AnimalGrowth", 1, 10000, new RitualEffectAnimalGrowth(), "Ritual of the Shepherd");
|
||||
Rituals.registerRitual("AW013Suffering", 1, 50000, new RitualEffectWellOfSuffering(), "Well of Suffering", new AlchemyCircleRenderer(new ResourceLocation("alchemicalwizardry:textures/models/TransCircleSuffering.png"),0,0,0,255,0,0.501,0.8,0, 2.5));
|
||||
Rituals.registerRitual("AW014Regen", 1, 25000, new RitualEffectHealing(), "Ritual of Regeneration");
|
||||
Rituals.registerRitual("AW015FeatheredKnife", 1, 50000, new RitualEffectFeatheredKnife(), "Ritual of the Feathered Knife");
|
||||
Rituals.registerRitual("AW016FeatheredEarth", 2, 100000, new RitualEffectFeatheredEarth(), "Ritual of the Feathered Earth");
|
||||
|
@ -1010,4 +1046,9 @@ public class AlchemicalWizardry
|
|||
HarvestRegistry.registerHarvestHandler(new GourdHarvestHandler());
|
||||
HarvestRegistry.registerHarvestHandler(new CactusReedHarvestHandler());
|
||||
}
|
||||
|
||||
public static void initCombinedAlchemyPotionRecipes()
|
||||
{
|
||||
CombinedPotionRegistry.registerCombinedPotionRecipe(customPotionFlameCloak, Potion.moveSpeed, Potion.regeneration);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
/**
|
||||
* Created with IntelliJ IDEA.
|
||||
|
@ -50,6 +48,7 @@ public class BloodMagicConfiguration
|
|||
AlchemicalWizardry.customPotionFireFuseID = config.get("Potion ID","FireFuse",109).getInt();
|
||||
AlchemicalWizardry.customPotionPlanarBindingID = config.get("Potion ID","PlanarBinding",110).getInt();
|
||||
AlchemicalWizardry.customPotionSoulFrayID = config.get("Potion ID","SoulFray",111).getInt();
|
||||
AlchemicalWizardry.customPotionSoulHardenID = config.get("Potion ID", "SoulHarden", 112).getInt();
|
||||
|
||||
MeteorParadigm.maxChance = config.get("meteor", "maxChance", 1000).getInt();
|
||||
AlchemicalWizardry.doMeteorsDestroyBlocks = config.get("meteor", "doMeteorsDestroyBlocks", true).getBoolean(true);
|
||||
|
@ -66,6 +65,9 @@ public class BloodMagicConfiguration
|
|||
|
||||
AlchemicalWizardry.wimpySettings = config.get("WimpySettings","IDontLikeFun",false).getBoolean(false);
|
||||
AlchemicalWizardry.respawnWithDebuff = config.get("WimpySettings", "RespawnWithDebuff", true).getBoolean();
|
||||
// AlchemicalWizardry.lockdownAltar = config.get("WimpySettings", "LockdownAltarWithRegen", true).getBoolean();
|
||||
AlchemicalWizardry.lockdownAltar = false;
|
||||
|
||||
|
||||
} catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -10,6 +10,7 @@ import WayofTime.alchemicalWizardry.common.block.BlockHomHeart;
|
|||
import WayofTime.alchemicalWizardry.common.block.BlockMasterStone;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockPedestal;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockPlinth;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockReagentConduit;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockSchematicSaver;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockSocket;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockSpectralContainer;
|
||||
|
@ -80,6 +81,7 @@ public class ModBlocks
|
|||
public static Block blockSpectralContainer;
|
||||
public static Block blockBuildingSchematicSaver;
|
||||
public static Block blockDemonPortal;
|
||||
public static Block blockReagentConduit;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
|
@ -113,6 +115,7 @@ public class ModBlocks
|
|||
blockSpectralContainer = new BlockSpectralContainer();
|
||||
blockDemonPortal = new BlockDemonPortal();
|
||||
blockBuildingSchematicSaver = new BlockSchematicSaver();
|
||||
blockReagentConduit = new BlockReagentConduit();
|
||||
|
||||
blockLifeEssence = new LifeEssenceBlock();
|
||||
}
|
||||
|
@ -152,7 +155,7 @@ public class ModBlocks
|
|||
GameRegistry.registerBlock(ModBlocks.blockSpectralContainer, "spectralContainer");
|
||||
GameRegistry.registerBlock(ModBlocks.blockDemonPortal, "demonPortalMain");
|
||||
GameRegistry.registerBlock(ModBlocks.blockBuildingSchematicSaver, "blockSchemSaver");
|
||||
|
||||
GameRegistry.registerBlock(ModBlocks.blockReagentConduit, "blockReagentConduit");
|
||||
}
|
||||
|
||||
public static void registerBlocksInInit()
|
||||
|
|
|
@ -44,6 +44,7 @@ import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask;
|
|||
import WayofTime.alchemicalWizardry.common.items.potion.AlchemyReagent;
|
||||
import WayofTime.alchemicalWizardry.common.items.potion.AverageLengtheningCatalyst;
|
||||
import WayofTime.alchemicalWizardry.common.items.potion.AveragePowerCatalyst;
|
||||
import WayofTime.alchemicalWizardry.common.items.potion.CombinationalCatalyst;
|
||||
import WayofTime.alchemicalWizardry.common.items.potion.EnhancedFillingAgent;
|
||||
import WayofTime.alchemicalWizardry.common.items.potion.GreaterLengtheningCatalyst;
|
||||
import WayofTime.alchemicalWizardry.common.items.potion.GreaterPowerCatalyst;
|
||||
|
@ -159,6 +160,9 @@ public class ModItems
|
|||
public static Item weakBindingAgent;
|
||||
public static Item itemRitualDiviner;
|
||||
public static Item sanguineHelmet;
|
||||
public static Item sanguineRobe;
|
||||
public static Item sanguinePants;
|
||||
public static Item sanguineBoots;
|
||||
public static Item focusBloodBlast;
|
||||
public static Item focusGravityWell;
|
||||
public static Item sigilOfMagnetism;
|
||||
|
@ -172,6 +176,7 @@ public class ModItems
|
|||
public static Item itemSigilOfSupression;
|
||||
public static Item itemFluidSigil;
|
||||
public static Item itemSeerSigil;
|
||||
public static Item itemCombinationalCatalyst;
|
||||
|
||||
public static Item customTool;
|
||||
|
||||
|
@ -264,6 +269,7 @@ public class ModItems
|
|||
itemFluidSigil = new ItemFluidSigil().setUnlocalizedName("itemFluidSigil");
|
||||
itemSeerSigil = new ItemSeerSigil().setUnlocalizedName("itemSeerSigil");
|
||||
customTool = new ItemSpellMultiTool().setUnlocalizedName("multiTool");
|
||||
itemCombinationalCatalyst = new CombinationalCatalyst().setUnlocalizedName("itemCombinationalCatalyst");
|
||||
}
|
||||
|
||||
public static void registerItems()
|
||||
|
@ -358,6 +364,7 @@ public class ModItems
|
|||
GameRegistry.registerItem(ModItems.customTool, "customTool");
|
||||
|
||||
GameRegistry.registerItem(ModItems.bucketLife, "bucketLife");
|
||||
GameRegistry.registerItem(ModItems.itemCombinationalCatalyst, "itemCombinationalCatalyst");
|
||||
|
||||
GameRegistry.registerItem(ModItems.baseItems, "bloodMagicBaseItems");
|
||||
GameRegistry.registerItem(ModItems.baseAlchemyItems, "bloodMagicBaseAlchemyItems");
|
||||
|
|
|
@ -23,6 +23,11 @@ public class BindingRecipe
|
|||
return this.requiredItem.isItemEqual(testStack);
|
||||
}
|
||||
|
||||
public ItemStack getResult(ItemStack inputItem)
|
||||
{
|
||||
return this.getResult();
|
||||
}
|
||||
|
||||
public ItemStack getResult()
|
||||
{
|
||||
return this.outputItem;
|
||||
|
|
|
@ -33,7 +33,7 @@ public class BindingRegistry
|
|||
{
|
||||
if(recipe.doesRequiredItemMatch(testItem))
|
||||
{
|
||||
return recipe.getResult().copy();
|
||||
return recipe.getResult(testItem).copy();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.api.rituals;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IMasterRitualStone
|
||||
|
|
|
@ -5,9 +5,9 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import scala.reflect.internal.Trees.This;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.MRSRenderer;
|
||||
|
||||
public class Rituals
|
||||
{
|
||||
|
@ -15,22 +15,28 @@ public class Rituals
|
|||
private int actCost;
|
||||
private RitualEffect effect;
|
||||
private String name;
|
||||
|
||||
private MRSRenderer customRenderer;
|
||||
|
||||
public static Map<String,Rituals> ritualMap = new HashMap();
|
||||
@Deprecated
|
||||
public static List<Rituals> ritualList = new LinkedList();
|
||||
public static List<String> keyList = new LinkedList();
|
||||
|
||||
public Rituals(int crystalLevel, int actCost, RitualEffect effect, String name)
|
||||
public Rituals(int crystalLevel, int actCost, RitualEffect effect, String name, MRSRenderer renderer)
|
||||
{
|
||||
this.crystalLevel = crystalLevel; //For a test commit
|
||||
this.crystalLevel = crystalLevel;
|
||||
this.actCost = actCost;
|
||||
this.effect = effect;
|
||||
this.name = name;
|
||||
keyList.add(name);
|
||||
ritualMap.put(name, this);
|
||||
this.customRenderer = renderer;
|
||||
}
|
||||
|
||||
public Rituals(int crystalLevel, int actCost, RitualEffect effect, String name)
|
||||
{
|
||||
this(crystalLevel, actCost, effect, name, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Static method to register a ritual to the Ritual Registry
|
||||
* @param key Unique identification key - must be different from all others to properly register
|
||||
|
@ -40,6 +46,22 @@ public class Rituals
|
|||
* @param name The name of the ritual
|
||||
* @return Returns true if properly registered, or false if the key is already used
|
||||
*/
|
||||
public static boolean registerRitual(String key, int crystalLevel, int actCost, RitualEffect effect, String name, MRSRenderer renderer)
|
||||
{
|
||||
if(ritualMap.containsKey(key))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Rituals ritual = new Rituals(crystalLevel, actCost, effect, name, renderer);
|
||||
ritual.removeRitualFromList();
|
||||
ritualMap.put(key, ritual);
|
||||
keyList.add(key);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean registerRitual(String key, int crystalLevel, int actCost, RitualEffect effect, String name)
|
||||
{
|
||||
if(ritualMap.containsKey(key))
|
||||
|
@ -270,6 +292,11 @@ public class Rituals
|
|||
{
|
||||
return this.crystalLevel;
|
||||
}
|
||||
|
||||
private MRSRenderer getRenderer()
|
||||
{
|
||||
return this.customRenderer;
|
||||
}
|
||||
|
||||
public static void performEffect(IMasterRitualStone ritualStone, String ritualID)
|
||||
{
|
||||
|
@ -330,4 +357,18 @@ public class Rituals
|
|||
|
||||
return firstKey;
|
||||
}
|
||||
|
||||
public static MRSRenderer getRendererForKey(String ritualID)
|
||||
{
|
||||
if(ritualMap.containsKey(ritualID))
|
||||
{
|
||||
Rituals ritual = ritualMap.get(ritualID);
|
||||
if(ritual != null)
|
||||
{
|
||||
return ritual.getRenderer();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,13 +23,16 @@ import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjecti
|
|||
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityMeteor;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderConduit;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderMasterStone;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderPedestal;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderPlinth;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderReagentConduit;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellEffectBlock;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellEnhancementBlock;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellModifierBlock;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellParadigmBlock;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderWritingTable;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.ShaderHelper;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.TEAltarRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEAltarItemRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEConduitItemRenderer;
|
||||
|
@ -61,8 +64,10 @@ import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderMeteor;
|
|||
import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEnhancementBlock;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock;
|
||||
|
@ -122,7 +127,9 @@ public class ClientProxy extends CommonProxy
|
|||
ClientRegistry.bindTileEntitySpecialRenderer(TESpellEnhancementBlock.class, new RenderSpellEnhancementBlock());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TESpellParadigmBlock.class, new RenderSpellParadigmBlock());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TESpellModifierBlock.class, new RenderSpellModifierBlock());
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TEReagentConduit.class, new RenderReagentConduit());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TEMasterStone.class, new RenderMasterStone());
|
||||
|
||||
//Item Renderer stuff
|
||||
MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockConduit), new TEConduitItemRenderer());
|
||||
MinecraftForgeClient.registerItemRenderer(ItemBlock.getItemFromBlock(ModBlocks.blockSpellEffect), new TESpellEffectBlockItemRenderer());
|
||||
|
@ -132,6 +139,8 @@ public class ClientProxy extends CommonProxy
|
|||
|
||||
//RenderingRegistry.registerEntityRenderingHandler(FireProjectile.class, new RenderFireProjectile());
|
||||
//RenderingRegistry.registerBlockHandler(new AltarRenderer());
|
||||
|
||||
ShaderHelper.initShaders();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEOrientable;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth;
|
||||
|
@ -58,12 +59,6 @@ public enum NewPacketHandler
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This is only called on the client side - it adds an
|
||||
* {@link IronChestMessageHandler} to the client side pipeline, since the
|
||||
* only place we expect to <em>handle</em> messages is on the client.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void addClientHandler()
|
||||
{
|
||||
|
@ -79,6 +74,7 @@ public enum NewPacketHandler
|
|||
clientChannel.pipeline().addAfter(tileAltarCodec, "TEWritingTableHandler", new TEWritingTableMessageHandler());
|
||||
clientChannel.pipeline().addAfter(tileAltarCodec, "ParticleHandler", new ParticleMessageHandler());
|
||||
clientChannel.pipeline().addAfter(tileAltarCodec, "VelocityHandler", new VelocityMessageHandler());
|
||||
clientChannel.pipeline().addAfter(tileAltarCodec, "TEMasterStoneHandler", new TEMasterStoneMessageHandler());
|
||||
}
|
||||
|
||||
|
||||
|
@ -229,6 +225,23 @@ public enum NewPacketHandler
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class TEMasterStoneMessageHandler extends SimpleChannelInboundHandler<TEMasterStoneMessage>
|
||||
{
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext ctx, TEMasterStoneMessage msg) throws Exception
|
||||
{
|
||||
World world = AlchemicalWizardry.proxy.getClientWorld();
|
||||
TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z);
|
||||
if (te instanceof TEMasterStone)
|
||||
{
|
||||
TEMasterStone masterStone = (TEMasterStone) te;
|
||||
|
||||
masterStone.setCurrentRitual(msg.ritual);
|
||||
masterStone.isRunning = msg.isRunning;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class BMMessage
|
||||
{
|
||||
|
@ -320,6 +333,16 @@ public enum NewPacketHandler
|
|||
double yVel;
|
||||
double zVel;
|
||||
}
|
||||
|
||||
public static class TEMasterStoneMessage extends BMMessage
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
|
||||
String ritual;
|
||||
boolean isRunning;
|
||||
}
|
||||
|
||||
private class TEAltarCodec extends FMLIndexedMessageToMessageCodec<BMMessage>
|
||||
{
|
||||
|
@ -334,6 +357,7 @@ public enum NewPacketHandler
|
|||
addDiscriminator(6, TEWritingTableMessage.class);
|
||||
addDiscriminator(7, ParticleMessage.class);
|
||||
addDiscriminator(8, VelocityMessage.class);
|
||||
addDiscriminator(9, TEMasterStoneMessage.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -497,6 +521,22 @@ public enum NewPacketHandler
|
|||
target.writeDouble(((VelocityMessage)msg).yVel);
|
||||
target.writeDouble(((VelocityMessage)msg).zVel);
|
||||
|
||||
break;
|
||||
|
||||
case 9:
|
||||
target.writeInt(((TEMasterStoneMessage)msg).x);
|
||||
target.writeInt(((TEMasterStoneMessage)msg).y);
|
||||
target.writeInt(((TEMasterStoneMessage)msg).z);
|
||||
|
||||
String ritual = ((TEMasterStoneMessage)msg).ritual;
|
||||
target.writeInt(ritual.length());
|
||||
for(int i=0; i<ritual.length(); i++)
|
||||
{
|
||||
target.writeChar(ritual.charAt(i));
|
||||
}
|
||||
|
||||
target.writeBoolean(((TEMasterStoneMessage)msg).isRunning);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -669,6 +709,22 @@ public enum NewPacketHandler
|
|||
((VelocityMessage)msg).zVel = dat.readDouble();
|
||||
|
||||
break;
|
||||
|
||||
case 9:
|
||||
((TEMasterStoneMessage)msg).x = dat.readInt();
|
||||
((TEMasterStoneMessage)msg).y = dat.readInt();
|
||||
((TEMasterStoneMessage)msg).z = dat.readInt();
|
||||
|
||||
int ritualStrSize = dat.readInt();
|
||||
String ritual = "";
|
||||
|
||||
for (int i = 0; i < ritualStrSize; i++)
|
||||
{
|
||||
ritual = ritual + dat.readChar();
|
||||
}
|
||||
|
||||
((TEMasterStoneMessage)msg).ritual = ritual;
|
||||
((TEMasterStoneMessage)msg).isRunning = dat.readBoolean();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -787,6 +843,20 @@ public enum NewPacketHandler
|
|||
return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg);
|
||||
}
|
||||
|
||||
public static Packet getPacket(TEMasterStone tile)
|
||||
{
|
||||
TEMasterStoneMessage msg = new TEMasterStoneMessage();
|
||||
msg.index = 9;
|
||||
msg.x = tile.xCoord;
|
||||
msg.y = tile.yCoord;
|
||||
msg.z = tile.zCoord;
|
||||
|
||||
msg.ritual = tile.getCurrentRitual();
|
||||
msg.isRunning = tile.isRunning;
|
||||
|
||||
return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg);
|
||||
}
|
||||
|
||||
public void sendTo(Packet message, EntityPlayerMP player)
|
||||
{
|
||||
this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER);
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package WayofTime.alchemicalWizardry.common.alchemy;
|
||||
|
||||
import net.minecraft.potion.Potion;
|
||||
|
||||
public class CombinedPotionComponent
|
||||
{
|
||||
public Potion result;
|
||||
public Potion pot1;
|
||||
public Potion pot2;
|
||||
|
||||
public CombinedPotionComponent(Potion result, Potion pot1, Potion pot2)
|
||||
{
|
||||
this.result = result;
|
||||
this.pot1 = pot1;
|
||||
this.pot2 = pot2;
|
||||
}
|
||||
|
||||
public boolean isRecipeValid(Potion test1, Potion test2)
|
||||
{
|
||||
return (test1 == pot1 && test2 == pot2) || (test1 == pot2 && test2 == pot1);
|
||||
}
|
||||
|
||||
public boolean isRecipeValid(int test1, int test2)
|
||||
{
|
||||
return (test1 == pot1.id && test2 == pot2.id) || (test1 == pot2.id && test2 == pot1.id);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,182 @@
|
|||
package WayofTime.alchemicalWizardry.common.alchemy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper;
|
||||
import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask;
|
||||
|
||||
public class CombinedPotionRegistry
|
||||
{
|
||||
public static List<CombinedPotionComponent> potionList = new ArrayList();
|
||||
|
||||
public static void registerCombinedPotionRecipe(Potion result, Potion pot1, Potion pot2)
|
||||
{
|
||||
potionList.add(new CombinedPotionComponent(result, pot1, pot2));
|
||||
}
|
||||
|
||||
public static boolean isRecipeValid(Potion pot1, Potion pot2)
|
||||
{
|
||||
for(CombinedPotionComponent recipe : potionList)
|
||||
{
|
||||
if(recipe.isRecipeValid(pot1, pot2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isRecipeValid(int pot1, int pot2)
|
||||
{
|
||||
for(CombinedPotionComponent recipe : potionList)
|
||||
{
|
||||
if(recipe.isRecipeValid(pot1, pot2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Potion getPotion(Potion pot1, Potion pot2)
|
||||
{
|
||||
for(CombinedPotionComponent recipe : potionList)
|
||||
{
|
||||
if(recipe.isRecipeValid(pot1, pot2))
|
||||
{
|
||||
return recipe.result;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Potion getPotion(int pot1, int pot2)
|
||||
{
|
||||
for(CombinedPotionComponent recipe : potionList)
|
||||
{
|
||||
if(recipe.isRecipeValid(pot1, pot2))
|
||||
{
|
||||
return recipe.result;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ItemStack applyPotionEffect(ItemStack stack)
|
||||
{
|
||||
if(stack == null || !(stack.getItem() instanceof AlchemyFlask))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
List<AlchemyPotionHelper> list = AlchemyFlask.getEffects(stack);
|
||||
if(list == null)
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
|
||||
boolean isDone = false;
|
||||
|
||||
for(AlchemyPotionHelper helper1 : list)
|
||||
{
|
||||
if(isDone)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for(int i=0; i<list.size(); i++)
|
||||
{
|
||||
if(isDone)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
AlchemyPotionHelper helper2 = list.get(i);
|
||||
|
||||
PotionEffect potEffect = getResultantPotion(helper1, helper2);
|
||||
|
||||
if(potEffect != null)
|
||||
{
|
||||
AlchemyPotionHelper potHelper = new AlchemyPotionHelper(potEffect.getPotionID(), potEffect.getDuration(), 0, potEffect.getAmplifier());
|
||||
|
||||
list.remove(helper1);
|
||||
list.remove(helper2);
|
||||
|
||||
list.add(potHelper);
|
||||
|
||||
isDone = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isDone)
|
||||
{
|
||||
AlchemyFlask.setEffects(stack, list);
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean hasCombinablePotionEffect(ItemStack stack)
|
||||
{
|
||||
if(stack == null || !(stack.getItem() instanceof AlchemyFlask))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
List<AlchemyPotionHelper> list = AlchemyFlask.getEffects(stack);
|
||||
if(list == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for(AlchemyPotionHelper helper1 : list)
|
||||
{
|
||||
for(AlchemyPotionHelper helper2 : list)
|
||||
{
|
||||
int pot1 = helper1.getPotionID();
|
||||
int pot2 = helper2.getPotionID();
|
||||
|
||||
if(isRecipeValid(pot1, pot2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static PotionEffect getResultantPotion(AlchemyPotionHelper potE1, AlchemyPotionHelper potE2)
|
||||
{
|
||||
if(potE1 == null || potE2 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int pot1 = potE1.getPotionID();
|
||||
int pot2 = potE2.getPotionID();
|
||||
|
||||
if(isRecipeValid(pot1, pot2))
|
||||
{
|
||||
int duration = (int)((potE1.getTickDuration()* Math.pow(8.0f / 3.0f, potE1.getdurationFactor()) + potE2.getdurationFactor() * Math.pow(8.0f / 3.0f, potE2.getdurationFactor()))/2.0);
|
||||
int amplifier = (potE1.getConcentration() + potE2.getConcentration())/2;
|
||||
|
||||
Potion pot = getPotion(pot1, pot2);
|
||||
|
||||
return new PotionEffect(pot.id, duration, amplifier);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.alchemy;
|
||||
|
||||
public interface ICombinationalCatalyst
|
||||
{
|
||||
|
||||
}
|
|
@ -18,9 +18,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
|
||||
public class BlockOrientable extends BlockContainer
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static IIcon[] fireIcons;
|
||||
|
||||
public BlockOrientable()
|
||||
{
|
||||
super(Material.rock);
|
||||
|
@ -31,67 +28,11 @@ public class BlockOrientable extends BlockContainer
|
|||
//func_111022_d("AlchemicalWizardry:blocks");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.fireIcons = this.registerIconsWithString(iconRegister, "fireEffectBlock");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static IIcon[] registerIconsWithString(IIconRegister iconRegister, String blockString)
|
||||
{
|
||||
IIcon[] icons = new IIcon[7];
|
||||
|
||||
icons[0] = iconRegister.registerIcon("AlchemicalWizardry:" + blockString + "_input");
|
||||
icons[1] = iconRegister.registerIcon("AlchemicalWizardry:" + blockString + "_output");
|
||||
icons[2] = iconRegister.registerIcon("AlchemicalWizardry:" + blockString + "_upArrow");
|
||||
icons[3] = iconRegister.registerIcon("AlchemicalWizardry:" + blockString + "_downArrow");
|
||||
icons[4] = iconRegister.registerIcon("AlchemicalWizardry:" + blockString + "_leftArrow");
|
||||
icons[5] = iconRegister.registerIcon("AlchemicalWizardry:" + blockString + "_rightArrow");
|
||||
icons[6] = iconRegister.registerIcon("AlchemicalWizardry:" + blockString + "_blank");
|
||||
|
||||
return icons;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta)
|
||||
{
|
||||
IIcon[] icons = this.getIconsForMeta(meta);
|
||||
switch (side)
|
||||
{
|
||||
case 4: return icons[1];
|
||||
default: return icons[6];
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
|
||||
*/
|
||||
public IIcon getBlockTexture(IBlockAccess par1IBlockAccess, int x, int y, int z, int side)
|
||||
{
|
||||
TileEntity tile = par1IBlockAccess.getTileEntity(x, y, z);
|
||||
int meta = par1IBlockAccess.getBlockMetadata(x, y, z);
|
||||
|
||||
if(tile instanceof TEOrientable)
|
||||
{
|
||||
ForgeDirection input = ((TEOrientable)tile).getInputDirection();
|
||||
ForgeDirection output = ((TEOrientable)tile).getOutputDirection();
|
||||
|
||||
return this.getIconsForMeta(meta)[this.getTextureIndexForSideAndOrientation(side, input, output)];
|
||||
}
|
||||
|
||||
return this.getIcon(side, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int dunno)
|
||||
|
@ -99,11 +40,6 @@ public class BlockOrientable extends BlockContainer
|
|||
return new TEOrientable();
|
||||
}
|
||||
|
||||
public IIcon[] getIconsForMeta(int metadata)
|
||||
{
|
||||
return this.fireIcons;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockReagentConduit extends BlockContainer
|
||||
{
|
||||
public BlockReagentConduit()
|
||||
{
|
||||
super(Material.rock);
|
||||
this.setBlockName("blockReagentConduit");
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
super.registerBlockIcons(iconRegister);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TEReagentConduit();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
// {
|
||||
// if (this.equals(ModBlocks.blockSpellParadigm))
|
||||
// {
|
||||
// par3List.add(new ItemStack(par1, 1, 0));
|
||||
// par3List.add(new ItemStack(par1, 1, 1));
|
||||
// par3List.add(new ItemStack(par1, 1, 2));
|
||||
// par3List.add(new ItemStack(par1, 1, 3));
|
||||
// } else
|
||||
// {
|
||||
// super.getSubBlocks(par1, par2CreativeTabs, par3List);
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are)
|
||||
{
|
||||
return super.onBlockActivated(world, x, y, z, player, side, what, these, are);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
|
@ -21,29 +21,13 @@ public class BlockSpellParadigm extends BlockOrientable
|
|||
{
|
||||
public static final float minPos = (3f/16f);
|
||||
public static final float maxPos = (13f/16f);
|
||||
|
||||
IIcon[] projectileIcons = new IIcon[7];
|
||||
|
||||
public BlockSpellParadigm()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("blockSpellParadigm");
|
||||
//setBlockBounds(minPos, minPos, minPos, maxPos, maxPos, maxPos);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.projectileIcons = this.registerIconsWithString(iconRegister, "projectileParadigmBlock");
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Icon[] getIconsForMeta(int metadata)
|
||||
// {
|
||||
// return this.projectileIcons;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
|
@ -109,104 +93,4 @@ public class BlockSpellParadigm extends BlockOrientable
|
|||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
//TODO Need to make a renderer for the paradigm blocks and other spell blocks.
|
||||
/*
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List arraylist, Entity par7Entity)
|
||||
{
|
||||
|
||||
setBlockBounds(minPos, minPos, minPos, maxPos, maxPos, maxPos);
|
||||
super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
|
||||
|
||||
|
||||
TileEntity tile1 = world.getBlockTileEntity(i, j, k);
|
||||
if (tile1 instanceof TESpellParadigmBlock)
|
||||
{
|
||||
TESpellParadigmBlock tileG = (TESpellParadigmBlock) tile1;
|
||||
|
||||
|
||||
if (tileG.isSideRendered(ForgeDirection.WEST))
|
||||
{
|
||||
setBlockBounds(0.0F, minPos, minPos, maxPos, maxPos, maxPos);
|
||||
super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
|
||||
}
|
||||
|
||||
|
||||
if (tileG.isSideRendered(ForgeDirection.EAST))
|
||||
{
|
||||
setBlockBounds(minPos, minPos, minPos, 1.0F, maxPos, maxPos);
|
||||
super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
|
||||
}
|
||||
|
||||
|
||||
if (tileG.isSideRendered(ForgeDirection.DOWN))
|
||||
{
|
||||
setBlockBounds(minPos, 0.0F, minPos, maxPos, maxPos, maxPos);
|
||||
super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
|
||||
}
|
||||
|
||||
|
||||
if (tileG.isSideRendered(ForgeDirection.UP))
|
||||
{
|
||||
setBlockBounds(minPos, minPos, minPos, maxPos, 1.0F, maxPos);
|
||||
super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
|
||||
}
|
||||
|
||||
|
||||
if (tileG.isSideRendered(ForgeDirection.NORTH))
|
||||
{
|
||||
setBlockBounds(minPos, minPos, 0.0F, maxPos, maxPos, maxPos);
|
||||
super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
|
||||
}
|
||||
|
||||
|
||||
if (tileG.isSideRendered(ForgeDirection.SOUTH))
|
||||
{
|
||||
setBlockBounds(minPos, minPos, minPos, maxPos, maxPos, 1.0F);
|
||||
super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
|
||||
}
|
||||
|
||||
|
||||
// float facadeThickness = TransportConstants.FACADE_THICKNESS;
|
||||
//
|
||||
//
|
||||
// if (tileG.hasFacade(ForgeDirection.EAST)) {
|
||||
// setBlockBounds(1 - facadeThickness, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
// super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// if (tileG.hasFacade(ForgeDirection.WEST)) {
|
||||
// setBlockBounds(0.0F, 0.0F, 0.0F, facadeThickness, 1.0F, 1.0F);
|
||||
// super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// if (tileG.hasFacade(ForgeDirection.UP)) {
|
||||
// setBlockBounds(0.0F, 1 - facadeThickness, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
// super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// if (tileG.hasFacade(ForgeDirection.DOWN)) {
|
||||
// setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, facadeThickness, 1.0F);
|
||||
// super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// if (tileG.hasFacade(ForgeDirection.SOUTH)) {
|
||||
// setBlockBounds(0.0F, 0.0F, 1 - facadeThickness, 1.0F, 1.0F, 1.0F);
|
||||
// super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// if (tileG.hasFacade(ForgeDirection.NORTH)) {
|
||||
// setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, facadeThickness);
|
||||
// super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
|
||||
// }
|
||||
}
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -66,9 +66,9 @@ public class ImperfectRitualStone extends Block
|
|||
if (world.isRemote)
|
||||
{
|
||||
world.setRainStrength(1.0F);
|
||||
world.setThunderStrength(1.0f);
|
||||
}
|
||||
|
||||
world.setThunderStrength(1.0f);
|
||||
world.getWorldInfo().setThunderTime(0);
|
||||
world.getWorldInfo().setThundering(true);
|
||||
return true;
|
||||
|
|
|
@ -49,13 +49,13 @@ public class EntityDemon extends EntityTameable implements IDemon
|
|||
|
||||
protected void dropFewItems(boolean par1, int par2)
|
||||
{
|
||||
if(!(this.getOwner() instanceof EntityPlayer))
|
||||
{
|
||||
return;
|
||||
}
|
||||
ItemStack drop = new ItemStack(ModItems.demonPlacer, 1, this.getDemonID());
|
||||
DemonPlacer.setOwnerName(drop, SpellHelper.getUsername((EntityPlayer)this.getOwner()));
|
||||
|
||||
if((this.getOwner() instanceof EntityPlayer))
|
||||
{
|
||||
DemonPlacer.setOwnerName(drop, SpellHelper.getUsername((EntityPlayer)this.getOwner()));
|
||||
}
|
||||
|
||||
if (this.hasCustomNameTag())
|
||||
{
|
||||
drop.setStackDisplayName(this.getCustomNameTag());
|
||||
|
|
|
@ -18,6 +18,7 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.common.ISpecialArmor;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
|
@ -28,8 +29,8 @@ import cpw.mods.fml.common.Optional.Interface;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@Optional.InterfaceList(value = {@Interface(iface="thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft"), @Interface(iface="thaumcraft.api.IGoggles", modid = "Thaumcraft")})
|
||||
public class BoundArmour extends ItemArmor implements ISpecialArmor,IBindable ,IRevealer, IGoggles
|
||||
@Optional.InterfaceList(value = {@Interface(iface="thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft"), @Interface(iface="thaumcraft.api.IGoggles", modid = "Thaumcraft"), @Interface(iface="thaumcraft.api.IRunicArmor", modid = "Thaumcraft")})
|
||||
public class BoundArmour extends ItemArmor implements ISpecialArmor,IBindable ,IRevealer, IGoggles, IRunicArmor
|
||||
{
|
||||
private static int invSize = 9;
|
||||
private static IIcon helmetIcon;
|
||||
|
@ -56,7 +57,6 @@ public class BoundArmour extends ItemArmor implements ISpecialArmor,IBindable ,I
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
if (this.equals(ModItems.boundHelmet))
|
||||
|
@ -91,6 +91,26 @@ public class BoundArmour extends ItemArmor implements ISpecialArmor,IBindable ,I
|
|||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot)
|
||||
{
|
||||
double armourReduction = 0.0;
|
||||
|
||||
if(player.isPotionActive(AlchemicalWizardry.customPotionSoulFray))
|
||||
{
|
||||
int i = player.getActivePotionEffect(AlchemicalWizardry.customPotionSoulFray).getAmplifier() + 1;
|
||||
|
||||
armourReduction = (i+1)*0.1;
|
||||
}
|
||||
|
||||
double damageAmount = 0.25;
|
||||
|
||||
if(!player.isPotionActive(AlchemicalWizardry.customPotionSoulHarden))
|
||||
{
|
||||
damageAmount *= 0.9;
|
||||
}
|
||||
|
||||
damageAmount *= (1.0-armourReduction);
|
||||
|
||||
int maxAbsorption = 100000;
|
||||
|
||||
if (source.equals(DamageSource.drown))
|
||||
{
|
||||
return new ArmorProperties(-1, 0, 0);
|
||||
|
@ -100,7 +120,7 @@ public class BoundArmour extends ItemArmor implements ISpecialArmor,IBindable ,I
|
|||
{
|
||||
if (isImmuneToVoid(armor))
|
||||
{
|
||||
return new ArmorProperties(-1, 3, 100000);
|
||||
return new ArmorProperties(-1, damageAmount, maxAbsorption);
|
||||
} else
|
||||
{
|
||||
return new ArmorProperties(-1, 0, 0);
|
||||
|
@ -121,17 +141,10 @@ public class BoundArmour extends ItemArmor implements ISpecialArmor,IBindable ,I
|
|||
{
|
||||
if (source.isUnblockable())
|
||||
{
|
||||
return new ArmorProperties(-1, 3, 4);
|
||||
}
|
||||
|
||||
if(player.isPotionActive(AlchemicalWizardry.customPotionSoulFray))
|
||||
{
|
||||
int i = player.getActivePotionEffect(AlchemicalWizardry.customPotionSoulFray).getAmplifier() + 1;
|
||||
|
||||
return new ArmorProperties(-1, 3, (int)(25*(1.0f - 0.15f*i)));
|
||||
return new ArmorProperties(-1, damageAmount * 0.8d, maxAbsorption);
|
||||
}
|
||||
|
||||
return new ArmorProperties(-1, 3, 100000);
|
||||
return new ArmorProperties(-1, damageAmount, maxAbsorption);
|
||||
}
|
||||
|
||||
return new ArmorProperties(-1, 0, 0);
|
||||
|
@ -410,6 +423,7 @@ public class BoundArmour extends ItemArmor implements ISpecialArmor,IBindable ,I
|
|||
{
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
itemTag = itemStack.stackTagCompound;
|
||||
|
||||
ItemStack[] inv = new ItemStack[9];
|
||||
NBTTagList tagList = itemTag.getTagList("Inventory", Constants.NBT.TAG_COMPOUND);
|
||||
|
@ -624,4 +638,60 @@ public class BoundArmour extends ItemArmor implements ISpecialArmor,IBindable ,I
|
|||
{
|
||||
return this.hasIGoggles(itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "Thaumcraft")
|
||||
public int getRunicCharge(ItemStack itemstack)
|
||||
{
|
||||
ItemStack[] inv = this.getInternalInventory(itemstack);
|
||||
int shardLevel = this.getMaxBloodShardLevel(itemstack);
|
||||
int count = 0;
|
||||
int harden = 0;
|
||||
|
||||
if(inv == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
for(ItemStack stack : inv)
|
||||
{
|
||||
if(count >= shardLevel)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if(stack == null || !(stack.getItem() instanceof ArmourUpgrade))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(stack.getItem() instanceof ItemArmor && ((ItemArmor)stack.getItem()).armorType != this.armorType)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(stack.hasTagCompound())
|
||||
{
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
|
||||
int enchLvl = tag.getByte("RS.HARDEN");
|
||||
|
||||
if(stack.getItem() instanceof IRunicArmor)
|
||||
{
|
||||
enchLvl += ((IRunicArmor)stack.getItem()).getRunicCharge(stack);
|
||||
}
|
||||
|
||||
if(enchLvl > 0)
|
||||
{
|
||||
harden += enchLvl;
|
||||
if(((ArmourUpgrade)stack.getItem()).isUpgrade())
|
||||
{
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return harden;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,6 +144,11 @@ public class ItemRitualDiviner extends EnergyItems
|
|||
{
|
||||
TEMasterStone masterStone = (TEMasterStone) tileEntity;
|
||||
List<RitualComponent> ritualList = Rituals.getRitualList(this.getCurrentRitual(par1ItemStack));
|
||||
if(ritualList == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int playerInvRitualStoneLocation = -1;
|
||||
|
||||
for (int i = 0; i < playerInventory.length; i++)
|
||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraft.util.DamageSource;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
@ -77,7 +78,8 @@ public class SacrificialDagger extends Item
|
|||
par2World.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
|
||||
}
|
||||
|
||||
if (!par2World.isRemote && !(par3EntityPlayer.getClass().equals(EntityPlayerMP.class)))
|
||||
if(!par2World.isRemote && SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
|
||||
//if (!(par3EntityPlayer.getClass().equals(EntityPlayerMP.class)))
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ public class AlchemyFlask extends Item
|
|||
}
|
||||
}
|
||||
|
||||
public void setEffects(ItemStack par1ItemStack, ArrayList<AlchemyPotionHelper> list)
|
||||
public static void setEffects(ItemStack par1ItemStack, List<AlchemyPotionHelper> list)
|
||||
{
|
||||
NBTTagCompound itemTag = par1ItemStack.stackTagCompound;
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.potion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.alchemy.ICombinationalCatalyst;
|
||||
|
||||
public class CombinationalCatalyst extends Item implements ICombinationalCatalyst
|
||||
{
|
||||
public CombinationalCatalyst()
|
||||
{
|
||||
super();
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:CombinationalCatalyst");
|
||||
}
|
||||
}
|
|
@ -3,27 +3,20 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
|
|||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockCocoa;
|
||||
import net.minecraft.block.BlockCrops;
|
||||
import net.minecraft.block.BlockDirectional;
|
||||
import net.minecraft.block.BlockMushroom;
|
||||
import net.minecraft.block.BlockSapling;
|
||||
import net.minecraft.block.BlockStem;
|
||||
import net.minecraft.block.IGrowable;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.BonemealEvent;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.alchemy.ICombinationalCatalyst;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
|
|
@ -1,169 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.thaumcraft;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class FocusBase extends EnergyItems //implements IWandFocus
|
||||
{
|
||||
protected IIcon ornament, depth;
|
||||
|
||||
public FocusBase()
|
||||
{
|
||||
super();
|
||||
setMaxDamage(1);
|
||||
setNoRepair();
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
boolean hasOrnament()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean hasDepth()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
super.registerIcons(iconRegister);
|
||||
// if(hasOrnament())
|
||||
// {
|
||||
// ornament = iconRegister.registerIcon("AlchemicalWizardry:" + this.getUnlocalizedName() + "Orn");
|
||||
// }
|
||||
// if(hasDepth())
|
||||
// {
|
||||
// depth = iconRegister.registerIcon("AlchemicalWizardry:" + this.getUnlocalizedName() + "Depth");
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemTool(ItemStack par1ItemStack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/*erride
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
AspectList cost = getVisCost();
|
||||
|
||||
if (cost != null && cost.size() > 0)
|
||||
{
|
||||
par3List.add(StatCollector.translateToLocal(isVisCostPerTick() ? "item.Focus.cost2" : "item.Focus.cost1"));
|
||||
|
||||
for (Aspect aspect : cost.getAspectsSorted())
|
||||
{
|
||||
float amount = cost.getAmount(aspect) / 100.0F;
|
||||
par3List.add(" " + '\u00a7' + aspect.getChatcolor() + aspect.getName() + '\u00a7' + "r x " + amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability()
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack itemstack)
|
||||
{
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getOrnament()
|
||||
{
|
||||
return ornament;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getFocusDepthLayerIcon()
|
||||
{
|
||||
return depth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WandFocusAnimation getAnimation()
|
||||
{
|
||||
return WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisCostPerTick()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isUseItem()
|
||||
{
|
||||
return isVisCostPerTick();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onFocusRightClick(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, MovingObjectPosition paramMovingObjectPosition)
|
||||
{
|
||||
if (isUseItem())
|
||||
{
|
||||
paramEntityPlayer.setItemInUse(paramItemStack, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
return paramItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingFocusTick(ItemStack paramItemStack, EntityPlayer paramEntityPlayer, int paramInt)
|
||||
{
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStoppedUsingFocus(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, int paramInt)
|
||||
{
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack paramItemStack)
|
||||
{
|
||||
return "00";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onFocusBlockStartBreak(ItemStack paramItemStack, int paramInt1, int paramInt2, int paramInt3, EntityPlayer paramEntityPlayer)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptsEnchant(int id)
|
||||
{
|
||||
if (id == ThaumcraftApi.enchantFrugal ||
|
||||
id == ThaumcraftApi.enchantPotency)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
|
@ -1,191 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.thaumcraft;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class FocusBloodBlast extends FocusBase
|
||||
{
|
||||
//private static final AspectList visUsage = new AspectList().add(Aspect.AIR, 15).add(Aspect.ENTROPY, 45);
|
||||
|
||||
private final int maxCooldown = 7;
|
||||
|
||||
public static Map<String,Integer> playerCooldown = new HashMap();
|
||||
|
||||
public FocusBloodBlast()
|
||||
{
|
||||
super();
|
||||
this.setUnlocalizedName("focusBloodBlast");
|
||||
this.setEnergyUsed(100);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
super.registerIcons(iconRegister);
|
||||
|
||||
if (hasOrnament())
|
||||
{
|
||||
ornament = iconRegister.registerIcon("AlchemicalWizardry:" + "focusBloodBlast" + "Orn");
|
||||
}
|
||||
|
||||
if (hasDepth())
|
||||
{
|
||||
depth = iconRegister.registerIcon("AlchemicalWizardry:" + "focusBloodBlast" + "Depth");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
//super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public void onUsingFocusTick(ItemStack stack, EntityPlayer par3EntityPlayer, int ticks)
|
||||
{
|
||||
if (AlchemicalWizardry.isThaumcraftLoaded)
|
||||
{
|
||||
Item item = stack.getItem();
|
||||
Class clazz = item.getClass();
|
||||
|
||||
while (!clazz.getName().equals("thaumcraft.common.items.wands.ItemWandCasting"))
|
||||
{
|
||||
if (clazz == Object.class)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
|
||||
//Item testItem = item.set
|
||||
|
||||
//Method consumeAllVis = null;
|
||||
try
|
||||
{
|
||||
if (!playerCooldown.containsKey(par3EntityPlayer.username))
|
||||
{
|
||||
playerCooldown.put(par3EntityPlayer.username, 0);
|
||||
}
|
||||
|
||||
Method getFocusItem = clazz.getMethod("getFocusItem", ItemStack.class);
|
||||
ItemStack focusStack = (ItemStack) getFocusItem.invoke(item, stack);
|
||||
//int potency = EnchantmentHelper.getEnchantmentLevel(ThaumcraftApi.enchantPotency, focusStack);
|
||||
int cooldown = playerCooldown.get(par3EntityPlayer.username) + 1;
|
||||
playerCooldown.put(par3EntityPlayer.username, cooldown);
|
||||
|
||||
if (cooldown >= this.maxCooldown)
|
||||
{
|
||||
Method consumeAllVis = clazz.getMethod("consumeAllVis", ItemStack.class, EntityPlayer.class, AspectList.class, boolean.class);
|
||||
|
||||
if ((Boolean) consumeAllVis.invoke(item, stack, par3EntityPlayer, getVisCost(), true))
|
||||
{
|
||||
playerCooldown.put(par3EntityPlayer.username, 0);
|
||||
EnergyItems.checkAndSetItemOwner(focusStack, par3EntityPlayer);
|
||||
World world = par3EntityPlayer.worldObj;
|
||||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
this.syphonBatteries(focusStack, par3EntityPlayer, 100);
|
||||
}
|
||||
|
||||
//world.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
world.playSoundAtEntity(par3EntityPlayer, "thaumcraft:wand", 0.5F, 1F);
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
//par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage));
|
||||
world.spawnEntityInWorld(new EnergyBlastProjectile(world, par3EntityPlayer, (int) (5)));
|
||||
//this.setDelay(par1ItemStack, maxDelay);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (NoSuchMethodException e1)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
} catch (SecurityException e1)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
} catch (IllegalAccessException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IllegalArgumentException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStoppedUsingFocus(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, int paramInt)
|
||||
{
|
||||
playerCooldown.put(paramEntityPlayer.username, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack)
|
||||
{
|
||||
return "BLOODBLAST";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor()
|
||||
{
|
||||
return 0x8A0707;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost()
|
||||
{
|
||||
return visUsage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisCostPerTick()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WandFocusAnimation getAnimation()
|
||||
{
|
||||
return WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
boolean hasOrnament()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
}
|
|
@ -1,263 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.thaumcraft;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class FocusGravityWell extends FocusBase
|
||||
{
|
||||
//private static final AspectList visUsage = new AspectList().add(Aspect.AIR, 5).add(Aspect.ORDER, 5);
|
||||
|
||||
private final int maxCooldown = 1;
|
||||
|
||||
public static Map<String,Integer> playerCooldown = new HashMap();
|
||||
|
||||
public FocusGravityWell()
|
||||
{
|
||||
super();
|
||||
this.setUnlocalizedName("focusGravityWell");
|
||||
this.setEnergyUsed(100);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
super.registerIcons(iconRegister);
|
||||
|
||||
if (hasOrnament())
|
||||
{
|
||||
ornament = iconRegister.registerIcon("AlchemicalWizardry:" + "focusGravityWell" + "Orn");
|
||||
}
|
||||
|
||||
if (hasDepth())
|
||||
{
|
||||
depth = iconRegister.registerIcon("AlchemicalWizardry:" + "focusGravityWell" + "Depth");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
//super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
if (!(par1ItemStack.stackTagCompound == null))
|
||||
{
|
||||
if (!par1ItemStack.stackTagCompound.getString("ownerName").equals(""))
|
||||
{
|
||||
par3List.add("Current owner: " + par1ItemStack.stackTagCompound.getString("ownerName"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public void onUsingFocusTick(ItemStack stack, EntityPlayer par3EntityPlayer, int ticks)
|
||||
{
|
||||
if (AlchemicalWizardry.isThaumcraftLoaded)
|
||||
{
|
||||
Item item = stack.getItem();
|
||||
Class clazz = item.getClass();
|
||||
|
||||
while (!clazz.getName().equals("thaumcraft.common.items.wands.ItemWandCasting"))
|
||||
{
|
||||
if (clazz == Object.class)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
|
||||
//Item testItem = item.set
|
||||
|
||||
//Method consumeAllVis = null;
|
||||
try
|
||||
{
|
||||
if (!playerCooldown.containsKey(par3EntityPlayer.username))
|
||||
{
|
||||
playerCooldown.put(par3EntityPlayer.username, 0);
|
||||
}
|
||||
|
||||
Method getFocusItem = clazz.getMethod("getFocusItem", ItemStack.class);
|
||||
ItemStack focusStack = (ItemStack) getFocusItem.invoke(item, stack);
|
||||
//int potency = EnchantmentHelper.getEnchantmentLevel(ThaumcraftApi.enchantPotency, focusStack);
|
||||
int cooldown = playerCooldown.get(par3EntityPlayer.username) + 1;
|
||||
playerCooldown.put(par3EntityPlayer.username, cooldown);
|
||||
//if(cooldown>=this.maxCooldown)
|
||||
{
|
||||
Method consumeAllVis = clazz.getMethod("consumeAllVis", ItemStack.class, EntityPlayer.class, AspectList.class, boolean.class);
|
||||
|
||||
if ((Boolean) consumeAllVis.invoke(item, stack, par3EntityPlayer, getVisCost(), true))
|
||||
{
|
||||
playerCooldown.put(par3EntityPlayer.username, 0);
|
||||
EnergyItems.checkAndSetItemOwner(focusStack, par3EntityPlayer);
|
||||
Vec3 vector = par3EntityPlayer.getLookVec();
|
||||
float distance = 2;
|
||||
//if(par3EntityPlayer.worldObj.isRemote)
|
||||
{
|
||||
List<Entity> entities = par3EntityPlayer.worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX + vector.xCoord * distance - 0.5f, par3EntityPlayer.posY + vector.yCoord * distance - 0.5f, par3EntityPlayer.posZ + vector.zCoord * distance - 0.5f, par3EntityPlayer.posX + vector.xCoord * distance + 0.5f, par3EntityPlayer.posY + vector.yCoord * distance + 0.5f, par3EntityPlayer.posZ + vector.zCoord * distance + 0.5f).expand(1, 1, 1));
|
||||
|
||||
for (Entity entity : entities)
|
||||
{
|
||||
if (entity.getEntityName() == par3EntityPlayer.username)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
entity.motionX = par3EntityPlayer.posX + vector.xCoord * distance - entity.posX;
|
||||
entity.motionY = par3EntityPlayer.posY + vector.yCoord * distance - entity.posY;
|
||||
entity.motionZ = par3EntityPlayer.posZ + vector.zCoord * distance - entity.posZ;
|
||||
//entity.setVelocity(par3EntityPlayer.posX+vector.xCoord*distance-entity.posX, par3EntityPlayer.posY+vector.yCoord*distance-entity.posY, par3EntityPlayer.posZ+vector.zCoord*distance-entity.posZ);
|
||||
}
|
||||
}
|
||||
World world = par3EntityPlayer.worldObj;
|
||||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
this.syphonBatteriesWithoutParticles(focusStack, par3EntityPlayer, 10, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (NoSuchMethodException e1)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
} catch (SecurityException e1)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
} catch (IllegalAccessException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IllegalArgumentException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStoppedUsingFocus(ItemStack stack, World paramWorld, EntityPlayer par3EntityPlayer, int paramInt)
|
||||
{
|
||||
playerCooldown.put(par3EntityPlayer.username, 0);
|
||||
|
||||
if (AlchemicalWizardry.isThaumcraftLoaded)
|
||||
{
|
||||
Item item = stack.getItem();
|
||||
Class clazz = item.getClass();
|
||||
|
||||
while (!clazz.getName().equals("thaumcraft.common.items.wands.ItemWandCasting"))
|
||||
{
|
||||
if (clazz == Object.class)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
clazz = clazz.getSuperclass();
|
||||
}
|
||||
|
||||
//Item testItem = item.set
|
||||
|
||||
//Method consumeAllVis = null;
|
||||
try
|
||||
{
|
||||
Method getFocusItem = clazz.getMethod("getFocusItem", ItemStack.class);
|
||||
ItemStack focusStack = (ItemStack) getFocusItem.invoke(item, stack);
|
||||
int potency = EnchantmentHelper.getEnchantmentLevel(ThaumcraftApi.enchantPotency, focusStack);
|
||||
|
||||
if (potency > 0)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(focusStack, par3EntityPlayer);
|
||||
Vec3 vector = par3EntityPlayer.getLookVec();
|
||||
float distance = 2;
|
||||
//if(par3EntityPlayer.worldObj.isRemote)
|
||||
{
|
||||
List<Entity> entities = par3EntityPlayer.worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(par3EntityPlayer.posX + vector.xCoord * distance - 0.5f, par3EntityPlayer.posY + vector.yCoord * distance - 0.5f, par3EntityPlayer.posZ + vector.zCoord * distance - 0.5f, par3EntityPlayer.posX + vector.xCoord * distance + 0.5f, par3EntityPlayer.posY + vector.yCoord * distance + 0.5f, par3EntityPlayer.posZ + vector.zCoord * distance + 0.5f).expand(1, 1, 1));
|
||||
|
||||
for (Entity entity : entities)
|
||||
{
|
||||
if (entity.getEntityName() == par3EntityPlayer.username)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
float speed = 1.0F * potency;
|
||||
entity.motionX = vector.xCoord * speed;
|
||||
entity.motionY = vector.yCoord * speed;
|
||||
entity.motionZ = vector.zCoord * speed;
|
||||
//entity.setVelocity(par3EntityPlayer.posX+vector.xCoord*distance-entity.posX, par3EntityPlayer.posY+vector.yCoord*distance-entity.posY, par3EntityPlayer.posZ+vector.zCoord*distance-entity.posZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (NoSuchMethodException e1)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
} catch (SecurityException e1)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
} catch (IllegalAccessException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IllegalArgumentException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e)
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper(ItemStack itemstack)
|
||||
{
|
||||
return "BLOODBLAST";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor()
|
||||
{
|
||||
return 0x8A0707;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost()
|
||||
{
|
||||
return visUsage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisCostPerTick()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WandFocusAnimation getAnimation()
|
||||
{
|
||||
return WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
boolean hasOrnament()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
|
@ -8,10 +8,15 @@ import net.minecraft.entity.EntityLivingBase;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IRepairable;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
|
@ -20,13 +25,17 @@ import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGoggles, IVisDiscountGear, IRevealer
|
||||
public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGoggles, IVisDiscountGear, IRevealer, IRunicArmor, IRepairable
|
||||
{
|
||||
private static IIcon helmetIcon;
|
||||
private static IIcon helmetIcon;
|
||||
private static IIcon plateIcon;
|
||||
private static IIcon leggingsIcon;
|
||||
private static IIcon bootsIcon;
|
||||
|
||||
public ItemSanguineArmour()
|
||||
public ItemSanguineArmour(int armorType)
|
||||
{
|
||||
super(AlchemicalWizardry.sanguineArmourArmourMaterial, 4, 0);
|
||||
super(AlchemicalWizardry.sanguineArmourArmourMaterial, 0, armorType);
|
||||
setMaxDamage(1000);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
|
@ -34,36 +43,97 @@ public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGog
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
//this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineHelmet");
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:SanguineHelmet");
|
||||
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundPlate");
|
||||
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundLeggings");
|
||||
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:BoundBoots");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
if (this.equals(ModItems.sanguineHelmet))
|
||||
{
|
||||
return this.helmetIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.sanguineRobe))
|
||||
{
|
||||
return this.plateIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.sanguinePants))
|
||||
{
|
||||
return this.leggingsIcon;
|
||||
}
|
||||
|
||||
if (this.equals(ModItems.sanguineBoots))
|
||||
{
|
||||
return this.bootsIcon;
|
||||
}
|
||||
|
||||
return this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
|
||||
{
|
||||
//if(AlchemicalWizardry.isThaumcraftLoaded)
|
||||
if (this == ModItems.sanguineHelmet)
|
||||
{
|
||||
if (this == ModItems.sanguineHelmet)
|
||||
{
|
||||
return "alchemicalwizardry:models/armor/sanguineArmour_layer_1.png";
|
||||
}
|
||||
return "alchemicalwizardry:models/armor/sanguineArmour_layer_1.png";
|
||||
}
|
||||
|
||||
if (this == ModItems.sanguineRobe || this == ModItems.sanguineBoots)
|
||||
{
|
||||
return "alchemicalwizardry:models/armor/boundArmour_layer_1.png";
|
||||
}
|
||||
|
||||
if (this == ModItems.sanguinePants)
|
||||
{
|
||||
return "alchemicalwizardry:models/armor/boundArmour_layer_2.png";
|
||||
} else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("A pair of goggles imbued with power");
|
||||
par3List.add("Vis discount: " + 8 + "%");
|
||||
}
|
||||
int discount = 0;
|
||||
|
||||
switch(this.armorType)
|
||||
{
|
||||
case 0:
|
||||
discount = 8;
|
||||
break;
|
||||
case 1:
|
||||
discount = 4;
|
||||
break;
|
||||
case 2:
|
||||
discount = 3;
|
||||
break;
|
||||
case 3:
|
||||
discount = 3;
|
||||
break;
|
||||
}
|
||||
|
||||
switch(this.armorType)
|
||||
{
|
||||
case 0:
|
||||
par3List.add("A pair of goggles imbued with power");
|
||||
break;
|
||||
case 1:
|
||||
|
||||
|
||||
// @Override
|
||||
// public boolean showNodes(ItemStack itemstack, EntityLivingBase player)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
case 2:
|
||||
|
||||
case 3:
|
||||
par3List.add("Robes imbued with forbidden power");
|
||||
}
|
||||
|
||||
par3List.add("Vis discount: " + discount + "%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
|
@ -74,7 +144,7 @@ public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGog
|
|||
@Override
|
||||
public boolean isUpgrade()
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -92,7 +162,14 @@ public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGog
|
|||
@Override
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect)
|
||||
{
|
||||
return 8;
|
||||
switch(this.armorType)
|
||||
{
|
||||
case 0: return 8;
|
||||
case 1: return 4;
|
||||
case 2: return 3;
|
||||
case 3: return 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -100,4 +177,10 @@ public class ItemSanguineArmour extends ItemArmor implements ArmourUpgrade, IGog
|
|||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunicCharge(ItemStack itemstack) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package WayofTime.alchemicalWizardry.common.potion;
|
||||
|
||||
import net.minecraft.potion.Potion;
|
||||
|
||||
public class PotionSoulHarden extends Potion
|
||||
{
|
||||
public PotionSoulHarden(int par1, boolean par2, int par3)
|
||||
{
|
||||
super(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Potion setIconIndex(int par1, int par2)
|
||||
{
|
||||
super.setIconIndex(par1, par2);
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
|
||||
public class AlchemyCircleRenderer extends MRSRenderer
|
||||
{
|
||||
private ResourceLocation resourceLocation = new ResourceLocation("alchemicalwizardry:textures/models/TransCircle.png");
|
||||
private int colourRed;
|
||||
private int colourGreen;
|
||||
private int colourBlue;
|
||||
private int colourIntensity;
|
||||
private double xOffset;
|
||||
private double yOffset;
|
||||
private double zOffset;
|
||||
private double radius;
|
||||
private double initialY;
|
||||
|
||||
public AlchemyCircleRenderer(ResourceLocation resource, int red, int green, int blue, int intensity, double xOff, double initialY, double yOff, double zOff, double radius)
|
||||
{
|
||||
this.resourceLocation = resource;
|
||||
this.colourRed = red;
|
||||
this.colourGreen = green;
|
||||
this.colourBlue = blue;
|
||||
this.colourIntensity = intensity;
|
||||
this.xOffset = xOff;
|
||||
this.initialY = initialY;
|
||||
this.yOffset = yOff;
|
||||
this.zOffset = zOff;
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderAt(TEMasterStone tile, double x, double y, double z)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
float f1 = 1.0f;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
this.bindTexture(resourceLocation);
|
||||
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F);
|
||||
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
float f2 = 0;
|
||||
float f3 = -f2 * 0.2F - (float)MathHelper.floor_float(-f2 * 0.1F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
GL11.glDepthMask(false);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA(colourRed, colourGreen, colourBlue, colourIntensity);
|
||||
|
||||
GL11.glTranslated(x+0.5+xOffset, y+0.5+(yOffset-initialY)*(tile.runningTime/100d)+initialY, z+0.5+zOffset);
|
||||
|
||||
float rotationAngle = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL);
|
||||
|
||||
GL11.glRotatef(rotationAngle, 0F, 1F, 0F); //Rotate on planar axis
|
||||
//GL11.glRotatef(30F, 0F, 0F, 1F); //Rotate vertical axis
|
||||
//GL11.glRotatef(tileAltar.getWorldObj().getWorldTime()*2f, 1F, 0F, 0F); //Rotate cylindrically
|
||||
|
||||
tessellator.setBrightness(240);
|
||||
|
||||
double finalRadius = (radius)*(tile.runningTime/100d);
|
||||
|
||||
tessellator.addVertexWithUV(-finalRadius, 0, -finalRadius, 0.0d, 0.0d);
|
||||
tessellator.addVertexWithUV(finalRadius, 0, -finalRadius, 1.0d, 0.0d);
|
||||
tessellator.addVertexWithUV(finalRadius, 0, finalRadius, 1.0d, 1.0d);
|
||||
tessellator.addVertexWithUV(-finalRadius, 0, finalRadius, 0.0d, 1.0d);
|
||||
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,115 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class BeamRenderer
|
||||
{
|
||||
private static final ResourceLocation field_110629_a = new ResourceLocation("textures/entity/beacon_beam.png");
|
||||
protected static TileEntityRendererDispatcher field_147501_a;
|
||||
|
||||
protected static void bindTexture(ResourceLocation p_147499_1_)
|
||||
{
|
||||
TextureManager texturemanager = BeamRenderer.field_147501_a.field_147553_e;
|
||||
|
||||
if (texturemanager != null)
|
||||
{
|
||||
texturemanager.bindTexture(p_147499_1_);
|
||||
}
|
||||
}
|
||||
|
||||
public static void render()
|
||||
{
|
||||
double d0 = 0;
|
||||
double d1 = 0;
|
||||
double d2 = 0;
|
||||
|
||||
|
||||
float distance = 5; //Total distance
|
||||
|
||||
GL11.glPushMatrix();
|
||||
float f1 = 1.0f;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
BeamRenderer.bindTexture(field_110629_a);
|
||||
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F);
|
||||
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
float f2 = 0;
|
||||
float f3 = -f2 * 0.2F - (float)MathHelper.floor_float(-f2 * 0.1F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
|
||||
GL11.glDepthMask(false);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA(255, 0, 0, 50);
|
||||
//tessellator.setColorOpaque(255, 255, 255);
|
||||
|
||||
double inside = 0.45d-0.5d;
|
||||
double outside = 1.0d-0.45d-0.5d;
|
||||
|
||||
double d18 = inside;
|
||||
double d19 = inside;
|
||||
double d20 = outside;
|
||||
double d21 = inside;
|
||||
double d22 = inside;
|
||||
double d23 = outside;
|
||||
double d24 = outside;
|
||||
double d25 = outside;
|
||||
double d26 = (double)(distance * f1);// + 0.2;
|
||||
double d27 = 0.0D;
|
||||
double d28 = 1.0D;
|
||||
double d29 = (double)(-1.0F + f3);
|
||||
double d30 = (double)(distance * f1) + d29;
|
||||
|
||||
GL11.glTranslated(d0+0.5, d1+0.5, d2+0.5);
|
||||
|
||||
GL11.glRotatef(45F, 0F, 1F, 0F); //Rotate on planar axis
|
||||
GL11.glRotatef(30F, 0F, 0F, 1F); //Rotate vertical axis
|
||||
//GL11.glRotatef(tileAltar.getWorldObj().getWorldTime()*2f, 1F, 0F, 0F); //Rotate cylindrically
|
||||
|
||||
double offset = 0;
|
||||
|
||||
tessellator.setBrightness(240);
|
||||
float s = 1F / 16F;
|
||||
// GL11.glTranslatef(0F, s, s);
|
||||
// GL11.glScalef(1F, s * 14F, s * 14F);
|
||||
tessellator.addVertexWithUV(d26, d18, d19, d28, d30);
|
||||
tessellator.addVertexWithUV(offset, d18, d19, d28, d29);
|
||||
tessellator.addVertexWithUV(offset, d20, d21, d27, d29);
|
||||
tessellator.addVertexWithUV(d26, d20, d21, d27, d30);
|
||||
tessellator.addVertexWithUV(d26, d24, d25, d28, d30);
|
||||
tessellator.addVertexWithUV(offset, d24, d25, d28, d29);
|
||||
tessellator.addVertexWithUV(offset, d22, d23, d27, d29);
|
||||
tessellator.addVertexWithUV(d26, d22, d23, d27, d30);
|
||||
tessellator.addVertexWithUV(d26, d20, d21, d28, d30);
|
||||
tessellator.addVertexWithUV(offset, d20, d21, d28, d29);
|
||||
tessellator.addVertexWithUV(offset, d24, d25, d27, d29);
|
||||
tessellator.addVertexWithUV(d26, d24, d25, d27, d30);
|
||||
tessellator.addVertexWithUV(d26, d22, d23, d28, d30);
|
||||
tessellator.addVertexWithUV(offset, d22, d23, d28, d29);
|
||||
tessellator.addVertexWithUV(offset, d18, d19, d27, d29);
|
||||
tessellator.addVertexWithUV(d26, d18, d19, d27, d30);
|
||||
|
||||
//ShaderHelper.useShaderWithProps(ShaderHelper.beam, "time", (int) tileAltar.getWorldObj().getTotalWorldTime());
|
||||
tessellator.draw();
|
||||
//ShaderHelper.releaseShader();
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.block.RenderMasterStone;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
|
||||
public abstract class MRSRenderer
|
||||
{
|
||||
public abstract void renderAt(TEMasterStone tile, double x, double y, double z);
|
||||
|
||||
protected void bindTexture(ResourceLocation p_147499_1_)
|
||||
{
|
||||
TextureManager texturemanager = TileEntityRendererDispatcher.instance.field_147553_e;
|
||||
|
||||
if (texturemanager != null)
|
||||
{
|
||||
texturemanager.bindTexture(p_147499_1_);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.MRSRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
|
||||
public class RenderMasterStone extends TileEntitySpecialRenderer
|
||||
{
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f)
|
||||
{
|
||||
if (tileEntity instanceof TEMasterStone)
|
||||
{
|
||||
String str = ((TEMasterStone) tileEntity).getCurrentRitual();
|
||||
MRSRenderer renderer = Rituals.getRendererForKey(str);
|
||||
|
||||
if(renderer != null)
|
||||
{
|
||||
renderer.renderAt(((TEMasterStone) tileEntity), d0, d1, d2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
|
@ -8,6 +9,7 @@ import net.minecraft.entity.item.EntityItem;
|
|||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
|
@ -86,6 +88,25 @@ public class RenderPedestal extends TileEntitySpecialRenderer
|
|||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
// this.modelInputMirror.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection());
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.renderer.BeamRenderer;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class RenderReagentConduit extends TileEntitySpecialRenderer
|
||||
{
|
||||
private static final ResourceLocation field_110629_a = new ResourceLocation("alchemicalwizardry:textures/models/TransCircle.png");
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f)
|
||||
{
|
||||
if (tileEntity instanceof TEReagentConduit)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
float f1 = 1.0f;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
this.bindTexture(field_110629_a);
|
||||
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F);
|
||||
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
float f2 = 0;
|
||||
float f3 = -f2 * 0.2F - (float)MathHelper.floor_float(-f2 * 0.1F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
|
||||
GL11.glDepthMask(false);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setColorRGBA(0, 0, 255, 90);
|
||||
//tessellator.setColorOpaque(255, 255, 255);
|
||||
|
||||
GL11.glTranslated(d0+0.5, d1+0.5, d2+0.5);
|
||||
|
||||
GL11.glRotatef(tileEntity.getWorldObj().getWorldTime()/3.0f, 0F, 1F, 0F); //Rotate on planar axis
|
||||
//GL11.glRotatef(30F, 0F, 0F, 1F); //Rotate vertical axis
|
||||
//GL11.glRotatef(tileAltar.getWorldObj().getWorldTime()*2f, 1F, 0F, 0F); //Rotate cylindrically
|
||||
|
||||
double offset = 0;
|
||||
|
||||
tessellator.setBrightness(240);
|
||||
// GL11.glTranslatef(0F, s, s);
|
||||
// GL11.glScalef(1F, s * 14F, s * 14F);
|
||||
tessellator.addVertexWithUV(-0.5d, 0, -0.5d, 0.0d, 0.0d);
|
||||
tessellator.addVertexWithUV(0.5d, 0, -0.5d, 1.0d, 0.0d);
|
||||
tessellator.addVertexWithUV(0.5d, 0, 0.5d, 1.0d, 1.0d);
|
||||
tessellator.addVertexWithUV(-0.5d, 0, 0.5d, 0.0d, 1.0d);
|
||||
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,184 @@
|
|||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Apr 9, 2014, 11:20:26 PM (GMT)]
|
||||
*/
|
||||
package WayofTime.alchemicalWizardry.common.renderer.block;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.lwjgl.opengl.ARBFragmentShader;
|
||||
import org.lwjgl.opengl.ARBShaderObjects;
|
||||
import org.lwjgl.opengl.ARBVertexShader;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
public final class ShaderHelper {
|
||||
|
||||
private static final int VERT = ARBVertexShader.GL_VERTEX_SHADER_ARB;
|
||||
private static final int FRAG = ARBFragmentShader.GL_FRAGMENT_SHADER_ARB;
|
||||
|
||||
public static int beam = 0;
|
||||
|
||||
public static void initShaders() {
|
||||
// if(!useShaders())
|
||||
// return;
|
||||
|
||||
beam = createProgram(null, "/assets/alchemicalwizardry/shaders/beam.frag");
|
||||
}
|
||||
|
||||
public static void useShaderWithProps(int shader, Object... props) {
|
||||
// if(!useShaders())
|
||||
// return;
|
||||
|
||||
ARBShaderObjects.glUseProgramObjectARB(shader);
|
||||
|
||||
if(shader != 0 && props.length % 2 == 0) {
|
||||
int propCount = props.length / 2;
|
||||
for(int i = 0; i < propCount; i++) {
|
||||
String propName = (String) props[i * 2];
|
||||
Object propVal = props[i * 2 + 1];
|
||||
|
||||
int uniform = ARBShaderObjects.glGetUniformLocationARB(shader, propName);
|
||||
if(propVal instanceof Integer)
|
||||
ARBShaderObjects.glUniform1iARB(uniform, (Integer) propVal);
|
||||
if(propVal instanceof Float)
|
||||
ARBShaderObjects.glUniform1fARB(uniform, (Float) propVal);
|
||||
// Possible Vector2, Vector3 and Vector4, no need yet.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void useShader(int shader) {
|
||||
useShaderWithProps(shader);
|
||||
}
|
||||
|
||||
public static void releaseShader() {
|
||||
useShader(0);
|
||||
}
|
||||
|
||||
public static boolean useShaders() {
|
||||
return true;//ConfigHandler.useShaders && OpenGlHelper.shadersSupported;
|
||||
}
|
||||
|
||||
// Most of the code taken from the LWJGL wiki
|
||||
// http://lwjgl.org/wiki/index.php?title=GLSL_Shaders_with_LWJGL
|
||||
|
||||
private static int createProgram(String vert, String frag) {
|
||||
int vertId = 0, fragId = 0, program = 0;
|
||||
if(vert != null)
|
||||
vertId = createShader(vert, VERT);
|
||||
if(frag != null)
|
||||
fragId = createShader(frag, FRAG);
|
||||
|
||||
program = ARBShaderObjects.glCreateProgramObjectARB();
|
||||
if(program == 0)
|
||||
return 0;
|
||||
|
||||
if(vert != null)
|
||||
ARBShaderObjects.glAttachObjectARB(program, vertId);
|
||||
if(frag != null)
|
||||
ARBShaderObjects.glAttachObjectARB(program, fragId);
|
||||
|
||||
ARBShaderObjects.glLinkProgramARB(program);
|
||||
if(ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE) {
|
||||
// FMLLog.log(Level.WARNING, getLogInfo(program));
|
||||
return 0;
|
||||
}
|
||||
|
||||
ARBShaderObjects.glValidateProgramARB(program);
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) {
|
||||
// FMLLog.log(Level.WARNING, getLogInfo(program));
|
||||
return 0;
|
||||
}
|
||||
|
||||
return program;
|
||||
}
|
||||
|
||||
private static int createShader(String filename, int shaderType){
|
||||
int shader = 0;
|
||||
try {
|
||||
shader = ARBShaderObjects.glCreateShaderObjectARB(shaderType);
|
||||
|
||||
if(shader == 0)
|
||||
return 0;
|
||||
|
||||
ARBShaderObjects.glShaderSourceARB(shader, readFileAsString(filename));
|
||||
ARBShaderObjects.glCompileShaderARB(shader);
|
||||
|
||||
if (ARBShaderObjects.glGetObjectParameteriARB(shader, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE)
|
||||
throw new RuntimeException("Error creating shader: " + getLogInfo(shader));
|
||||
|
||||
return shader;
|
||||
}
|
||||
catch(Exception e) {
|
||||
ARBShaderObjects.glDeleteObjectARB(shader);
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
private static String getLogInfo(int obj) {
|
||||
return ARBShaderObjects.glGetInfoLogARB(obj, ARBShaderObjects.glGetObjectParameteriARB(obj, ARBShaderObjects.GL_OBJECT_INFO_LOG_LENGTH_ARB));
|
||||
}
|
||||
|
||||
private static String readFileAsString(String filename) throws Exception {
|
||||
StringBuilder source = new StringBuilder();
|
||||
InputStream in = ShaderHelper.class.getResourceAsStream(filename);
|
||||
Exception exception = null;
|
||||
BufferedReader reader;
|
||||
|
||||
if(in == null)
|
||||
return "";
|
||||
|
||||
try {
|
||||
reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
|
||||
|
||||
Exception innerExc= null;
|
||||
try {
|
||||
String line;
|
||||
while((line = reader.readLine()) != null)
|
||||
source.append(line).append('\n');
|
||||
} catch(Exception exc) {
|
||||
exception = exc;
|
||||
} finally {
|
||||
try {
|
||||
reader.close();
|
||||
} catch(Exception exc) {
|
||||
if(innerExc == null)
|
||||
innerExc = exc;
|
||||
else exc.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if(innerExc != null)
|
||||
throw innerExc;
|
||||
} catch(Exception exc) {
|
||||
exception = exc;
|
||||
} finally {
|
||||
try {
|
||||
in.close();
|
||||
} catch(Exception exc) {
|
||||
if(exception == null)
|
||||
exception = exc;
|
||||
else exc.printStackTrace();
|
||||
}
|
||||
|
||||
if(exception != null)
|
||||
throw exception;
|
||||
}
|
||||
|
||||
return source.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -88,7 +88,7 @@ public class RitualEffectFeatheredKnife extends RitualEffect
|
|||
{
|
||||
entity = (EntityPlayer) iterator1.next();
|
||||
|
||||
if (entity.getClass().equals(EntityPlayerMP.class) || entity.getClass().equals(EntityPlayer.class))
|
||||
if (!SpellHelper.isFakePlayer(world, entity))
|
||||
{
|
||||
entityCount++;
|
||||
}
|
||||
|
@ -114,9 +114,9 @@ public class RitualEffectFeatheredKnife extends RitualEffect
|
|||
entity = (EntityPlayer) iterator2.next();
|
||||
|
||||
//entity = (EntityPlayer)iterator1.next();
|
||||
if (entity.getClass().equals(EntityPlayerMP.class) || entity.getClass().equals(EntityPlayer.class))
|
||||
if (!SpellHelper.isFakePlayer(world, entity))
|
||||
{
|
||||
if (entity.getHealth() > 6.2f)
|
||||
if (entity.getHealth()/entity.getMaxHealth() > 0.3d)
|
||||
{
|
||||
entity.setHealth(entity.getHealth() - 1);
|
||||
entityCount++;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.tileEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -7,6 +10,8 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
@ -60,6 +65,8 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
protected FluidStack fluidOutput;
|
||||
protected FluidStack fluidInput;
|
||||
private int progress;
|
||||
|
||||
private int lockdownDuration;
|
||||
|
||||
public TEAltar()
|
||||
{
|
||||
|
@ -81,6 +88,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
upgradeLevel = 0;
|
||||
isResultBlock = false;
|
||||
progress = 0;
|
||||
this.lockdownDuration = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -145,6 +153,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
bufferCapacity = par1NBTTagCompound.getInteger("bufferCapacity");
|
||||
progress = par1NBTTagCompound.getInteger("progress");
|
||||
isResultBlock = par1NBTTagCompound.getBoolean("isResultBlock");
|
||||
lockdownDuration = par1NBTTagCompound.getInteger("lockdownDuration");
|
||||
}
|
||||
|
||||
public void setMainFluid(FluidStack fluid)
|
||||
|
@ -221,6 +230,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
par1NBTTagCompound.setInteger("capacity", capacity);
|
||||
par1NBTTagCompound.setInteger("progress", progress);
|
||||
par1NBTTagCompound.setInteger("bufferCapacity", bufferCapacity);
|
||||
par1NBTTagCompound.setInteger("lockdownDuration", lockdownDuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -527,6 +537,11 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
public void updateEntity()
|
||||
{
|
||||
//this.capacity=(int) (10000*this.capacityMultiplier);
|
||||
if(this.lockdownDuration > 0)
|
||||
{
|
||||
this.lockdownDuration --;
|
||||
}
|
||||
|
||||
if (!worldObj.isRemote && worldObj.getWorldTime() % 20 == 0)
|
||||
{
|
||||
//TODO
|
||||
|
@ -541,9 +556,23 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
fluidOutputted = Math.min(this.fluid.amount, fluidOutputted);
|
||||
this.fluidOutput.amount += fluidOutputted;
|
||||
this.fluid.amount -= fluidOutputted;
|
||||
}
|
||||
|
||||
if(AlchemicalWizardry.lockdownAltar)
|
||||
{
|
||||
List<EntityPlayer> list = SpellHelper.getPlayersInRange(worldObj, xCoord+0.5, yCoord+0.5, zCoord+0.5, 15, 15);
|
||||
boolean hasHighRegen = false;
|
||||
for(EntityPlayer player : list)
|
||||
{
|
||||
PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration);
|
||||
if(regenEffect != null && regenEffect.getAmplifier() >= 2)
|
||||
{
|
||||
this.lockdownDuration += 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (worldObj.getWorldTime() % 150 == 0)
|
||||
if (worldObj.getWorldTime() % 100 == 0)
|
||||
{
|
||||
startCycle();
|
||||
}
|
||||
|
@ -564,6 +593,30 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int range = 5;
|
||||
|
||||
for(int i=-range; i<=range; i++)
|
||||
{
|
||||
for(int j=-range; j<=range; j++)
|
||||
{
|
||||
for(int k=-range; k<=range; k++)
|
||||
{
|
||||
Block block = worldObj.getBlock(xCoord + i, yCoord + j, zCoord + k);
|
||||
int meta = worldObj.getBlockMetadata(xCoord + i, yCoord + j, zCoord + k);
|
||||
|
||||
List<ItemStack> list = block.getDrops(worldObj, xCoord + i, yCoord + j, zCoord + k, meta, 1);
|
||||
for(ItemStack stack : list)
|
||||
{
|
||||
String str = stack.getUnlocalizedName();
|
||||
if(str.contains("fallenKanade"))
|
||||
{
|
||||
System.out.println("" + str);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//o,o this is always true
|
||||
if (worldTime % 1 == 0)
|
||||
|
@ -726,7 +779,14 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
|
||||
public void sacrificialDaggerCall(int amount, boolean isSacrifice)
|
||||
{
|
||||
fluid.amount += Math.min(capacity - fluid.amount, (isSacrifice ? 1 + sacrificeEfficiencyMultiplier : 1 + selfSacrificeEfficiencyMultiplier) * amount);
|
||||
if(!isSacrifice && this.lockdownDuration > 0)
|
||||
{
|
||||
int amt = (int) Math.min(bufferCapacity - fluidInput.amount, (isSacrifice ? 1 + sacrificeEfficiencyMultiplier : 1 + selfSacrificeEfficiencyMultiplier) * amount);
|
||||
fluidInput.amount += amt;
|
||||
}else
|
||||
{
|
||||
fluid.amount += Math.min(capacity - fluid.amount, (isSacrifice ? 1 + sacrificeEfficiencyMultiplier : 1 + selfSacrificeEfficiencyMultiplier) * amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,18 +2,20 @@ package WayofTime.alchemicalWizardry.common.tileEntity;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
|
||||
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class TEMasterStone extends TileEntity implements IMasterRitualStone
|
||||
{
|
||||
//private int currentRitual;
|
||||
private String currentRitualString;
|
||||
private boolean isActive;
|
||||
private String owner;
|
||||
|
@ -21,10 +23,11 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone
|
|||
private int cooldown;
|
||||
private int var1;
|
||||
private int direction;
|
||||
public boolean isRunning;
|
||||
public int runningTime;
|
||||
|
||||
public TEMasterStone()
|
||||
{
|
||||
//currentRitual = 0;
|
||||
isActive = false;
|
||||
owner = "";
|
||||
cooldown = 0;
|
||||
|
@ -32,34 +35,36 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone
|
|||
direction = 0;
|
||||
varString1 = "";
|
||||
currentRitualString = "";
|
||||
isRunning = false;
|
||||
runningTime = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
super.readFromNBT(par1NBTTagCompound);
|
||||
//currentRitual = par1NBTTagCompound.getInteger("currentRitual");
|
||||
isActive = par1NBTTagCompound.getBoolean("isActive");
|
||||
owner = par1NBTTagCompound.getString("owner");
|
||||
cooldown = par1NBTTagCompound.getInteger("cooldown");
|
||||
var1 = par1NBTTagCompound.getInteger("var1");
|
||||
direction = par1NBTTagCompound.getInteger("direction");
|
||||
currentRitualString = par1NBTTagCompound.getString("currentRitualString");
|
||||
// varString1 = par1NBTTagCompound.getString("varString1");
|
||||
isRunning = par1NBTTagCompound.getBoolean("isRunning");
|
||||
runningTime = par1NBTTagCompound.getInteger("runningTime");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
super.writeToNBT(par1NBTTagCompound);
|
||||
//par1NBTTagCompound.setInteger("currentRitual", currentRitual);
|
||||
par1NBTTagCompound.setBoolean("isActive", isActive);
|
||||
par1NBTTagCompound.setString("owner", owner);
|
||||
par1NBTTagCompound.setInteger("cooldown", cooldown);
|
||||
par1NBTTagCompound.setInteger("var1", var1);
|
||||
par1NBTTagCompound.setInteger("direction", direction);
|
||||
par1NBTTagCompound.setString("currentRitualString", currentRitualString);
|
||||
// par1NBTTagCompound.setString("varString1", varString1);
|
||||
par1NBTTagCompound.setBoolean("isRunning", isRunning);
|
||||
par1NBTTagCompound.setInteger("runningTime",runningTime);
|
||||
}
|
||||
|
||||
public void activateRitual(World world, int crystalLevel, EntityPlayer player)
|
||||
|
@ -101,7 +106,6 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone
|
|||
{
|
||||
player.addChatMessage(new ChatComponentText("You feel a pull, but you are too weak to push any further."));
|
||||
|
||||
//TODO Bad stuff
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -122,6 +126,7 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone
|
|||
var1 = 0;
|
||||
currentRitualString = testRitual;
|
||||
isActive = true;
|
||||
isRunning = true;
|
||||
direction = Rituals.getDirectionOfRitual(world, xCoord, yCoord, zCoord, testRitual);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
@ -134,6 +139,14 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone
|
|||
@Override
|
||||
public void updateEntity()
|
||||
{
|
||||
if(isRunning && runningTime < 100)
|
||||
{
|
||||
runningTime++;
|
||||
}else if(!isRunning && runningTime > 0)
|
||||
{
|
||||
runningTime--;
|
||||
}
|
||||
|
||||
if (!isActive)
|
||||
{
|
||||
return;
|
||||
|
@ -156,14 +169,25 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone
|
|||
isActive = false;
|
||||
currentRitualString = "";
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
//PacketDispatcher.sendPacketToAllPlayers(TEAltar.getParticlePacket(xCoord, yCoord, zCoord, (short)3));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (worldObj.getBlockPowerInput(xCoord, yCoord, zCoord) > 0)
|
||||
{
|
||||
if(isRunning)
|
||||
{
|
||||
isRunning = false;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
return;
|
||||
}else
|
||||
{
|
||||
if(!isRunning)
|
||||
{
|
||||
isRunning = true;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
performRitual(worldObj, xCoord, yCoord, zCoord, currentRitualString);
|
||||
|
@ -202,6 +226,8 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone
|
|||
public void setActive(boolean active)
|
||||
{
|
||||
this.isActive = active;
|
||||
this.isRunning = active;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
public int getDirection()
|
||||
|
@ -232,4 +258,27 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone
|
|||
{
|
||||
return zCoord;
|
||||
}
|
||||
|
||||
public String getCurrentRitual()
|
||||
{
|
||||
return this.currentRitualString;
|
||||
}
|
||||
|
||||
public void setCurrentRitual(String str)
|
||||
{
|
||||
this.currentRitualString = str;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket()
|
||||
{
|
||||
return NewPacketHandler.getPacket(this);
|
||||
}
|
||||
|
||||
public AxisAlignedBB getRenderBoundingBox()
|
||||
{
|
||||
double renderExtention = 1.0d;
|
||||
AxisAlignedBB bb = AxisAlignedBB. getBoundingBox(xCoord-renderExtention, yCoord-renderExtention, zCoord-renderExtention, xCoord+1+renderExtention, yCoord+1+renderExtention, zCoord+1+renderExtention);
|
||||
return bb;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.tileEntity;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TEReagentConduit extends TileEntity
|
||||
{
|
||||
|
||||
}
|
|
@ -19,6 +19,8 @@ import WayofTime.alchemicalWizardry.common.IBindingAgent;
|
|||
import WayofTime.alchemicalWizardry.common.ICatalyst;
|
||||
import WayofTime.alchemicalWizardry.common.IFillingAgent;
|
||||
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
|
||||
import WayofTime.alchemicalWizardry.common.alchemy.CombinedPotionRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.alchemy.ICombinationalCatalyst;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
@ -288,6 +290,30 @@ public class TEWritingTable extends TileEntity implements IInventory
|
|||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public boolean containsCombinationCatalyst()
|
||||
{
|
||||
if (getCombinationCatalystPosition() != -1)
|
||||
{
|
||||
return true;
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public int getCombinationCatalystPosition()
|
||||
{
|
||||
for (int i = 1; i <= 5; i++)
|
||||
{
|
||||
if (inv[i] != null && inv[i].getItem() instanceof ICombinationalCatalyst)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public boolean containsRegisteredPotionIngredient()
|
||||
{
|
||||
|
@ -615,7 +641,6 @@ public class TEWritingTable extends TileEntity implements IInventory
|
|||
}
|
||||
} else if (this.containsFillingAgent() && this.containsPotionFlask())
|
||||
{
|
||||
//TODO
|
||||
if (getStackInSlot(6) == null)
|
||||
{
|
||||
progress++;
|
||||
|
@ -661,7 +686,55 @@ public class TEWritingTable extends TileEntity implements IInventory
|
|||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
}
|
||||
else if (this.containsPotionFlask() && this.containsCombinationCatalyst())
|
||||
{
|
||||
//TODO
|
||||
if (getStackInSlot(6) == null && CombinedPotionRegistry.hasCombinablePotionEffect(inv[this.getPotionFlaskPosition()]))
|
||||
{
|
||||
progress++;
|
||||
|
||||
if (worldTime % 4 == 0)
|
||||
{
|
||||
SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
if (progress >= progressNeeded)
|
||||
{
|
||||
ItemStack flaskStack = inv[this.getPotionFlaskPosition()];
|
||||
//ItemStack ingredientStack = inv[this.getRegisteredPotionIngredientPosition()];
|
||||
ItemStack combinationCatalyst = inv[this.getCombinationCatalystPosition()];
|
||||
|
||||
if (flaskStack == null || combinationCatalyst == null)
|
||||
{
|
||||
progress = 0;
|
||||
|
||||
if (worldObj != null)
|
||||
{
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack newFlask = CombinedPotionRegistry.applyPotionEffect(flaskStack);
|
||||
if(newFlask != null)
|
||||
{
|
||||
this.setInventorySlotContents(6, newFlask);
|
||||
this.decrStackSize(this.getPotionFlaskPosition(), 1);
|
||||
this.decrStackSize(this.getCombinationCatalystPosition(), 1);
|
||||
|
||||
progress = 0;
|
||||
|
||||
if (worldObj != null)
|
||||
{
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isRecipeValid())
|
||||
{
|
||||
|
|
|
@ -172,6 +172,10 @@ item.sanguineHelmet.name=Sanguine Helmet
|
|||
item.itemSeerSigil.name=Sigil of Sight
|
||||
item.itemFluidSigil.name=
|
||||
item.multiTool.name=Dynamic Mace
|
||||
item.itemCombinationalCatalyst.name=Combinational Catalyst
|
||||
item.sanguineRobe.name=Sanguine Robes
|
||||
item.sanguinePants.name=Sanguine Leggings
|
||||
item.sanguineBoots.name=Sanguine Boots
|
||||
|
||||
#Creative Tab
|
||||
itemGroup.tabBloodMagic=Blood Magic
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,12 @@
|
|||
uniform sampler2D bgl_RenderedTexture;
|
||||
uniform int time;
|
||||
|
||||
void main() {
|
||||
vec2 texcoord = vec2(gl_TexCoord[0]);
|
||||
vec4 color = texture2D(bgl_RenderedTexture, texcoord);
|
||||
|
||||
float gs = (color.r + color.g + color.b) / 3;
|
||||
float r = sin(texcoord.x * 6 - 1.5 + sin(texcoord.y - time / 3.0)) * 1.1; //(sin((texcoord.x - texcoord.y) * 4 - time) + 1) / 2;
|
||||
|
||||
gl_FragColor = vec4(gs, gs, max(gs, r), gl_Color.a);
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 548 B |
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
After Width: | Height: | Size: 190 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
Loading…
Reference in a new issue