1.7.10 moving forward to v1.1.0!

This commit is contained in:
WayofTime 2014-07-15 19:23:57 -04:00
parent 1778cfa737
commit a92efa364d
51 changed files with 849 additions and 175 deletions

View file

@ -33,6 +33,7 @@ import WayofTime.alchemicalWizardry.api.alchemy.AlchemicalPotionCreationHandler;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry;
import WayofTime.alchemicalWizardry.api.bindingRegistry.BindingRegistry;
import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry;
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
import WayofTime.alchemicalWizardry.api.summoningRegistry.SummoningRegistry;
import WayofTime.alchemicalWizardry.common.AlchemicalWizardryEventHooks;
@ -58,6 +59,8 @@ import WayofTime.alchemicalWizardry.common.entity.mob.EntityShadeElemental;
import WayofTime.alchemicalWizardry.common.entity.mob.EntitySmallEarthGolem;
import WayofTime.alchemicalWizardry.common.entity.mob.EntityWaterElemental;
import WayofTime.alchemicalWizardry.common.entity.mob.EntityWingedFireDemon;
import WayofTime.alchemicalWizardry.common.harvest.BloodMagicHarvestHandler;
import WayofTime.alchemicalWizardry.common.harvest.GourdHarvestHandler;
import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour;
@ -82,12 +85,14 @@ import WayofTime.alchemicalWizardry.common.rituals.RitualEffectFeatheredEarth;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectFeatheredKnife;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectFlight;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectGrowth;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectHarvest;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectHealing;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectInterdiction;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectItemSuction;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectJumping;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLava;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLeap;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectLifeConduit;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectMagnetic;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSoulBound;
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectSummonMeteor;
@ -125,6 +130,7 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiHandler;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
@ -182,6 +188,7 @@ public class AlchemicalWizardry
public static boolean isForestryLoaded;
public static boolean wimpySettings;
public static boolean respawnWithLowerHealth;
public static CreativeTabs tabBloodMagic = new CreativeTabs("tabBloodMagic")
{
@ -330,8 +337,9 @@ public class AlchemicalWizardry
RecipeSorter.INSTANCE.register("AWWayofTime:shapedorb", ShapedBloodOrbRecipe.class, Category.SHAPED, "before:minecraft:shapeless");
RecipeSorter.INSTANCE.register("AWWayofTime:shapelessorb", ShapelessBloodOrbRecipe.class, Category.SHAPELESS, "after:minecraft:shapeless");
//FMLCommonHandler.instance().bus().register(new AlchemicalWizardryEventHooks());
MinecraftForge.EVENT_BUS.register(new AlchemicalWizardryEventHooks());
Object eventHook = new AlchemicalWizardryEventHooks();
FMLCommonHandler.instance().bus().register(eventHook);
MinecraftForge.EVENT_BUS.register(eventHook);
NewPacketHandler.INSTANCE.ordinal();
}
@ -406,6 +414,7 @@ public class AlchemicalWizardry
ItemStack runeOfSelfSacrificeStack = new ItemStack(ModBlocks.runeOfSelfSacrifice);
ItemStack miningSigilStackCrafted = new ItemStack(ModItems.sigilOfTheFastMiner);
ItemStack divinationSigilStackCrafted = new ItemStack(ModItems.divinationSigil);
ItemStack seerSigilStack = new ItemStack(ModItems.itemSeerSigil);
// ItemStack elementalInkWaterStack = new ItemStack(elementalInkWater);
// ItemStack elementalInkFireStack = new ItemStack(elementalInkFire);
// ItemStack elementalInkEarthStack = new ItemStack(elementalInkEarth);
@ -478,6 +487,7 @@ public class AlchemicalWizardry
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(runeOfSacrificeStack, "srs", "gog", "srs", 's', stoneStack, 'g', goldIngotStack, 'o', apprenticeBloodOrbStack, 'r', reinforcedSlateStack));
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(runeOfSelfSacrificeStack, "srs", "gog", "srs", 's', stoneStack, 'g', glowstoneDustStack, 'o', apprenticeBloodOrbStack, 'r', reinforcedSlateStack));
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(divinationSigilStackCrafted, "ggg", "gsg", "gog", 'g', glassStack, 's', blankSlateStack, 'o', weakBloodOrbStack));
GameRegistry.addRecipe(new ShapedBloodOrbRecipe(seerSigilStack, "gbg", "gsg", "gog", 'g', glassStack, 's', divinationSigilStackCrafted, 'o', apprenticeBloodOrbStack,'b', new ItemStack(ModItems.bucketLife)));
// GameRegistry.addRecipe(waterScribeToolStack, "f", "i", 'f', featherStack, 'i', elementalInkWaterStack);
// GameRegistry.addRecipe(fireScribeToolStack, "f", "i", 'f', featherStack, 'i', elementalInkFireStack);
// GameRegistry.addRecipe(earthScribeToolStack, "f", "i", 'f', featherStack, 'i', elementalInkEarthStack);
@ -594,6 +604,7 @@ public class AlchemicalWizardry
this.initAltarRecipes();
this.initRituals();
this.initBindingRecipes();
this.initHarvestRegistry();
//MinecraftForge.setToolClass(ModItems.boundPickaxe, "pickaxe", 5);
//MinecraftForge.setToolClass(ModItems.boundAxe, "axe", 5);
@ -965,6 +976,8 @@ public class AlchemicalWizardry
Rituals.registerRitual("AW021Expulsion", 1, 1000000, new RitualEffectExpulsion(), "Aura of Expulsion");
Rituals.registerRitual("AW022Supression", 1, 10000, new RitualEffectSupression(), "Dome of Supression");
Rituals.registerRitual("AW023Zephyr", 1, 25000, new RitualEffectItemSuction(),"Call of the Zephyr");
Rituals.registerRitual("AW024Harvest", 1, 20000, new RitualEffectHarvest(), "Reap of the Harvest Moon");
Rituals.registerRitual("AW025Conduit", 2, 2000000, new RitualEffectLifeConduit(), "Cry of the Eternal Soul");
//Rituals.registerRitual(1,100,new RitualEffectApiaryOverclock(),"Apiary Overclock"));
}
@ -976,4 +989,10 @@ public class AlchemicalWizardry
BindingRegistry.registerRecipe(new ItemStack(ModItems.energySword), new ItemStack(Items.diamond_sword));
BindingRegistry.registerRecipe(new ItemStack(ModItems.energyBlaster), new ItemStack(ModItems.apprenticeBloodOrb));
}
public static void initHarvestRegistry()
{
HarvestRegistry.registerHarvestHandler(new BloodMagicHarvestHandler());
HarvestRegistry.registerHarvestHandler(new GourdHarvestHandler());
}
}

View file

@ -64,6 +64,7 @@ public class BloodMagicConfiguration
AlchemicalWizardry.allowedCrushedOresArray = config.get("oreCrushing", "allowedOres", new String[]{"iron","gold","copper","tin","lead","silver","osmium"}).getStringList();
AlchemicalWizardry.wimpySettings = config.get("WimpySettings","IDontLikeFun",false).getBoolean(false);
AlchemicalWizardry.respawnWithLowerHealth = config.get("WimpySettings", "RespawnWithLowerHealth", true).getBoolean();
} catch (Exception e)
{

View file

@ -0,0 +1,34 @@
package WayofTime.alchemicalWizardry.api.harvest;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.world.World;
public class HarvestRegistry
{
public static List<IHarvestHandler> handlerList = new ArrayList();
public static void registerHarvestHandler(IHarvestHandler handler)
{
System.out.println("Heeeeelllooooo");
handlerList.add(handler);
}
public static boolean harvestBlock(World world, int xCoord, int yCoord, int zCoord)
{
Block block = world.getBlock(xCoord, yCoord, zCoord);
int meta = world.getBlockMetadata(xCoord, yCoord, zCoord);
for(IHarvestHandler handler : handlerList)
{
if(handler.harvestAndPlant(world, xCoord, yCoord, zCoord, block, meta))
{
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,21 @@
package WayofTime.alchemicalWizardry.api.harvest;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
public interface IHarvestHandler
{
/**
* A handler that is used to harvest and replant the block at the specified location
*
* @param world
* @param xCoord
* @param yCoord
* @param zCoord
* @param block block at this given location
* @param meta meta at this given location
* @return true if successfully harvested, false if not
*/
public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta);
}

View file

@ -25,10 +25,7 @@ import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjecti
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.Type;
import cpw.mods.fml.relauncher.ReflectionHelper;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent;
public class AlchemicalWizardryEventHooks
{
@ -36,6 +33,15 @@ public class AlchemicalWizardryEventHooks
public static Map<String,Boolean> playerBoostStepHeight = new HashMap();
public static List<String> playersWith1Step = new ArrayList();
@SubscribeEvent
public void onPlayerRespawnEvent(PlayerRespawnEvent event)
{
if(AlchemicalWizardry.respawnWithLowerHealth)
{
event.player.setHealth(6);
}
}
@SubscribeEvent
public void onLivingJumpEvent(LivingJumpEvent event)
{

View file

@ -22,6 +22,7 @@ public class BloodRune extends Block
private IIcon altarCapacityRuneIcon;
private IIcon dislocationRuneIcon;
private IIcon orbCapacityRuneIcon;
private IIcon betterCapacityRuneIcon;
public BloodRune()
{
@ -40,6 +41,7 @@ public class BloodRune extends Block
this.altarCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:AltarCapacityRune");
this.dislocationRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:DislocationRune");
this.orbCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:OrbCapacityRune");
this.betterCapacityRuneIcon = iconRegister.registerIcon("AlchemicalWizardry:BetterCapacityRune");
}
public int getRuneEffect(int metaData)
@ -57,6 +59,9 @@ public class BloodRune extends Block
case 3: //Orb Capacity rune
return 7;
case 4: //Better Capacity rune
return 8;
}
return 0;
@ -75,6 +80,7 @@ public class BloodRune extends Block
par3List.add(new ItemStack(par1, 1, 1));
par3List.add(new ItemStack(par1, 1, 2));
par3List.add(new ItemStack(par1, 1, 3));
par3List.add(new ItemStack(par1, 1, 4));
} else
{
super.getSubBlocks(par1, par2CreativeTabs, par3List);
@ -98,6 +104,9 @@ public class BloodRune extends Block
case 3:
return this.orbCapacityRuneIcon;
case 4:
return this.betterCapacityRuneIcon;
default:
return blockIcon;

View file

@ -9,6 +9,7 @@ public class AltarUpgradeComponent
private int displacementUpgrades;
private int altarCapacitiveUpgrades;
private int orbCapacitiveUpgrades;
private int betterCapacitiveUpgrades;
public AltarUpgradeComponent()
{
@ -19,6 +20,7 @@ public class AltarUpgradeComponent
displacementUpgrades = 0;
altarCapacitiveUpgrades = 0;
orbCapacitiveUpgrades = 0;
betterCapacitiveUpgrades = 0;
}
public void addSpeedUpgrade()
@ -55,6 +57,11 @@ public class AltarUpgradeComponent
{
orbCapacitiveUpgrades++;
}
public void addBetterCapacitiveUpgrade()
{
betterCapacitiveUpgrades++;
}
public int getSpeedUpgrades()
{
@ -90,4 +97,9 @@ public class AltarUpgradeComponent
{
return this.orbCapacitiveUpgrades;
}
public int getBetterCapacitiveUpgrades()
{
return this.betterCapacitiveUpgrades;
}
}

View file

@ -189,6 +189,10 @@ public class UpgradedAltars
case 7:
upgrades.addorbCapacitiveUpgrade();
break;
case 8:
upgrades.addBetterCapacitiveUpgrade();
break;
}
}
}

View file

@ -14,9 +14,9 @@ import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
public class BlockSet
{
private String blockid;
private int[] metadata;
private List<Int3> positions;
protected String blockid;
protected int[] metadata;
protected List<Int3> positions;
public BlockSet()
{

View file

@ -112,4 +112,9 @@ public class DemonBuilding
{
schematic.destroyAllInField(world, xCoord, yCoord, zCoord, dir);
}
public int getNumberOfGridSpaces()
{
return area.getNumberOfGridSpaces();
}
}

View file

@ -289,4 +289,21 @@ public class GridSpaceHolder
}
}
}
public int getNumberOfGridSpaces()
{
int num = 0;
for(int i=-this.negXRadius; i<=this.posXRadius; i++)
{
for(int j=-this.negZRadius; j<=this.posZRadius; j++)
{
if(!this.getGridSpace(i, j).isEmpty())
{
num++;
}
}
}
return num;
}
}

View file

@ -0,0 +1,8 @@
package WayofTime.alchemicalWizardry.common.demonVillage;
import net.minecraft.nbt.NBTTagCompound;
public class TileBlockSet extends BlockSet
{
public NBTTagCompound tag;
}

View file

@ -138,7 +138,6 @@ public class EntityBileDemon extends EntityDemon
{
super.writeEntityToNBT(par1NBTTagCompound);
par1NBTTagCompound.setBoolean("Angry", this.isAngry());
par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor());
par1NBTTagCompound.setByte("attackTimer", (byte) attackTimer);
}
@ -150,11 +149,6 @@ public class EntityBileDemon extends EntityDemon
super.readEntityFromNBT(par1NBTTagCompound);
this.setAngry(par1NBTTagCompound.getBoolean("Angry"));
if (par1NBTTagCompound.hasKey("CollarColor"))
{
this.setCollarColor(par1NBTTagCompound.getByte("CollarColor"));
}
attackTimer = par1NBTTagCompound.getByte("attackTimer");
}

View file

@ -138,7 +138,6 @@ public class EntityBoulderFist extends EntityDemon
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
{
super.writeEntityToNBT(par1NBTTagCompound);
par1NBTTagCompound.setBoolean("Angry", this.isAngry());
par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor());
}
@ -150,11 +149,6 @@ public class EntityBoulderFist extends EntityDemon
super.readEntityFromNBT(par1NBTTagCompound);
this.setAngry(par1NBTTagCompound.getBoolean("Angry"));
if (par1NBTTagCompound.hasKey("CollarColor"))
{
this.setCollarColor(par1NBTTagCompound.getByte("CollarColor"));
}
this.setCombatTask();
}

View file

@ -341,7 +341,6 @@ public class EntityElemental extends EntityDemon
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
{
super.writeEntityToNBT(par1NBTTagCompound);
par1NBTTagCompound.setBoolean("Angry", this.isAngry());
par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor());
}
@ -353,11 +352,6 @@ public class EntityElemental extends EntityDemon
super.readEntityFromNBT(par1NBTTagCompound);
this.setAngry(par1NBTTagCompound.getBoolean("Angry"));
if (par1NBTTagCompound.hasKey("CollarColor"))
{
this.setCollarColor(par1NBTTagCompound.getByte("CollarColor"));
}
this.setCombatTask();
}

View file

@ -148,7 +148,6 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
{
super.writeEntityToNBT(par1NBTTagCompound);
par1NBTTagCompound.setBoolean("Angry", this.isAngry());
par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor());
}
/**
@ -159,11 +158,6 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
super.readEntityFromNBT(par1NBTTagCompound);
this.setAngry(par1NBTTagCompound.getBoolean("Angry"));
if (par1NBTTagCompound.hasKey("CollarColor"))
{
this.setCollarColor(par1NBTTagCompound.getByte("CollarColor"));
}
this.setCombatTask();
}

View file

@ -149,7 +149,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
{
super.writeEntityToNBT(par1NBTTagCompound);
par1NBTTagCompound.setBoolean("Angry", this.isAngry());
par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor());
}
/**
@ -160,11 +159,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
super.readEntityFromNBT(par1NBTTagCompound);
this.setAngry(par1NBTTagCompound.getBoolean("Angry"));
if (par1NBTTagCompound.hasKey("CollarColor"))
{
this.setCollarColor(par1NBTTagCompound.getByte("CollarColor"));
}
this.setCombatTask();
}

View file

@ -134,7 +134,6 @@ public class EntityLowerGuardian extends EntityDemon
{
super.writeEntityToNBT(par1NBTTagCompound);
par1NBTTagCompound.setBoolean("Angry", this.isAngry());
par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor());
par1NBTTagCompound.setByte("attackTimer", (byte) attackTimer);
par1NBTTagCompound.setBoolean("isAggro", this.isAggro());
}
@ -147,11 +146,6 @@ public class EntityLowerGuardian extends EntityDemon
super.readEntityFromNBT(par1NBTTagCompound);
this.setAngry(par1NBTTagCompound.getBoolean("Angry"));
if (par1NBTTagCompound.hasKey("CollarColor"))
{
this.setCollarColor(par1NBTTagCompound.getByte("CollarColor"));
}
attackTimer = par1NBTTagCompound.getByte("attackTimer");
isAggro = par1NBTTagCompound.getBoolean("isAggro");
}

View file

@ -139,7 +139,6 @@ public class EntityShade extends EntityDemon
{
super.writeEntityToNBT(par1NBTTagCompound);
par1NBTTagCompound.setBoolean("Angry", this.isAngry());
par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor());
}
/**
@ -150,11 +149,6 @@ public class EntityShade extends EntityDemon
super.readEntityFromNBT(par1NBTTagCompound);
this.setAngry(par1NBTTagCompound.getBoolean("Angry"));
if (par1NBTTagCompound.hasKey("CollarColor"))
{
this.setCollarColor(par1NBTTagCompound.getByte("CollarColor"));
}
this.setCombatTask();
}

View file

@ -147,7 +147,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
{
super.writeEntityToNBT(par1NBTTagCompound);
par1NBTTagCompound.setBoolean("Angry", this.isAngry());
par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor());
}
/**
@ -158,11 +157,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
super.readEntityFromNBT(par1NBTTagCompound);
this.setAngry(par1NBTTagCompound.getBoolean("Angry"));
if (par1NBTTagCompound.hasKey("CollarColor"))
{
this.setCollarColor(par1NBTTagCompound.getByte("CollarColor"));
}
this.setCombatTask();
}

View file

@ -149,7 +149,6 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
{
super.writeEntityToNBT(par1NBTTagCompound);
par1NBTTagCompound.setBoolean("Angry", this.isAngry());
par1NBTTagCompound.setByte("CollarColor", (byte) this.getCollarColor());
}
/**
@ -160,11 +159,6 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
super.readEntityFromNBT(par1NBTTagCompound);
this.setAngry(par1NBTTagCompound.getBoolean("Angry"));
if (par1NBTTagCompound.hasKey("CollarColor"))
{
this.setCollarColor(par1NBTTagCompound.getByte("CollarColor"));
}
this.setCombatTask();
}

View file

@ -0,0 +1,127 @@
package WayofTime.alchemicalWizardry.common.harvest;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler;
public class BloodMagicHarvestHandler implements IHarvestHandler
{
public boolean canHandleBlock(Block block)
{
return block == Blocks.wheat || block == Blocks.carrots || block == Blocks.potatoes || block == Blocks.nether_wart;
}
public int getHarvestMeta(Block block)
{
if(block == Blocks.wheat)
{
return 7;
}
if(block == Blocks.carrots)
{
return 7;
}
if(block == Blocks.potatoes)
{
return 7;
}
if(block == Blocks.nether_wart)
{
return 3;
}
return 7;
}
@Override
public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta)
{
if(!this.canHandleBlock(block) || meta != this.getHarvestMeta(block))
{
return false;
}
IPlantable seed = this.getSeedItem(block);
if(seed == null)
{
return false;
}
int fortune = 0;
List<ItemStack> list = block.getDrops(world, xCoord, yCoord, zCoord, meta, fortune);
boolean foundAndRemovedSeed = false;
for(ItemStack stack : list)
{
if(stack == null)
{
continue;
}
Item item = stack.getItem();
if(item == seed)
{
int itemSize = stack.stackSize;
if(itemSize > 1)
{
stack.stackSize--;
foundAndRemovedSeed = true;
break;
}else if(itemSize == 1)
{
list.remove(stack);
foundAndRemovedSeed = true;
break;
}
}
}
if(foundAndRemovedSeed)
{
int plantMeta = seed.getPlantMetadata(world, xCoord, yCoord, zCoord);
Block plantBlock = seed.getPlant(world, xCoord, yCoord, zCoord);
world.setBlock(xCoord, yCoord, zCoord, plantBlock, plantMeta, 3);
for(ItemStack stack : list)
{
EntityItem itemEnt = new EntityItem(world, xCoord, yCoord, zCoord, stack);
world.spawnEntityInWorld(itemEnt);
}
}
return false;
}
public IPlantable getSeedItem(Block block)
{
if(block == Blocks.wheat)
{
return (IPlantable) Items.wheat_seeds;
}
if(block == Blocks.carrots)
{
return (IPlantable) Items.carrot;
}
if(block == Blocks.potatoes)
{
return (IPlantable) Items.potato;
}
if(block == Blocks.nether_wart)
{
return (IPlantable) Items.nether_wart;
}
return null;
}
}

View file

@ -0,0 +1,45 @@
package WayofTime.alchemicalWizardry.common.harvest;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler;
public class GourdHarvestHandler implements IHarvestHandler
{
public boolean canHandleBlock(Block block)
{
return block == Blocks.melon_block || block == Blocks.pumpkin;
}
@Override
public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta)
{
if(!this.canHandleBlock(block))
{
return false;
}
int fortune = 0;
List<ItemStack> list = block.getDrops(world, xCoord, yCoord, zCoord, meta, fortune);
world.setBlockToAir(xCoord, yCoord, zCoord);
for(ItemStack stack : list)
{
EntityItem itemEnt = new EntityItem(world, xCoord, yCoord, zCoord, stack);
world.spawnEntityInWorld(itemEnt);
}
return true;
}
}

View file

@ -41,11 +41,15 @@ public class ItemBloodRuneBlock extends ItemBlock
break;
case 3:
name = "test";
name = "orb";
break;
case 4:
name = "betterCapacity";
break;
default:
name = "broken";
name = "broken";
}
return getUnlocalizedName() + "." + name;

View file

@ -417,7 +417,7 @@ public class ItemSpellMultiTool extends Item
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
{
par3List.add("Here's a 'Tool Tip' :D");
par3List.add("A mace filled with ancient alchemy");
if (!(par1ItemStack.stackTagCompound == null))
{
@ -434,7 +434,7 @@ public class ItemSpellMultiTool extends Item
par3List.add("");
float damage = this.getCustomItemAttack(par1ItemStack);
par3List.add("\u00A79+" + ((int)(damage*10))/10.0f + " " + "Attack Damage");
float critChance = ((int)(this.getCritChance(par1ItemStack)*1000))/10;
float critChance = ((int)(this.getCritChance(par1ItemStack)*1000))/10.0f;
par3List.add("\u00A79+" + critChance + "% " + "Crit Chance");
}
}

View file

@ -0,0 +1,123 @@
package WayofTime.alchemicalWizardry.common.rituals;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
public class RitualEffectHarvest extends RitualEffect
{
@Override
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
int z = ritualStone.getZCoord();
int maxCount = 9;
if (currentEssence < this.getCostPerRefresh() * maxCount)
{
EntityPlayer entityOwner = SpellHelper.getPlayerForUsername(owner);
if (entityOwner == null)
{
return;
}
entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80));
} else
{
if (world.getWorldTime() % 20 != 0)
{
return;
}
int flag = 0;
int range = 4;
for (int i = -range; i <= range; i++)
{
for (int j = -range; j <= range; j++)
{
for(int k = -range; k<=range; k++)
{
if(HarvestRegistry.harvestBlock(world, x + i, y + j, z + k))
{
flag++;
}
}
}
}
if (flag > 0)
{
data.currentEssence = currentEssence - this.getCostPerRefresh() * Math.min(maxCount, flag);
data.markDirty();
}
}
}
@Override
public int getCostPerRefresh()
{
return 20;
}
@Override
public List<RitualComponent> getRitualComponentList()
{
ArrayList<RitualComponent> harvestRitual = new ArrayList();
harvestRitual.add(new RitualComponent(1,0,1,RitualComponent.DUSK));
harvestRitual.add(new RitualComponent(1,0,-1,RitualComponent.DUSK));
harvestRitual.add(new RitualComponent(-1,0,-1,RitualComponent.DUSK));
harvestRitual.add(new RitualComponent(-1,0,1,RitualComponent.DUSK));
harvestRitual.add(new RitualComponent(2,0,0,RitualComponent.EARTH));
harvestRitual.add(new RitualComponent(-2,0,0,RitualComponent.EARTH));
harvestRitual.add(new RitualComponent(0,0,2,RitualComponent.EARTH));
harvestRitual.add(new RitualComponent(0,0,-2,RitualComponent.EARTH));
harvestRitual.add(new RitualComponent(3,0,1,RitualComponent.EARTH));
harvestRitual.add(new RitualComponent(3,0,-1,RitualComponent.EARTH));
harvestRitual.add(new RitualComponent(-3,0,1,RitualComponent.EARTH));
harvestRitual.add(new RitualComponent(-3,0,-1,RitualComponent.EARTH));
harvestRitual.add(new RitualComponent(1,0,3,RitualComponent.EARTH));
harvestRitual.add(new RitualComponent(-1,0,3,RitualComponent.EARTH));
harvestRitual.add(new RitualComponent(1,0,-3,RitualComponent.EARTH));
harvestRitual.add(new RitualComponent(-1,0,-3,RitualComponent.EARTH));
harvestRitual.add(new RitualComponent(2,0,3,RitualComponent.WATER));
harvestRitual.add(new RitualComponent(3,0,2,RitualComponent.WATER));
harvestRitual.add(new RitualComponent(2,0,-3,RitualComponent.WATER));
harvestRitual.add(new RitualComponent(-3,0,2,RitualComponent.WATER));
harvestRitual.add(new RitualComponent(-2,0,3,RitualComponent.WATER));
harvestRitual.add(new RitualComponent(3,0,-2,RitualComponent.WATER));
harvestRitual.add(new RitualComponent(-2,0,-3,RitualComponent.WATER));
harvestRitual.add(new RitualComponent(-3,0,-2,RitualComponent.WATER));
return harvestRitual;
}
}

View file

@ -0,0 +1,180 @@
package WayofTime.alchemicalWizardry.common.rituals;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
public class RitualEffectLifeConduit extends RitualEffect
{
@Override
public void performEffect(IMasterRitualStone ritualStone)
{
String owner = ritualStone.getOwner();
World worldSave = MinecraftServer.getServer().worldServers[0];
LifeEssenceNetwork data = (LifeEssenceNetwork) worldSave.loadItemData(LifeEssenceNetwork.class, owner);
if (data == null)
{
data = new LifeEssenceNetwork(owner);
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
World world = ritualStone.getWorld();
int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord();
int z = ritualStone.getZCoord();
TEAltar tileAltar = null;
boolean testFlag = false;
for (int i = -5; i <= 5; i++)
{
for (int j = -5; j <= 5; j++)
{
for (int k = -10; k <= 10; k++)
{
if (world.getTileEntity(x + i, y + k, z + j) instanceof TEAltar)
{
tileAltar = (TEAltar) world.getTileEntity(x + i, y + k, z + j);
testFlag = true;
}
}
}
}
if (!testFlag)
{
return;
}
//tileAltar = (TEAltar)world.getBlockTileEntity(x,y-1,z);
int d0 = 15;
int vertRange = 20;
EntityPlayer entityOwner = null;
List<EntityPlayer> list = SpellHelper.getPlayersInRange(world, x, y, z, d0, vertRange);
for(EntityPlayer player : list)
{
if(SpellHelper.getUsername(player).equals(owner))
{
entityOwner = player;
}
}
if (entityOwner == null)
{
return;
}
int fillAmount = Math.min(currentEssence/2,tileAltar.fill(ForgeDirection.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid,10000), false));
{
tileAltar.fill(ForgeDirection.UP, new FluidStack(AlchemicalWizardry.lifeEssenceFluid,fillAmount), true);
if(entityOwner.getHealth() > 2.0f && fillAmount != 0)
{
entityOwner.setHealth(2.0f);
}
data.currentEssence = currentEssence - fillAmount*2;
}
}
@Override
public int getCostPerRefresh()
{
return 0;
}
@Override
public List<RitualComponent> getRitualComponentList()
{
ArrayList<RitualComponent> conduitRitual = new ArrayList();
conduitRitual.add(new RitualComponent(-1,0,-1,RitualComponent.FIRE));
conduitRitual.add(new RitualComponent(-1,0,1,RitualComponent.FIRE));
conduitRitual.add(new RitualComponent(1,0,1,RitualComponent.FIRE));
conduitRitual.add(new RitualComponent(1,0,-1,RitualComponent.FIRE));
for(int i=0; i<4; i++)
{
conduitRitual.add(new RitualComponent(-2,i,-2,RitualComponent.AIR));
conduitRitual.add(new RitualComponent(-2,i,2,RitualComponent.AIR));
conduitRitual.add(new RitualComponent(2,i,2,RitualComponent.AIR));
conduitRitual.add(new RitualComponent(2,i,-2,RitualComponent.AIR));
}
conduitRitual.add(new RitualComponent(4,1,4,RitualComponent.EARTH));
conduitRitual.add(new RitualComponent(4,1,-4,RitualComponent.EARTH));
conduitRitual.add(new RitualComponent(-4,1,-4,RitualComponent.EARTH));
conduitRitual.add(new RitualComponent(-4,1,4,RitualComponent.EARTH));
conduitRitual.add(new RitualComponent(3,1,4,RitualComponent.EARTH));
conduitRitual.add(new RitualComponent(4,1,3,RitualComponent.EARTH));
conduitRitual.add(new RitualComponent(-3,1,4,RitualComponent.EARTH));
conduitRitual.add(new RitualComponent(-4,1,3,RitualComponent.EARTH));
conduitRitual.add(new RitualComponent(3,1,-4,RitualComponent.EARTH));
conduitRitual.add(new RitualComponent(4,1,-3,RitualComponent.EARTH));
conduitRitual.add(new RitualComponent(-3,1,-4,RitualComponent.EARTH));
conduitRitual.add(new RitualComponent(-4,1,-3,RitualComponent.EARTH));
for(int i=0; i<2; i++)
{
conduitRitual.add(new RitualComponent(4,i+2,4,RitualComponent.WATER));
conduitRitual.add(new RitualComponent(4,i+2,-4,RitualComponent.WATER));
conduitRitual.add(new RitualComponent(-4,i+2,-4,RitualComponent.WATER));
conduitRitual.add(new RitualComponent(-4,i+2,4,RitualComponent.WATER));
}
conduitRitual.add(new RitualComponent(4,4,4,RitualComponent.DUSK));
conduitRitual.add(new RitualComponent(4,4,-4,RitualComponent.DUSK));
conduitRitual.add(new RitualComponent(-4,4,-4,RitualComponent.DUSK));
conduitRitual.add(new RitualComponent(-4,4,4,RitualComponent.DUSK));
conduitRitual.add(new RitualComponent(6,0,5,RitualComponent.FIRE));
conduitRitual.add(new RitualComponent(5,0,6,RitualComponent.FIRE));
conduitRitual.add(new RitualComponent(-6,0,5,RitualComponent.FIRE));
conduitRitual.add(new RitualComponent(-5,0,6,RitualComponent.FIRE));
conduitRitual.add(new RitualComponent(6,0,-5,RitualComponent.FIRE));
conduitRitual.add(new RitualComponent(5,0,-6,RitualComponent.FIRE));
conduitRitual.add(new RitualComponent(-6,0,-5,RitualComponent.FIRE));
conduitRitual.add(new RitualComponent(-5,0,-6,RitualComponent.FIRE));
for(int i=0; i<2; i++)
{
conduitRitual.add(new RitualComponent(6,i,6,RitualComponent.FIRE));
conduitRitual.add(new RitualComponent(6,i,-6,RitualComponent.FIRE));
conduitRitual.add(new RitualComponent(-6,i,6,RitualComponent.FIRE));
conduitRitual.add(new RitualComponent(-6,i,-6,RitualComponent.FIRE));
}
for(int i=0; i<3; i++)
{
conduitRitual.add(new RitualComponent(6,i+2,6,RitualComponent.BLANK));
conduitRitual.add(new RitualComponent(6,i+2,-6,RitualComponent.BLANK));
conduitRitual.add(new RitualComponent(-6,i+2,6,RitualComponent.BLANK));
conduitRitual.add(new RitualComponent(-6,i+2,-6,RitualComponent.BLANK));
}
conduitRitual.add(new RitualComponent(6,5,6,RitualComponent.DUSK));
conduitRitual.add(new RitualComponent(6,5,-6,RitualComponent.DUSK));
conduitRitual.add(new RitualComponent(-6,5,6,RitualComponent.DUSK));
conduitRitual.add(new RitualComponent(-6,5,-6,RitualComponent.DUSK));
return conduitRitual;
}
}

View file

@ -48,6 +48,7 @@ public class SpellParadigmTool extends SpellParadigm
private HashMap<String,Float> digSpeed;
private HashMap<String,Float> maxDamageHash;
private HashMap<String,Float> critChanceHash;
private HashMap<String,Integer> durationHash; //ticks
private HashMap<String, String> toolInfoString;
@ -66,6 +67,8 @@ public class SpellParadigmTool extends SpellParadigm
this.breakBlockEffectList = new LinkedList();
this.itemManipulatorEffectList = new LinkedList();
this.digAreaEffectList = new LinkedList();
this.specialDamageEffectList = new LinkedList();
this.durationHash = new HashMap();
this.toolInfoString = new HashMap();
this.critChanceHash = new HashMap();
@ -73,12 +76,12 @@ public class SpellParadigmTool extends SpellParadigm
this.maxDamage = 5;
this.harvestLevel = new HashMap();
this.harvestLevel.put("pickaxe", 2);
this.harvestLevel.put("pickaxe", -1);
this.harvestLevel.put("shovel", -1);
this.harvestLevel.put("axe", -1);
this.digSpeed = new HashMap();
this.digSpeed.put("pickaxe", 6.0f);
this.digSpeed.put("pickaxe", 1.0f);
this.digSpeed.put("shovel", 1.0f);
this.digSpeed.put("axe", 1.0f);
@ -88,7 +91,9 @@ public class SpellParadigmTool extends SpellParadigm
this.fortuneLevel = 0;
this.silkTouch = false;
this.duration = 2400;
this.duration = 0;
this.durationHash.put("default", 2400);
//this.addRightClickEffect(new RightClickTunnel(0,0,0));
@ -178,6 +183,11 @@ public class SpellParadigmTool extends SpellParadigm
itemTool.setToolListString(toolStack, toolStringList);
for(Integer integ : this.durationHash.values())
{
this.duration += integ;
}
itemTool.setDuration(toolStack, world, this.duration);
itemTool.loadParadigmIntoStack(toolStack, this.bufferedEffectList);
@ -453,6 +463,11 @@ public class SpellParadigmTool extends SpellParadigm
this.critChanceHash.put(key, chance);
}
public void addDuration(String key, int dur)
{
this.durationHash.put(key, dur);
}
public float getCritChance()
{
float chance = 0.0f;

View file

@ -263,22 +263,18 @@ public class SpellEffectEarth extends SpellEffect
@Override
protected int getCostForOffenseTool()
{
// TODO Auto-generated method stub
return 0;
return 1000;
}
@Override
protected int getCostForDefenseTool()
{
return (int)(1000 * (1 + this.potencyEnhancement*0.1f) * (1 + this.powerEnhancement*0.2f) * Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForEnvironmentTool()
{
return (int)(10 * (1+this.potencyEnhancement*0.8) * Math.pow(1.5*this.powerEnhancement + 3, 2) * Math.pow(0.85, this.costEnhancement));
}
}

View file

@ -17,6 +17,7 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fi
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfEnvironmentalFire;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfOffensiveFire;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ToolDefaultFire;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ToolEnvironmentalFire;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ToolOffensiveFire;
public class SpellEffectFire extends SpellEffect
@ -181,15 +182,21 @@ public class SpellEffectFire extends SpellEffect
}
@Override
public void defensiveModificationTool(SpellParadigmTool parad) {
// TODO Auto-generated method stub
public void defensiveModificationTool(SpellParadigmTool parad)
{
parad.addCritChance("defFire", this.potencyEnhancement);
parad.addDuration("defFire", 1200 * this.powerEnhancement);
parad.addToolString("defFire", "Unbreaking" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1));
}
@Override
public void environmentalModificationTool(SpellParadigmTool parad) {
// TODO Auto-generated method stub
public void environmentalModificationTool(SpellParadigmTool parad)
{
parad.addBlockBreakEffect(new ToolEnvironmentalFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
parad.addToolString("envFire", "Magma Plume" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1));
}
@Override
@ -201,18 +208,18 @@ public class SpellEffectFire extends SpellEffect
@Override
protected int getCostForOffenseTool()
{
return (int)(0); //TODO
return (int)(1000 * (1 + this.powerEnhancement*0.3f) * (1 + this.potencyEnhancement*0.2f) * Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForDefenseTool() {
// TODO Auto-generated method stub
return 0;
protected int getCostForDefenseTool()
{
return (int)(500 * (1 + this.powerEnhancement*0.5f) * (1 + this.potencyEnhancement) * Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForEnvironmentTool() {
// TODO Auto-generated method stub
protected int getCostForEnvironmentTool()
{
return 0;
}
}

View file

@ -0,0 +1,47 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.OnBreakBlockEffect;
public class ToolEnvironmentalFire extends OnBreakBlockEffect
{
public ToolEnvironmentalFire(int power, int potency, int cost)
{
super(power, potency, cost);
}
@Override
public int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken)
{
int amount = 0;
int cost = (int)(250 * (1 - 0.1f*powerUpgrades) * Math.pow(0.85, costUpgrades));
int radius = this.powerUpgrades;
float chance = 0.35f + 0.15f*this.potencyUpgrades;
for(int i=-radius; i<=radius; i++)
{
for(int j=-radius; j<=radius; j++)
{
for(int k=-radius; k<=radius; k++)
{
Block blockAffected = world.getBlock(x + i -sideBroken.offsetX, y + j, z + k - sideBroken.offsetZ);
if((new Random().nextFloat() <= chance) && (blockAffected == Blocks.gravel || blockAffected == Blocks.stone || blockAffected == Blocks.cobblestone))
{
world.setBlock(x + i -sideBroken.offsetX, y + j, z + k - sideBroken.offsetZ, Blocks.lava);
amount += cost;
}
}
}
}
return amount;
}
}

View file

@ -1,6 +1,5 @@
package WayofTime.alchemicalWizardry.common.tileEntity;
import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
@ -27,6 +26,7 @@ import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe;
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.AltarUpgradeComponent;
import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars;
@ -867,11 +867,11 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
this.isUpgraded = checkUpgrade;
this.upgradeLevel = upgradeState;
this.consumptionMultiplier = (float) (0.15 * upgrades.getSpeedUpgrades());
this.consumptionMultiplier = (float) (0.20 * upgrades.getSpeedUpgrades());
this.efficiencyMultiplier = (float) Math.pow(0.85, upgrades.getSpeedUpgrades());
this.sacrificeEfficiencyMultiplier = (float) (0.10 * upgrades.getSacrificeUpgrades());
this.selfSacrificeEfficiencyMultiplier = (float) (0.10 * upgrades.getSelfSacrificeUpgrades());
this.capacityMultiplier = (float) (1 + 0.15 * upgrades.getAltarCapacitiveUpgrades());
this.capacityMultiplier = (float) ((1*Math.pow(1.10,upgrades.getBetterCapacitiveUpgrades()) + 0.20 * upgrades.getAltarCapacitiveUpgrades()));
//TODO finalize values
this.dislocationMultiplier = (float) (Math.pow(1.2, upgrades.getDisplacementUpgrades()));
this.orbCapacityMultiplier = (float) (1 + 0.02 * upgrades.getOrbCapacitiveUpgrades());

View file

@ -36,6 +36,9 @@ import com.google.gson.GsonBuilder;
public class TEDemonPortal extends TileEntity
{
public static int buildingGridDelay = 25;
public static int roadGridDelay = 10;
public static List<DemonBuilding> buildingList = new ArrayList();
public Random rand = new Random();
private GridSpace[][] area;
@ -47,6 +50,11 @@ public class TEDemonPortal extends TileEntity
private boolean isInitialized;
public int houseCooldown;
public int roadCooldown;
public int tier; //Tier of the demon portal - Should select buildings 2 below to this
public int totalPoints;
public TEDemonPortal()
{
super();
@ -71,6 +79,9 @@ public class TEDemonPortal extends TileEntity
isInitialized = false;
this.setGridSpace(0, 0, new GridSpace(GridSpace.MAIN_PORTAL, yCoord));
this.houseCooldown = 0;
this.roadCooldown = 0;
}
public void initialize()
@ -87,6 +98,9 @@ public class TEDemonPortal extends TileEntity
if(Math.abs(xIndex) == 1 || Math.abs(zIndex) == 1)
{
this.setGridSpace(xIndex, zIndex, new GridSpace(GridSpace.ROAD,yCoord));
}else if(xIndex == 0 && zIndex == 0)
{
this.setGridSpace(0, 0, new GridSpace(GridSpace.MAIN_PORTAL, yCoord));
}else
{
this.setGridSpace(xIndex, zIndex, new GridSpace());
@ -94,9 +108,41 @@ public class TEDemonPortal extends TileEntity
}
}
this.houseCooldown = TEDemonPortal.buildingGridDelay;
this.roadCooldown = TEDemonPortal.roadGridDelay;
isInitialized = true;
}
@Override
public void updateEntity()
{
if(!isInitialized)
{
return;
}
if(this.roadCooldown <= 0)
{
int roadsMade = this.createRandomRoad();
if(roadsMade > 0)
{
this.roadCooldown = TEDemonPortal.roadGridDelay * roadsMade;
}
}
else if(this.houseCooldown <= 0)
{
int gridsUsed = this.createRandomBuilding(0, 0);
if(gridsUsed > 0)
{
this.houseCooldown = TEDemonPortal.buildingGridDelay * gridsUsed;
}
}
this.houseCooldown = Math.max(0, this.houseCooldown - 1);
this.roadCooldown = Math.max(0, this.roadCooldown - 1);
}
@Override
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
{
@ -105,6 +151,8 @@ public class TEDemonPortal extends TileEntity
this.negZRadius = par1NBTTagCompound.getInteger("negZRadius");
this.posXRadius = par1NBTTagCompound.getInteger("posXRadius");
this.posZRadius = par1NBTTagCompound.getInteger("posZRadius");
this.houseCooldown = par1NBTTagCompound.getInteger("houseCooldown");
this.roadCooldown = par1NBTTagCompound.getInteger("roadCooldown");
area = new GridSpace[negXRadius + posXRadius + 1][negZRadius + posZRadius + 1];
@ -124,6 +172,9 @@ public class TEDemonPortal extends TileEntity
}
this.isInitialized = par1NBTTagCompound.getBoolean("init");
this.tier = par1NBTTagCompound.getInteger("tier");
this.totalPoints = par1NBTTagCompound.getInteger("totalPoints");
}
@Override
@ -134,6 +185,8 @@ public class TEDemonPortal extends TileEntity
par1NBTTagCompound.setInteger("negZRadius", negZRadius);
par1NBTTagCompound.setInteger("posXRadius", posXRadius);
par1NBTTagCompound.setInteger("posZRadius", posZRadius);
par1NBTTagCompound.setInteger("houseCooldown", houseCooldown);
par1NBTTagCompound.setInteger("roadCooldown", roadCooldown);
NBTTagList gridList = new NBTTagList();
@ -161,9 +214,11 @@ public class TEDemonPortal extends TileEntity
par1NBTTagCompound.setTag("Grid", gridList);
par1NBTTagCompound.setBoolean("init", isInitialized);
par1NBTTagCompound.setInteger("tier", this.tier);
par1NBTTagCompound.setInteger("totalPoints", this.totalPoints);
}
public void createRandomRoad()
public int createRandomRoad() //Return the number of road spaces
{
int next = rand.nextInt(4);
ForgeDirection dir;
@ -200,7 +255,7 @@ public class TEDemonPortal extends TileEntity
if(directions.size() <= 0)
{
return;
return 0;
}
int maxDistance = 5;
@ -223,12 +278,14 @@ public class TEDemonPortal extends TileEntity
if(dominantDirection == null)
{
return;
return 0;
}
System.out.println("I got here!");
System.out.println("Distance: " + distance + " Direction: " + dominantDirection.toString() + " yLevel: " + yLevel);
this.createGriddedRoad(x, yLevel, z, dominantDirection, distance+1, true);
return distance;
}
public List<ForgeDirection> findValidExtentionDirection(int x, int z)
@ -725,33 +782,35 @@ public class TEDemonPortal extends TileEntity
{
return;
}
Int3 roadMarker = this.getNextRoadMarker();
this.initialize();
if(ForgeDirection.getOrientation(side) == ForgeDirection.UP)
{
this.createRandomBuilding(DemonBuilding.BUILDING_HOUSE, 0);
}else if(ForgeDirection.getOrientation(side) == ForgeDirection.DOWN)
{
this.createRandomBuilding(DemonBuilding.BUILDING_PORTAL, 0);
}else
{
this.createRandomRoad();
}
}
public void createRandomBuilding(int type, int tier)
public int createRandomBuilding(int type, int tier)
{
switch(type)
{
case DemonBuilding.BUILDING_HOUSE:
this.createRandomHouse(tier);
break;
return this.createRandomHouse(tier);
case DemonBuilding.BUILDING_PORTAL:
this.createPortalBuilding(tier);
break;
return this.createPortalBuilding(tier);
}
return 0;
}
public void createPortalBuilding(int buildingTier)
public int createPortalBuilding(int buildingTier)
{
int x = 0;
int z = 0;
@ -766,7 +825,7 @@ public class TEDemonPortal extends TileEntity
for(int i=2; i<6; i++)
{
ForgeDirection testDir = ForgeDirection.getOrientation(i);
if(this.getGridSpace(x + testDir.offsetX, z + testDir.offsetZ).isEmpty())
//if(this.getGridSpace(x + testDir.offsetX, z + testDir.offsetZ).isEmpty())
{
directions.add(testDir);
}
@ -774,7 +833,7 @@ public class TEDemonPortal extends TileEntity
if(directions.isEmpty())
{
return;
return 0;
}
HashMap<ForgeDirection, List<DemonBuilding>> schemMap = new HashMap();
@ -783,6 +842,10 @@ public class TEDemonPortal extends TileEntity
{
for(DemonBuilding build : TEDemonPortal.buildingList)
{
if(build.buildingType != DemonBuilding.BUILDING_PORTAL)
{
continue;
}
if(schemMap.containsKey(nextDir))
{
schemMap.get(nextDir).add(build);
@ -796,7 +859,7 @@ public class TEDemonPortal extends TileEntity
if(schemMap.keySet().isEmpty())
{
return;
return 0;
}
ForgeDirection chosenDirection = (ForgeDirection) schemMap.keySet().toArray()[new Random().nextInt(schemMap.keySet().size())];
@ -820,9 +883,11 @@ public class TEDemonPortal extends TileEntity
build.buildAll(worldObj, xCoord + (x)*5, yLevel, zCoord + (z)*5, chosenDirection.getOpposite());
build.setAllGridSpaces(x, z, yLevel, chosenDirection.getOpposite(), GridSpace.MAIN_PORTAL, grid);
this.loadGSH(grid);
return build.getNumberOfGridSpaces();
}
public void createRandomHouse(int buildingTier)
public int createRandomHouse(int buildingTier)
{
int next = rand.nextInt(4);
ForgeDirection dir;
@ -845,8 +910,6 @@ public class TEDemonPortal extends TileEntity
dir = ForgeDirection.NORTH;
}
int length = 5;
boolean newProtocol = true;
if(newProtocol)
@ -863,7 +926,7 @@ public class TEDemonPortal extends TileEntity
if(!this.getGridSpace(x, z).isRoadSegment())
{
return;
return 0;
}
List<ForgeDirection> directions = new ArrayList();
@ -879,7 +942,7 @@ public class TEDemonPortal extends TileEntity
if(directions.isEmpty())
{
return;
return 0;
}
HashMap<ForgeDirection, List<DemonBuilding>> schemMap = new HashMap();
@ -915,7 +978,7 @@ public class TEDemonPortal extends TileEntity
if(schemMap.keySet().isEmpty())
{
return;
return 0;
}
ForgeDirection chosenDirection = (ForgeDirection) schemMap.keySet().toArray()[new Random().nextInt(schemMap.keySet().size())];
@ -929,6 +992,8 @@ public class TEDemonPortal extends TileEntity
build.buildAll(worldObj, xCoord + (x + xOff)*5, yLevel, zCoord + (z + zOff)*5, chosenDirection.getOpposite());
build.setAllGridSpaces(x + xOff, z + zOff, yLevel, chosenDirection.getOpposite(), GridSpace.HOUSE, grid);
this.loadGSH(grid);
return build.getNumberOfGridSpaces();
}else
{
Int3 space = findEmptySpaceNearRoad(dir, 3*(rand.nextInt(negXRadius + negZRadius + posXRadius + posZRadius))+1, 2);
@ -940,12 +1005,12 @@ public class TEDemonPortal extends TileEntity
GridSpace newSpace = this.getGridSpace(x, z);
if(!newSpace.isEmpty())
{
return;
return 0;
}
if(yLevel == -1)
{
return;
return 0;
}
GridSpaceHolder grid = this.createGSH();
@ -985,7 +1050,7 @@ public class TEDemonPortal extends TileEntity
build = buildingList.get(new Random().nextInt(buildingList.size()));
}else
{
return;
return 0;
}
//TODO: Finish the selection algorythm
//TODO: Should favour those directions that have a road right next to them.
@ -994,7 +1059,8 @@ public class TEDemonPortal extends TileEntity
build.setAllGridSpaces(x, z, yLevel, chosenDirection, GridSpace.HOUSE, grid);
this.loadGSH(grid);
System.out.println("X: " + x + " Z: " + z + " Direction: " + chosenDirection.toString());
return build.getNumberOfGridSpaces();
// System.out.println("X: " + x + " Z: " + z + " Direction: " + chosenDirection.toString());
}
}
@ -1064,34 +1130,6 @@ public class TEDemonPortal extends TileEntity
return 10;
}
public Block getRoadMarker()
{
return ModBlocks.ritualStone;
}
public Int3 getNextRoadMarker()
{
int horizSearchMax = 25;
int vertSearchMax = 10;
for(int xPos=xCoord-horizSearchMax; xPos<=xCoord+horizSearchMax; xPos++)
{
for(int zPos=zCoord-horizSearchMax; zPos<=zCoord+horizSearchMax; zPos++)
{
for(int yPos=yCoord-vertSearchMax; yPos<=yCoord+vertSearchMax; yPos++)
{
Block block = worldObj.getBlock(xPos, yPos, zPos);
if(block == this.getRoadMarker())
{
return new Int3(xPos,yPos,zPos);
}
}
}
}
return null;
}
public int getRoadSpacer()
{
return 1;
@ -1150,4 +1188,14 @@ public class TEDemonPortal extends TileEntity
}
public int getTotalPoints()
{
return this.totalPoints;
}
public void addToPoints(int addition)
{
this.totalPoints += addition;
}
}

View file

@ -3,7 +3,8 @@ tile.bloodAltar.name=Blood Altar
tile.bloodRune.blank.name=Blood Rune
tile.bloodRune.fill.name=Rune of Augmented Capacity
tile.bloodRune.empty.name=Rune of Dislocation
tile.bloodRune.test.name=Rune of the Orb
tile.bloodRune.orb.name=Rune of the Orb
tile.bloodRune.betterCapacity.name=Rune of Superior Capacity
tile.speedRune.name=Speed Rune
tile.efficiencyRune.name=Efficiency Rune
tile.runeOfSacrifice.name=Rune of Sacrifice
@ -25,6 +26,7 @@ tile.blockConduit.name=Spell Conduit
tile.blockSpellParadigm.projectile.name=Particle Generator
tile.blockSpellParadigm.self.name=Self Augmentator
tile.blockSpellParadigm.melee.name=Melee Aggregator
tile.blockSpellParadigm.tool.name=Tool Forger
tile.blockSpellEnhancement.power1.name=Unstable Spell Empowerer
tile.blockSpellEnhancement.power2.name=Standard Spell Empowerer
tile.blockSpellEnhancement.power3.name=Reinforced Spell Empowerer
@ -129,7 +131,7 @@ item.bloodLightSigil.name=Sigil of the Blood Lamp
item.itemComplexSpellCrystal.name=Complex Spell Crystal
item.itemSigilOfSupression.name=Sigil of Supression
item.itemSigilOfEnderSeverance.name=Sigil of Ender Severance
item.bucketLive.name=Bucket of Life
item.bucketLife.name=Bucket of Life
item.bloodMagicBaseItem.QuartzRod.name=Quartz Rod
item.bloodMagicBaseItem.EmptyCore.name=Empty Core
item.bloodMagicBaseItem.MagicalesCable.name=Magicales Cable
@ -138,6 +140,7 @@ item.bloodMagicBaseItem.StoneBrace.name=Stone Brace
item.bloodMagicBaseItem.ProjectileCore.name=Projectile Core
item.bloodMagicBaseItem.SelfCore.name=Self Core
item.bloodMagicBaseItem.MeleeCore.name=Melee Core
item.bloodMagicBaseItem.ToolCore.name=Tool Core
item.bloodMagicBaseItem.ParadigmBackPlate.name=Paradigm Plate
item.bloodMagicBaseItem.OutputCable.name=Output Spell Cable
item.bloodMagicBaseItem.InputCable.name=Input Spell Cable
@ -168,7 +171,7 @@ item.bloodMagicAlchemyItem.Potentia.name=Potentia
item.sanguineHelmet.name=Sanguine Helmet
item.itemSeerSigil.name=Sigil of Sight
item.itemFluidSigil.name=
item.multiTool.name=Dynamic Mace
#Creative Tab
itemGroup.tabBloodMagic=Blood Magic

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 594 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

View file

@ -130,6 +130,7 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiHandler;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
@ -187,6 +188,7 @@ public class AlchemicalWizardry
public static boolean isForestryLoaded;
public static boolean wimpySettings;
public static boolean respawnWithLowerHealth;
public static CreativeTabs tabBloodMagic = new CreativeTabs("tabBloodMagic")
{
@ -335,8 +337,9 @@ public class AlchemicalWizardry
RecipeSorter.INSTANCE.register("AWWayofTime:shapedorb", ShapedBloodOrbRecipe.class, Category.SHAPED, "before:minecraft:shapeless");
RecipeSorter.INSTANCE.register("AWWayofTime:shapelessorb", ShapelessBloodOrbRecipe.class, Category.SHAPELESS, "after:minecraft:shapeless");
//FMLCommonHandler.instance().bus().register(new AlchemicalWizardryEventHooks());
MinecraftForge.EVENT_BUS.register(new AlchemicalWizardryEventHooks());
Object eventHook = new AlchemicalWizardryEventHooks();
FMLCommonHandler.instance().bus().register(eventHook);
MinecraftForge.EVENT_BUS.register(eventHook);
NewPacketHandler.INSTANCE.ordinal();
}

View file

@ -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.
@ -64,7 +62,8 @@ public class BloodMagicConfiguration
AlchemicalWizardry.allowedCrushedOresArray = config.get("oreCrushing", "allowedOres", new String[]{"iron","gold","copper","tin","lead","silver","osmium"}).getStringList();
AlchemicalWizardry.wimpySettings = config.get("WimpySettings","IDontLikeFun",false).getBoolean(false);
AlchemicalWizardry.respawnWithLowerHealth = config.get("WimpySettings", "RespawnWithLowerHealth", true).getBoolean(true);
} catch (Exception e)
{

View file

@ -23,7 +23,7 @@ public class HarvestRegistry
for(IHarvestHandler handler : handlerList)
{
if(handler.canHandleBlock(block) && handler.harvestAndPlant(world, xCoord, yCoord, zCoord, block, meta))
if(handler.harvestAndPlant(world, xCoord, yCoord, zCoord, block, meta))
{
return true;
}

View file

@ -6,11 +6,16 @@ import net.minecraftforge.common.IPlantable;
public interface IHarvestHandler
{
public boolean canHandleBlock(Block block);
public int getHarvestMeta(Block block);
/**
* A handler that is used to harvest and replant the block at the specified location
*
* @param world
* @param xCoord
* @param yCoord
* @param zCoord
* @param block block at this given location
* @param meta meta at this given location
* @return true if successfully harvested, false if not
*/
public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta);
public IPlantable getSeedItem(Block block);
}

View file

@ -25,10 +25,7 @@ import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjecti
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.Type;
import cpw.mods.fml.relauncher.ReflectionHelper;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent;
public class AlchemicalWizardryEventHooks
{
@ -36,6 +33,15 @@ public class AlchemicalWizardryEventHooks
public static Map<String,Boolean> playerBoostStepHeight = new HashMap();
public static List<String> playersWith1Step = new ArrayList();
@SubscribeEvent
public void onPlayerRespawnEvent(PlayerRespawnEvent event)
{
if(AlchemicalWizardry.respawnWithLowerHealth)
{
event.player.setHealth(6);
}
}
@SubscribeEvent
public void onLivingJumpEvent(LivingJumpEvent event)
{

View file

@ -14,13 +14,11 @@ import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler;
public class BloodMagicHarvestHandler implements IHarvestHandler
{
@Override
public boolean canHandleBlock(Block block)
{
return block == Blocks.wheat || block == Blocks.carrots || block == Blocks.potatoes || block == Blocks.nether_wart;
}
@Override
public int getHarvestMeta(Block block)
{
if(block == Blocks.wheat)
@ -105,7 +103,6 @@ public class BloodMagicHarvestHandler implements IHarvestHandler
return false;
}
@Override
public IPlantable getSeedItem(Block block)
{
if(block == Blocks.wheat)

View file

@ -14,18 +14,11 @@ import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler;
public class GourdHarvestHandler implements IHarvestHandler
{
@Override
public boolean canHandleBlock(Block block)
{
return block == Blocks.melon_block || block == Blocks.pumpkin;
}
@Override
public int getHarvestMeta(Block block)
{
return 0;
}
@Override
public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta)
{
@ -47,12 +40,6 @@ public class GourdHarvestHandler implements IHarvestHandler
world.spawnEntityInWorld(itemEnt);
}
return false;
}
@Override
public IPlantable getSeedItem(Block block)
{
return null;
return true;
}
}