More demon village tweaks, adding more event functionality

This commit is contained in:
WayofTime 2014-11-30 17:56:10 -05:00
parent 1115eaf9a7
commit d439ac92fc
14 changed files with 83 additions and 31 deletions

View file

@ -1,12 +1,12 @@
# #
#Sat Nov 22 10:17:06 EST 2014 #Sat Nov 29 10:45:33 EST 2014
mod_name=BloodMagic mod_name=BloodMagic
forge_version=10.13.2.1232 forge_version=10.13.2.1232
ccc_version=1.0.4.29 ccc_version=1.0.4.29
nei_version=1.0.3.64 nei_version=1.0.3.64
//=Dependency Information //=Dependency Information
package_group=com.wayoftime.bloodmagic package_group=com.wayoftime.bloodmagic
mod_version=1.2.1a mod_version=1.2.1b
minetweaker_version=Dev-1.7.10-3.0.9B minetweaker_version=Dev-1.7.10-3.0.9B
mc_version=1.7.10
build_number=2 build_number=2
mc_version=1.7.10

View file

@ -250,7 +250,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.2.1a", guiFactory = "WayofTime.alchemicalWizardry.client.gui.ConfigGuiFactory") @Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.2.1b", guiFactory = "WayofTime.alchemicalWizardry.client.gui.ConfigGuiFactory")
public class AlchemicalWizardry public class AlchemicalWizardry
{ {

View file

@ -12,8 +12,6 @@ import net.minecraftforge.common.config.Configuration;
import WayofTime.alchemicalWizardry.api.rituals.Rituals; import WayofTime.alchemicalWizardry.api.rituals.Rituals;
import WayofTime.alchemicalWizardry.client.renderer.ColourThreshold; import WayofTime.alchemicalWizardry.client.renderer.ColourThreshold;
import WayofTime.alchemicalWizardry.client.renderer.RenderHelper; import WayofTime.alchemicalWizardry.client.renderer.RenderHelper;
import WayofTime.alchemicalWizardry.common.demonVillage.DemonVillagePath;
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
import WayofTime.alchemicalWizardry.common.items.BoundArmour; import WayofTime.alchemicalWizardry.common.items.BoundArmour;
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm; import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm;
import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLCommonHandler;
@ -135,19 +133,19 @@ public class BloodMagicConfiguration
AlchemicalWizardry.ritualDisabledVeilOfEvil = config.get("Ritual Blacklist", "Veil of Evil", false).getBoolean(false); AlchemicalWizardry.ritualDisabledVeilOfEvil = config.get("Ritual Blacklist", "Veil of Evil", false).getBoolean(false);
AlchemicalWizardry.ritualDisabledFullStomach = config.get("Ritual Blacklist", "Requiem of the Satiated Stomach", false).getBoolean(false); AlchemicalWizardry.ritualDisabledFullStomach = config.get("Ritual Blacklist", "Requiem of the Satiated Stomach", false).getBoolean(false);
String tempDemonConfigs = "Temp Demon Configs"; // String tempDemonConfigs = "Temp Demon Configs";
TEDemonPortal.buildingGridDelay = config.get(tempDemonConfigs, "Building Grid Delay", 25).getInt(); // TEDemonPortal.buildingGridDelay = config.get(tempDemonConfigs, "Building Grid Delay", 25).getInt();
TEDemonPortal.roadGridDelay = config.get(tempDemonConfigs, "Road Grid Delay", 10).getInt(); // TEDemonPortal.roadGridDelay = config.get(tempDemonConfigs, "Road Grid Delay", 10).getInt();
TEDemonPortal.demonHoardDelay = config.get(tempDemonConfigs, "Demon Hoard Delay", 40).getInt(); // TEDemonPortal.demonHoardDelay = config.get(tempDemonConfigs, "Demon Hoard Delay", 40).getInt();
TEDemonPortal.demonRoadChance = (float)(config.get(tempDemonConfigs, "Demon Road Chance", 0.6f).getDouble()); // TEDemonPortal.demonRoadChance = (float)(config.get(tempDemonConfigs, "Demon Road Chance", 0.6f).getDouble());
TEDemonPortal.demonHouseChance = (float)(config.get(tempDemonConfigs, "Demon House Chance", 0.6f).getDouble()); // TEDemonPortal.demonHouseChance = (float)(config.get(tempDemonConfigs, "Demon House Chance", 0.6f).getDouble());
TEDemonPortal.demonPortalChance = (float)(config.get(tempDemonConfigs, "Demon Portal Chance", 0.5f).getDouble()); // TEDemonPortal.demonPortalChance = (float)(config.get(tempDemonConfigs, "Demon Portal Chance", 0.5f).getDouble());
TEDemonPortal.demonHoardChance = (float)(config.get(tempDemonConfigs, "Demon Hoard Chance", 1.0f).getDouble()); // TEDemonPortal.demonHoardChance = (float)(config.get(tempDemonConfigs, "Demon Hoard Chance", 1.0f).getDouble());
TEDemonPortal.portalTickRate = (float)(config.get(tempDemonConfigs, "Portal Tick Rate", 0.1f).getDouble()); // TEDemonPortal.portalTickRate = (float)(config.get(tempDemonConfigs, "Portal Tick Rate", 0.1f).getDouble());
//
DemonVillagePath.canGoDown = config.get(tempDemonConfigs, "canRoadGoDown", true).getBoolean(); // DemonVillagePath.canGoDown = config.get(tempDemonConfigs, "canRoadGoDown", true).getBoolean();
DemonVillagePath.tunnelIfObstructed = config.get(tempDemonConfigs, "tunnelIfObstructed", false).getBoolean(); // DemonVillagePath.tunnelIfObstructed = config.get(tempDemonConfigs, "tunnelIfObstructed", false).getBoolean();
DemonVillagePath.createBridgeInAirIfObstructed = config.get(tempDemonConfigs, "createBridgeInAirIfObstructed", false).getBoolean(); // DemonVillagePath.createBridgeInAirIfObstructed = config.get(tempDemonConfigs, "createBridgeInAirIfObstructed", false).getBoolean();
BoundArmour.tryComplexRendering = config.get("WimpySettings", "UseFancyBoundArmour", true).getBoolean(true); BoundArmour.tryComplexRendering = config.get("WimpySettings", "UseFancyBoundArmour", true).getBoolean(true);

View file

@ -0,0 +1,15 @@
package WayofTime.alchemicalWizardry.api.event;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.eventhandler.Cancelable;
@Cancelable
public class ItemDrainInContainerEvent extends SoulNetworkEvent
{
public ItemStack stack;
public ItemDrainInContainerEvent(ItemStack stack, String ownerNetwork, int drainAmount)
{
super(ownerNetwork, drainAmount);
this.stack = stack;
}
}

View file

@ -17,12 +17,12 @@ import cpw.mods.fml.common.eventhandler.Event;
public class Rituals public class Rituals
{ {
private int crystalLevel; public final int crystalLevel;
private int actCost; public final int actCost;
private RitualEffect effect; public final RitualEffect effect;
private String name; public final String name;
private MRSRenderer customRenderer; public final MRSRenderer customRenderer;
public static Map<String, Rituals> ritualMap = new HashMap(); public static Map<String, Rituals> ritualMap = new HashMap();
public static List<String> keyList = new LinkedList(); public static List<String> keyList = new LinkedList();

View file

@ -13,11 +13,13 @@ import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import WayofTime.alchemicalWizardry.api.event.AddToNetworkEvent; import WayofTime.alchemicalWizardry.api.event.AddToNetworkEvent;
import WayofTime.alchemicalWizardry.api.event.ItemBindEvent; import WayofTime.alchemicalWizardry.api.event.ItemBindEvent;
import WayofTime.alchemicalWizardry.api.event.ItemDrainInContainerEvent;
import WayofTime.alchemicalWizardry.api.event.ItemDrainNetworkEvent; import WayofTime.alchemicalWizardry.api.event.ItemDrainNetworkEvent;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import cpw.mods.fml.common.eventhandler.Event; import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.eventhandler.Event.Result;
public class SoulNetworkHandler public class SoulNetworkHandler
{ {
@ -33,6 +35,24 @@ public class SoulNetworkHandler
gameProfile = server.func_152358_ax().func_152652_a(uuid); gameProfile = server.func_152358_ax().func_152652_a(uuid);
return null; return null;
} }
public static boolean syphonFromNetworkWhileInContainer(ItemStack ist, int damageToBeDone)
{
String ownerName = "";
if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals("")))
{
ownerName = ist.getTagCompound().getString("ownerName");
}
ItemDrainInContainerEvent event = new ItemDrainInContainerEvent(ist, ownerName, damageToBeDone);
if(MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Result.DENY)
{
return false;
}
return syphonFromNetwork(event.ownerNetwork, event.drainAmount) >= damageToBeDone;
}
public static int syphonFromNetwork(ItemStack ist, int damageToBeDone) public static int syphonFromNetwork(ItemStack ist, int damageToBeDone)
{ {

View file

@ -187,6 +187,9 @@ public class BlockTeleposer extends BlockContainer
int metaI = worldI.getBlockMetadata(xi, yi, zi); int metaI = worldI.getBlockMetadata(xi, yi, zi);
int metaF = worldF.getBlockMetadata(xf, yf, zf); int metaF = worldF.getBlockMetadata(xf, yf, zf);
//TODO Teleposer event
worldI.playSoundEffect(xi, yi, zi, "mob.endermen.portal", 1.0F, 1.0F); worldI.playSoundEffect(xi, yi, zi, "mob.endermen.portal", 1.0F, 1.0F);
worldF.playSoundEffect(xf, yf, zf, "mob.endermen.portal", 1.0F, 1.0F); worldF.playSoundEffect(xf, yf, zf, "mob.endermen.portal", 1.0F, 1.0F);

View file

@ -43,7 +43,7 @@ import com.google.gson.GsonBuilder;
public class TEDemonPortal extends TileEntity public class TEDemonPortal extends TileEntity
{ {
boolean printDebug = false; public static boolean printDebug = false;
public static int buildingGridDelay = 25; public static int buildingGridDelay = 25;
public static int roadGridDelay = 10; public static int roadGridDelay = 10;
@ -334,11 +334,14 @@ public class TEDemonPortal extends TileEntity
this.incrementPoints(); this.incrementPoints();
this.assignPoints(); this.assignPoints();
if(printDebug)
AlchemicalWizardry.logger.info("Roads: " + roadCooldown + " Buildings: " + houseCooldown); AlchemicalWizardry.logger.info("Roads: " + roadCooldown + " Buildings: " + houseCooldown);
if(buildingStage >= 0 && buildingStage <=2) if(buildingStage >= 0 && buildingStage <=2)
{ {
if(printDebug)
AlchemicalWizardry.logger.info("BuildingStage = " + buildingStage); AlchemicalWizardry.logger.info("BuildingStage = " + buildingStage);
if(printDebug)
AlchemicalWizardry.logger.info("Tier = " + this.tier); AlchemicalWizardry.logger.info("Tier = " + this.tier);
this.createPortalBuilding(buildingStage, nextDemonPortalName, tier); this.createPortalBuilding(buildingStage, nextDemonPortalName, tier);
buildingStage++; buildingStage++;
@ -1138,6 +1141,7 @@ public class TEDemonPortal extends TileEntity
public int createPortalBuilding(int buildingTier) //TODO Telepose block next time, then build the new building. public int createPortalBuilding(int buildingTier) //TODO Telepose block next time, then build the new building.
{ {
if(printDebug)
AlchemicalWizardry.logger.info("Hello, I am here!"); AlchemicalWizardry.logger.info("Hello, I am here!");
int x = 0; int x = 0;
int z = 0; int z = 0;
@ -1345,6 +1349,7 @@ public class TEDemonPortal extends TileEntity
} }
} else } else
{ {
if(printDebug)
AlchemicalWizardry.logger.info("This ISN'T valid!"); AlchemicalWizardry.logger.info("This ISN'T valid!");
} }
} }

View file

@ -5,6 +5,7 @@ import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable; import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork; import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@ -75,7 +76,7 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl
return par1ItemStack; return par1ItemStack;
} }
EnergyItems.addEssenceToMaximum(itemTag.getString("ownerName"), 200, this.getMaxEssence()); SoulNetworkHandler.addCurrentEssenceToMaximum(itemTag.getString("ownerName"), 200, this.getMaxEssence());
EnergyItems.hurtPlayer(par3EntityPlayer, 200); EnergyItems.hurtPlayer(par3EntityPlayer, 200);
return par1ItemStack; return par1ItemStack;
} }

View file

@ -83,6 +83,7 @@ public class EnergyItems extends Item implements IBindable
return true; return true;
} }
@Deprecated
public static boolean syphonWhileInContainer(ItemStack ist, int damageToBeDone) public static boolean syphonWhileInContainer(ItemStack ist, int damageToBeDone)
{ {
if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals(""))) if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals("")))

View file

@ -62,6 +62,11 @@ public class DivinationSigil extends Item implements ArmourUpgrade, IReagentMani
{ {
return par1ItemStack; return par1ItemStack;
} }
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 0))
{
return par1ItemStack;
}
NBTTagCompound itemTag = par1ItemStack.stackTagCompound; NBTTagCompound itemTag = par1ItemStack.stackTagCompound;

View file

@ -151,7 +151,11 @@ public class TEAlchemicCalcinator extends TEReagentConduit implements IInventory
return; return;
} }
SoulNetworkHandler.syphonFromNetwork(orbStack, lpPerTick); if(!SoulNetworkHandler.syphonFromNetworkWhileInContainer(orbStack, lpPerTick))
{
return;
}
progress++; progress++;
if (worldObj.getWorldTime() % 4 == 0) if (worldObj.getWorldTime() % 4 == 0)

View file

@ -17,13 +17,13 @@ import WayofTime.alchemicalWizardry.api.alchemy.AlchemicalPotionCreationHandler;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipe; import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipe;
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry; import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.IBindingAgent; import WayofTime.alchemicalWizardry.common.IBindingAgent;
import WayofTime.alchemicalWizardry.common.ICatalyst; import WayofTime.alchemicalWizardry.common.ICatalyst;
import WayofTime.alchemicalWizardry.common.IFillingAgent; import WayofTime.alchemicalWizardry.common.IFillingAgent;
import WayofTime.alchemicalWizardry.common.NewPacketHandler; import WayofTime.alchemicalWizardry.common.NewPacketHandler;
import WayofTime.alchemicalWizardry.common.alchemy.CombinedPotionRegistry; import WayofTime.alchemicalWizardry.common.alchemy.CombinedPotionRegistry;
import WayofTime.alchemicalWizardry.common.alchemy.ICombinationalCatalyst; import WayofTime.alchemicalWizardry.common.alchemy.ICombinationalCatalyst;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask; import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
@ -737,7 +737,7 @@ public class TEWritingTable extends TileEntity implements IInventory, ISidedInve
if (getStackInSlot(6) == null) if (getStackInSlot(6) == null)
{ {
if (!EnergyItems.syphonWhileInContainer(getStackInSlot(0), amountUsed * acceleration)) if (!SoulNetworkHandler.syphonFromNetworkWhileInContainer(getStackInSlot(0), amountUsed * acceleration))
{ {
return; return;
} }
@ -775,7 +775,7 @@ public class TEWritingTable extends TileEntity implements IInventory, ISidedInve
SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord); SpellHelper.sendIndexedParticleToAllAround(worldObj, xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, 1, xCoord, yCoord, zCoord);
} }
if (!EnergyItems.syphonWhileInContainer(getStackInSlot(0), amountUsed * acceleration)) if (!SoulNetworkHandler.syphonFromNetworkWhileInContainer(getStackInSlot(0), amountUsed * acceleration))
{ {
return; return;
} }

View file

@ -3,7 +3,7 @@
"modid": "AWWayofTime", "modid": "AWWayofTime",
"name": "Blood Magic: Alchemical Wizardry", "name": "Blood Magic: Alchemical Wizardry",
"description": "Rituals, spells, and more!", "description": "Rituals, spells, and more!",
"version": "v1.2.0b(1.7.10)", "version": "v1.2.1b(1.7.10)",
"mcversion": "1.7.10", "mcversion": "1.7.10",
"url": "http://www.minecraftforum.net/topic/1899223-", "url": "http://www.minecraftforum.net/topic/1899223-",
"updateUrl": "", "updateUrl": "",