Switch to real logger, create ConfigGui, remove random debug thing
-Uses an actual logger instead of System.out.println. -ConfigGui for ingame editing of configs. -Some random leftover debug was being sent to console at startup. This removes that.
This commit is contained in:
parent
51346b5638
commit
4638f1b239
10 changed files with 693 additions and 717 deletions
|
@ -1,11 +1,18 @@
|
|||
package WayofTime.alchemicalWizardry.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.BloodMagicConfiguration;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.items.BoundArmour;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
|
@ -28,476 +35,476 @@ import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
|
|||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.items.BoundArmour;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class AlchemicalWizardryEventHooks
|
||||
{
|
||||
public static Map<String, Boolean> playerFlightBuff = new HashMap();
|
||||
public static Map<String, Boolean> playerBoostStepHeight = new HashMap();
|
||||
public static List<String> playersWith1Step = new ArrayList();
|
||||
public static Map<String, Boolean> playerFlightBuff = new HashMap();
|
||||
public static Map<String, Boolean> playerBoostStepHeight = new HashMap();
|
||||
public static List<String> playersWith1Step = new ArrayList();
|
||||
|
||||
public static Map<Integer, List<CoordAndRange>> respawnMap = new HashMap();
|
||||
public static Map<Integer, List<CoordAndRange>> forceSpawnMap = new HashMap();
|
||||
public static Map<Integer, List<CoordAndRange>> respawnMap = new HashMap();
|
||||
public static Map<Integer, List<CoordAndRange>> forceSpawnMap = new HashMap();
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onAnvilUpdateEvent(AnvilUpdateEvent event)
|
||||
{
|
||||
if(event.isCancelable() && event.left != null && event.left.getItem() instanceof BoundArmour && event.right != null)
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerDamageEvent(LivingAttackEvent event)
|
||||
{
|
||||
if (event.source.isProjectile())
|
||||
{
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionProjProt) && event.isCancelable())
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingSpawnEvent(CheckSpawn event)
|
||||
{
|
||||
if (!(event.entityLiving instanceof EntityMob))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void onAnvilUpdateEvent(AnvilUpdateEvent event)
|
||||
{
|
||||
if(event.isCancelable() && event.left != null && event.left.getItem() instanceof BoundArmour && event.right != null)
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
String respawnRitual = "AW028SpawnWard";
|
||||
@SubscribeEvent
|
||||
public void onPlayerDamageEvent(LivingAttackEvent event)
|
||||
{
|
||||
if (event.source.isProjectile())
|
||||
{
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionProjProt) && event.isCancelable())
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Integer dimension = new Integer(event.world.provider.dimensionId);
|
||||
if (respawnMap.containsKey(dimension))
|
||||
{
|
||||
List<CoordAndRange> list = respawnMap.get(dimension);
|
||||
@SubscribeEvent
|
||||
public void onLivingSpawnEvent(CheckSpawn event)
|
||||
{
|
||||
if (!(event.entityLiving instanceof EntityMob))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (list != null)
|
||||
{
|
||||
for (CoordAndRange coords : list)
|
||||
{
|
||||
TileEntity tile = event.world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
String respawnRitual = "AW028SpawnWard";
|
||||
|
||||
if (tile instanceof TEMasterStone && ((TEMasterStone) tile).isRunning && ((TEMasterStone) tile).getCurrentRitual().equals(respawnRitual))
|
||||
{
|
||||
if (event.x > coords.xCoord - coords.horizRadius && event.x < coords.xCoord + coords.horizRadius && event.z > coords.zCoord - coords.horizRadius && event.z < coords.zCoord + coords.horizRadius && event.y > coords.yCoord - coords.vertRadius && event.y < coords.yCoord + coords.vertRadius)
|
||||
{
|
||||
switch (event.getResult())
|
||||
{
|
||||
case ALLOW:
|
||||
event.setResult(Result.DEFAULT);
|
||||
break;
|
||||
case DEFAULT:
|
||||
event.setResult(Result.DENY);
|
||||
break;
|
||||
case DENY:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else
|
||||
{
|
||||
list.remove(coords);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Integer dimension = new Integer(event.world.provider.dimensionId);
|
||||
if (respawnMap.containsKey(dimension))
|
||||
{
|
||||
List<CoordAndRange> list = respawnMap.get(dimension);
|
||||
|
||||
if (event.entityLiving instanceof EntityCreeper)
|
||||
{
|
||||
GameRegistry d;
|
||||
return;
|
||||
}
|
||||
if (list != null)
|
||||
{
|
||||
for (CoordAndRange coords : list)
|
||||
{
|
||||
TileEntity tile = event.world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
|
||||
String forceSpawnRitual = "AW029VeilOfEvil";
|
||||
if (tile instanceof TEMasterStone && ((TEMasterStone) tile).isRunning && ((TEMasterStone) tile).getCurrentRitual().equals(respawnRitual))
|
||||
{
|
||||
if (event.x > coords.xCoord - coords.horizRadius && event.x < coords.xCoord + coords.horizRadius && event.z > coords.zCoord - coords.horizRadius && event.z < coords.zCoord + coords.horizRadius && event.y > coords.yCoord - coords.vertRadius && event.y < coords.yCoord + coords.vertRadius)
|
||||
{
|
||||
switch (event.getResult())
|
||||
{
|
||||
case ALLOW:
|
||||
event.setResult(Result.DEFAULT);
|
||||
break;
|
||||
case DEFAULT:
|
||||
event.setResult(Result.DENY);
|
||||
break;
|
||||
case DENY:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else
|
||||
{
|
||||
list.remove(coords);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (forceSpawnMap.containsKey(dimension))
|
||||
{
|
||||
List<CoordAndRange> list = forceSpawnMap.get(dimension);
|
||||
if (event.entityLiving instanceof EntityCreeper)
|
||||
{
|
||||
GameRegistry d;
|
||||
return;
|
||||
}
|
||||
|
||||
if (list != null)
|
||||
{
|
||||
for (CoordAndRange coords : list)
|
||||
{
|
||||
TileEntity tile = event.world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
String forceSpawnRitual = "AW029VeilOfEvil";
|
||||
|
||||
if (tile instanceof TEMasterStone && ((TEMasterStone) tile).isRunning && ((TEMasterStone) tile).getCurrentRitual().equals(forceSpawnRitual))
|
||||
{
|
||||
if (event.x > coords.xCoord - coords.horizRadius && event.x < coords.xCoord + coords.horizRadius && event.z > coords.zCoord - coords.horizRadius && event.z < coords.zCoord + coords.horizRadius && event.y > coords.yCoord - coords.vertRadius && event.y < coords.yCoord + coords.vertRadius)
|
||||
{
|
||||
switch (event.getResult())
|
||||
{
|
||||
case ALLOW:
|
||||
break;
|
||||
case DEFAULT:
|
||||
event.setResult(Result.ALLOW);
|
||||
break;
|
||||
case DENY:
|
||||
event.setResult(Result.DEFAULT);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else
|
||||
{
|
||||
list.remove(coords);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (forceSpawnMap.containsKey(dimension))
|
||||
{
|
||||
List<CoordAndRange> list = forceSpawnMap.get(dimension);
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerRespawnEvent(PlayerRespawnEvent event)
|
||||
{
|
||||
if (AlchemicalWizardry.respawnWithDebuff)
|
||||
{
|
||||
event.player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionSoulFray.id, 20 * 60 * 5, 0));
|
||||
}
|
||||
}
|
||||
if (list != null)
|
||||
{
|
||||
for (CoordAndRange coords : list)
|
||||
{
|
||||
TileEntity tile = event.world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingJumpEvent(LivingJumpEvent event)
|
||||
{
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionBoost))
|
||||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionBoost).getAmplifier();
|
||||
event.entityLiving.motionY += (0.1f) * (2 + i);
|
||||
}
|
||||
if (tile instanceof TEMasterStone && ((TEMasterStone) tile).isRunning && ((TEMasterStone) tile).getCurrentRitual().equals(forceSpawnRitual))
|
||||
{
|
||||
if (event.x > coords.xCoord - coords.horizRadius && event.x < coords.xCoord + coords.horizRadius && event.z > coords.zCoord - coords.horizRadius && event.z < coords.zCoord + coords.horizRadius && event.y > coords.yCoord - coords.vertRadius && event.y < coords.yCoord + coords.vertRadius)
|
||||
{
|
||||
switch (event.getResult())
|
||||
{
|
||||
case ALLOW:
|
||||
break;
|
||||
case DEFAULT:
|
||||
event.setResult(Result.ALLOW);
|
||||
break;
|
||||
case DENY:
|
||||
event.setResult(Result.DEFAULT);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else
|
||||
{
|
||||
list.remove(coords);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionHeavyHeart))
|
||||
{
|
||||
event.entityLiving.motionY = 0;
|
||||
}
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void onPlayerRespawnEvent(PlayerRespawnEvent event)
|
||||
{
|
||||
if (AlchemicalWizardry.respawnWithDebuff)
|
||||
{
|
||||
event.player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionSoulFray.id, 20 * 60 * 5, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEndermanTeleportEvent(EnderTeleportEvent event)
|
||||
{
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionPlanarBinding) && event.isCancelable())
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void onLivingJumpEvent(LivingJumpEvent event)
|
||||
{
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionBoost))
|
||||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionBoost).getAmplifier();
|
||||
event.entityLiving.motionY += (0.1f) * (2 + i);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityDamaged(LivingAttackEvent event)
|
||||
{
|
||||
EntityLivingBase entityAttacked = event.entityLiving;
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionHeavyHeart))
|
||||
{
|
||||
event.entityLiving.motionY = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (entityAttacked.isPotionActive(AlchemicalWizardry.customPotionReciprocation))
|
||||
{
|
||||
Entity entityAttacking = event.source.getSourceOfDamage();
|
||||
@SubscribeEvent
|
||||
public void onEndermanTeleportEvent(EnderTeleportEvent event)
|
||||
{
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionPlanarBinding) && event.isCancelable())
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (entityAttacking != null && entityAttacking instanceof EntityLivingBase)
|
||||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionReciprocation).getAmplifier();
|
||||
float damageRecieve = event.ammount / 2 * (i + 1);
|
||||
((EntityLivingBase) entityAttacking).attackEntityFrom(DamageSource.generic, damageRecieve);
|
||||
}
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void onEntityDamaged(LivingAttackEvent event)
|
||||
{
|
||||
EntityLivingBase entityAttacked = event.entityLiving;
|
||||
|
||||
if (entityAttacked.isPotionActive(AlchemicalWizardry.customPotionFlameCloak))
|
||||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFlameCloak).getAmplifier();
|
||||
if (entityAttacked.isPotionActive(AlchemicalWizardry.customPotionReciprocation))
|
||||
{
|
||||
Entity entityAttacking = event.source.getSourceOfDamage();
|
||||
|
||||
Entity entityAttacking = event.source.getSourceOfDamage();
|
||||
if (entityAttacking != null && entityAttacking instanceof EntityLivingBase)
|
||||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionReciprocation).getAmplifier();
|
||||
float damageRecieve = event.ammount / 2 * (i + 1);
|
||||
((EntityLivingBase) entityAttacking).attackEntityFrom(DamageSource.generic, damageRecieve);
|
||||
}
|
||||
}
|
||||
|
||||
if (entityAttacking != null && entityAttacking instanceof EntityLivingBase && !entityAttacking.isImmuneToFire() && !((EntityLivingBase) entityAttacking).isPotionActive(Potion.fireResistance))
|
||||
{
|
||||
entityAttacking.attackEntityFrom(DamageSource.inFire, 2 * i + 2);
|
||||
entityAttacking.setFire(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (entityAttacked.isPotionActive(AlchemicalWizardry.customPotionFlameCloak))
|
||||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFlameCloak).getAmplifier();
|
||||
|
||||
// @ForgeSubscribe
|
||||
// public void onFOVUpdate(FOVUpdateEvent event)
|
||||
// {
|
||||
// event.setResult(Result.DEFAULT);
|
||||
// }
|
||||
Entity entityAttacking = event.source.getSourceOfDamage();
|
||||
|
||||
// @SubscribeEvent
|
||||
// public void onPlayerTickEnd(PlayerTickEvent event)
|
||||
// {
|
||||
// if(event.type.equals(Type.PLAYER) && event.phase.equals(TickEvent.Phase.END))
|
||||
// {
|
||||
// ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, event.player.capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"});
|
||||
// }
|
||||
// }
|
||||
if (entityAttacking != null && entityAttacking instanceof EntityLivingBase && !entityAttacking.isImmuneToFire() && !((EntityLivingBase) entityAttacking).isPotionActive(Potion.fireResistance))
|
||||
{
|
||||
entityAttacking.attackEntityFrom(DamageSource.inFire, 2 * i + 2);
|
||||
entityAttacking.setFire(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityUpdate(LivingUpdateEvent event)
|
||||
{
|
||||
EntityLivingBase entityLiving = event.entityLiving;
|
||||
double x = entityLiving.posX;
|
||||
double y = entityLiving.posY;
|
||||
double z = entityLiving.posZ;
|
||||
// @ForgeSubscribe
|
||||
// public void onFOVUpdate(FOVUpdateEvent event)
|
||||
// {
|
||||
// event.setResult(Result.DEFAULT);
|
||||
// }
|
||||
|
||||
Vec3 blockVector = SpellHelper.getEntityBlockVector(entityLiving);
|
||||
int xPos = (int) (blockVector.xCoord);
|
||||
int yPos = (int) (blockVector.yCoord);
|
||||
int zPos = (int) (blockVector.zCoord);
|
||||
// @SubscribeEvent
|
||||
// public void onPlayerTickEnd(PlayerTickEvent event)
|
||||
// {
|
||||
// if(event.type.equals(Type.PLAYER) && event.phase.equals(TickEvent.Phase.END))
|
||||
// {
|
||||
// ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, event.player.capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"});
|
||||
// }
|
||||
// }
|
||||
|
||||
if (entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, ((EntityPlayer) event.entityLiving).capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"});
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void onEntityUpdate(LivingUpdateEvent event)
|
||||
{
|
||||
EntityLivingBase entityLiving = event.entityLiving;
|
||||
double x = entityLiving.posX;
|
||||
double y = entityLiving.posY;
|
||||
double z = entityLiving.posZ;
|
||||
|
||||
if (entityLiving instanceof EntityPlayer && entityLiving.worldObj.isRemote)
|
||||
{
|
||||
EntityPlayer entityPlayer = (EntityPlayer) entityLiving;
|
||||
boolean highStepListed = playersWith1Step.contains(entityPlayer.getDisplayName());
|
||||
boolean hasHighStep = entityPlayer.isPotionActive(AlchemicalWizardry.customPotionBoost);
|
||||
Vec3 blockVector = SpellHelper.getEntityBlockVector(entityLiving);
|
||||
int xPos = (int) (blockVector.xCoord);
|
||||
int yPos = (int) (blockVector.yCoord);
|
||||
int zPos = (int) (blockVector.zCoord);
|
||||
|
||||
if (hasHighStep && !highStepListed)
|
||||
{
|
||||
playersWith1Step.add(SpellHelper.getUsername(entityPlayer));
|
||||
}
|
||||
if (entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, ((EntityPlayer) event.entityLiving).capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"});
|
||||
}
|
||||
|
||||
if (!hasHighStep && highStepListed)
|
||||
{
|
||||
playersWith1Step.remove(SpellHelper.getUsername(entityPlayer));
|
||||
entityPlayer.stepHeight = 0.5F;
|
||||
}
|
||||
}
|
||||
if (entityLiving instanceof EntityPlayer && entityLiving.worldObj.isRemote)
|
||||
{
|
||||
EntityPlayer entityPlayer = (EntityPlayer) entityLiving;
|
||||
boolean highStepListed = playersWith1Step.contains(entityPlayer.getDisplayName());
|
||||
boolean hasHighStep = entityPlayer.isPotionActive(AlchemicalWizardry.customPotionBoost);
|
||||
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionFeatherFall))
|
||||
{
|
||||
event.entityLiving.fallDistance = 0;
|
||||
}
|
||||
if (hasHighStep && !highStepListed)
|
||||
{
|
||||
playersWith1Step.add(SpellHelper.getUsername(entityPlayer));
|
||||
}
|
||||
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionDrowning))
|
||||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionDrowning).getAmplifier();
|
||||
if (!hasHighStep && highStepListed)
|
||||
{
|
||||
playersWith1Step.remove(SpellHelper.getUsername(entityPlayer));
|
||||
entityPlayer.stepHeight = 0.5F;
|
||||
}
|
||||
}
|
||||
|
||||
if (event.entityLiving.worldObj.getWorldTime() % ((int) (20 / (i + 1))) == 0)
|
||||
{
|
||||
event.entityLiving.attackEntityFrom(DamageSource.drown, 2);
|
||||
event.entityLiving.hurtResistantTime = Math.min(event.entityLiving.hurtResistantTime, 20 / (i + 1));
|
||||
}
|
||||
}
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionFeatherFall))
|
||||
{
|
||||
event.entityLiving.fallDistance = 0;
|
||||
}
|
||||
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionBoost))
|
||||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionBoost).getAmplifier();
|
||||
EntityLivingBase entity = event.entityLiving;
|
||||
//if(!entity.isSneaking())
|
||||
{
|
||||
float percentIncrease = (i + 1) * 0.05f;
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionDrowning))
|
||||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionDrowning).getAmplifier();
|
||||
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving;
|
||||
entityPlayer.stepHeight = 1.0f;
|
||||
if (event.entityLiving.worldObj.getWorldTime() % ((int) (20 / (i + 1))) == 0)
|
||||
{
|
||||
event.entityLiving.attackEntityFrom(DamageSource.drown, 2);
|
||||
event.entityLiving.hurtResistantTime = Math.min(event.entityLiving.hurtResistantTime, 20 / (i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
if ((entityPlayer.onGround || entityPlayer.capabilities.isFlying) && entityPlayer.moveForward > 0F)
|
||||
entityPlayer.moveFlying(0F, 1F, entityPlayer.capabilities.isFlying ? (percentIncrease / 2.0f) : percentIncrease);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionBoost))
|
||||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionBoost).getAmplifier();
|
||||
EntityLivingBase entity = event.entityLiving;
|
||||
//if(!entity.isSneaking())
|
||||
{
|
||||
float percentIncrease = (i + 1) * 0.05f;
|
||||
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionProjProt))
|
||||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionProjProt).getAmplifier();
|
||||
EntityLivingBase entity = event.entityLiving;
|
||||
int posX = (int) Math.round(entity.posX - 0.5f);
|
||||
int posY = (int) Math.round(entity.posY);
|
||||
int posZ = (int) Math.round(entity.posZ - 0.5f);
|
||||
int d0 = (int) ((i + 1) * 2.5);
|
||||
AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(posX - 0.5, posY - 0.5, posZ - 0.5, posX + 0.5, posY + 0.5, posZ + 0.5).expand(d0, d0, d0);
|
||||
List list = event.entityLiving.worldObj.getEntitiesWithinAABB(Entity.class, axisalignedbb);
|
||||
Iterator iterator = list.iterator();
|
||||
EntityLivingBase livingEntity;
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving;
|
||||
entityPlayer.stepHeight = 1.0f;
|
||||
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
Entity projectile = (Entity) iterator.next();
|
||||
if ((entityPlayer.onGround || entityPlayer.capabilities.isFlying) && entityPlayer.moveForward > 0F)
|
||||
entityPlayer.moveFlying(0F, 1F, entityPlayer.capabilities.isFlying ? (percentIncrease / 2.0f) : percentIncrease);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (projectile == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionProjProt))
|
||||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionProjProt).getAmplifier();
|
||||
EntityLivingBase entity = event.entityLiving;
|
||||
int posX = (int) Math.round(entity.posX - 0.5f);
|
||||
int posY = (int) Math.round(entity.posY);
|
||||
int posZ = (int) Math.round(entity.posZ - 0.5f);
|
||||
int d0 = (int) ((i + 1) * 2.5);
|
||||
AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(posX - 0.5, posY - 0.5, posZ - 0.5, posX + 0.5, posY + 0.5, posZ + 0.5).expand(d0, d0, d0);
|
||||
List list = event.entityLiving.worldObj.getEntitiesWithinAABB(Entity.class, axisalignedbb);
|
||||
Iterator iterator = list.iterator();
|
||||
EntityLivingBase livingEntity;
|
||||
|
||||
if (!(projectile instanceof IProjectile) || (AlchemicalWizardry.isBotaniaLoaded && isManaBurst(projectile)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
Entity projectile = (Entity) iterator.next();
|
||||
|
||||
Entity throwingEntity = null;
|
||||
if (projectile == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (projectile instanceof EntityArrow)
|
||||
{
|
||||
throwingEntity = ((EntityArrow) projectile).shootingEntity;
|
||||
} else if (projectile instanceof EnergyBlastProjectile)
|
||||
{
|
||||
throwingEntity = ((EnergyBlastProjectile) projectile).shootingEntity;
|
||||
} else if (projectile instanceof EntityThrowable)
|
||||
{
|
||||
throwingEntity = ((EntityThrowable) projectile).getThrower();
|
||||
}
|
||||
if (!(projectile instanceof IProjectile) || (AlchemicalWizardry.isBotaniaLoaded && isManaBurst(projectile)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (throwingEntity != null && throwingEntity.equals(entity))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Entity throwingEntity = null;
|
||||
|
||||
double delX = projectile.posX - entity.posX;
|
||||
double delY = projectile.posY - entity.posY;
|
||||
double delZ = projectile.posZ - entity.posZ;
|
||||
if (projectile instanceof EntityArrow)
|
||||
{
|
||||
throwingEntity = ((EntityArrow) projectile).shootingEntity;
|
||||
} else if (projectile instanceof EnergyBlastProjectile)
|
||||
{
|
||||
throwingEntity = ((EnergyBlastProjectile) projectile).shootingEntity;
|
||||
} else if (projectile instanceof EntityThrowable)
|
||||
{
|
||||
throwingEntity = ((EntityThrowable) projectile).getThrower();
|
||||
}
|
||||
|
||||
if (throwingEntity != null)
|
||||
{
|
||||
delX = -projectile.posX + throwingEntity.posX;
|
||||
delY = -projectile.posY + (throwingEntity.posY + throwingEntity.getEyeHeight());
|
||||
delZ = -projectile.posZ + throwingEntity.posZ;
|
||||
}
|
||||
if (throwingEntity != null && throwingEntity.equals(entity))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
double curVel = Math.sqrt(delX * delX + delY * delY + delZ * delZ);
|
||||
double delX = projectile.posX - entity.posX;
|
||||
double delY = projectile.posY - entity.posY;
|
||||
double delZ = projectile.posZ - entity.posZ;
|
||||
|
||||
delX /= curVel;
|
||||
delY /= curVel;
|
||||
delZ /= curVel;
|
||||
double newVel = Math.sqrt(projectile.motionX * projectile.motionX + projectile.motionY * projectile.motionY + projectile.motionZ * projectile.motionZ);
|
||||
projectile.motionX = newVel * delX;
|
||||
projectile.motionY = newVel * delY;
|
||||
projectile.motionZ = newVel * delZ;
|
||||
//TODO make this not affect player's projectiles
|
||||
}
|
||||
}
|
||||
if (throwingEntity != null)
|
||||
{
|
||||
delX = -projectile.posX + throwingEntity.posX;
|
||||
delY = -projectile.posY + (throwingEntity.posY + throwingEntity.getEyeHeight());
|
||||
delZ = -projectile.posZ + throwingEntity.posZ;
|
||||
}
|
||||
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionFlight))
|
||||
{
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving;
|
||||
String ownerName = SpellHelper.getUsername(entityPlayer);
|
||||
playerFlightBuff.put(ownerName, true);
|
||||
entityPlayer.capabilities.allowFlying = true;
|
||||
}
|
||||
} else
|
||||
{
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving;
|
||||
String ownerName = SpellHelper.getUsername(entityPlayer);
|
||||
double curVel = Math.sqrt(delX * delX + delY * delY + delZ * delZ);
|
||||
|
||||
if (!playerFlightBuff.containsKey(ownerName))
|
||||
{
|
||||
playerFlightBuff.put(ownerName, false);
|
||||
}
|
||||
delX /= curVel;
|
||||
delY /= curVel;
|
||||
delZ /= curVel;
|
||||
double newVel = Math.sqrt(projectile.motionX * projectile.motionX + projectile.motionY * projectile.motionY + projectile.motionZ * projectile.motionZ);
|
||||
projectile.motionX = newVel * delX;
|
||||
projectile.motionY = newVel * delY;
|
||||
projectile.motionZ = newVel * delZ;
|
||||
//TODO make this not affect player's projectiles
|
||||
}
|
||||
}
|
||||
|
||||
if (playerFlightBuff.get(ownerName))
|
||||
{
|
||||
playerFlightBuff.put(ownerName, false);
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionFlight))
|
||||
{
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving;
|
||||
String ownerName = SpellHelper.getUsername(entityPlayer);
|
||||
playerFlightBuff.put(ownerName, true);
|
||||
entityPlayer.capabilities.allowFlying = true;
|
||||
}
|
||||
} else
|
||||
{
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving;
|
||||
String ownerName = SpellHelper.getUsername(entityPlayer);
|
||||
|
||||
if (!entityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
entityPlayer.capabilities.allowFlying = false;
|
||||
entityPlayer.capabilities.isFlying = false;
|
||||
entityPlayer.sendPlayerAbilities();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!playerFlightBuff.containsKey(ownerName))
|
||||
{
|
||||
playerFlightBuff.put(ownerName, false);
|
||||
}
|
||||
|
||||
if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionFlameCloak))
|
||||
{
|
||||
entityLiving.worldObj.spawnParticle("flame", x + SpellHelper.gaussian(1), y - 1.3 + SpellHelper.gaussian(0.3), z + SpellHelper.gaussian(1), 0, 0.06d, 0);
|
||||
if (playerFlightBuff.get(ownerName))
|
||||
{
|
||||
playerFlightBuff.put(ownerName, false);
|
||||
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFlameCloak).getAmplifier();
|
||||
double range = i * 0.5;
|
||||
if (!entityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
entityPlayer.capabilities.allowFlying = false;
|
||||
entityPlayer.capabilities.isFlying = false;
|
||||
entityPlayer.sendPlayerAbilities();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<Entity> entities = SpellHelper.getEntitiesInRange(entityLiving.worldObj, x, y, z, range, range);
|
||||
if (entities != null)
|
||||
{
|
||||
for (Entity entity : entities)
|
||||
{
|
||||
if (!entity.equals(entityLiving) && !entity.isImmuneToFire() && !(entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isPotionActive(Potion.fireResistance)))
|
||||
{
|
||||
entity.setFire(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionFlameCloak))
|
||||
{
|
||||
entityLiving.worldObj.spawnParticle("flame", x + SpellHelper.gaussian(1), y - 1.3 + SpellHelper.gaussian(0.3), z + SpellHelper.gaussian(1), 0, 0.06d, 0);
|
||||
|
||||
if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionIceCloak))
|
||||
{
|
||||
if (entityLiving.worldObj.getWorldTime() % 2 == 0)
|
||||
entityLiving.worldObj.spawnParticle("reddust", x + SpellHelper.gaussian(1), y - 1.3 + SpellHelper.gaussian(0.3), z + SpellHelper.gaussian(1), 0x74, 0xbb, 0xfb);
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFlameCloak).getAmplifier();
|
||||
double range = i * 0.5;
|
||||
|
||||
int r = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionIceCloak).getAmplifier();
|
||||
int horizRange = r + 1;
|
||||
int vertRange = 1;
|
||||
List<Entity> entities = SpellHelper.getEntitiesInRange(entityLiving.worldObj, x, y, z, range, range);
|
||||
if (entities != null)
|
||||
{
|
||||
for (Entity entity : entities)
|
||||
{
|
||||
if (!entity.equals(entityLiving) && !entity.isImmuneToFire() && !(entity instanceof EntityLivingBase && ((EntityLivingBase) entity).isPotionActive(Potion.fireResistance)))
|
||||
{
|
||||
entity.setFire(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!entityLiving.worldObj.isRemote)
|
||||
{
|
||||
for (int i = -horizRange; i <= horizRange; i++)
|
||||
{
|
||||
for (int k = -horizRange; k <= horizRange; k++)
|
||||
{
|
||||
for (int j = -vertRange - 1; j <= vertRange - 1; j++)
|
||||
{
|
||||
SpellHelper.freezeWaterBlock(entityLiving.worldObj, xPos + i, yPos + j, zPos + k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionIceCloak))
|
||||
{
|
||||
if (entityLiving.worldObj.getWorldTime() % 2 == 0)
|
||||
entityLiving.worldObj.spawnParticle("reddust", x + SpellHelper.gaussian(1), y - 1.3 + SpellHelper.gaussian(0.3), z + SpellHelper.gaussian(1), 0x74, 0xbb, 0xfb);
|
||||
|
||||
if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionHeavyHeart))
|
||||
{
|
||||
entityLiving.worldObj.spawnParticle("flame", x + SpellHelper.gaussian(1), y - 1.3 + SpellHelper.gaussian(0.3), z + SpellHelper.gaussian(1), 0, 0.06d, 0);
|
||||
int r = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionIceCloak).getAmplifier();
|
||||
int horizRange = r + 1;
|
||||
int vertRange = 1;
|
||||
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionHeavyHeart).getAmplifier();
|
||||
double decrease = 0.025 * (i + 1);
|
||||
if (!entityLiving.worldObj.isRemote)
|
||||
{
|
||||
for (int i = -horizRange; i <= horizRange; i++)
|
||||
{
|
||||
for (int k = -horizRange; k <= horizRange; k++)
|
||||
{
|
||||
for (int j = -vertRange - 1; j <= vertRange - 1; j++)
|
||||
{
|
||||
SpellHelper.freezeWaterBlock(entityLiving.worldObj, xPos + i, yPos + j, zPos + k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (entityLiving.motionY > -0.9)
|
||||
{
|
||||
entityLiving.motionY -= decrease;
|
||||
}
|
||||
|
||||
if(entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
SpellHelper.setPlayerSpeedFromServer((EntityPlayer)entityLiving, entityLiving.motionX, entityLiving.motionY - decrease, entityLiving.motionZ);
|
||||
}
|
||||
}
|
||||
if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionHeavyHeart))
|
||||
{
|
||||
entityLiving.worldObj.spawnParticle("flame", x + SpellHelper.gaussian(1), y - 1.3 + SpellHelper.gaussian(0.3), z + SpellHelper.gaussian(1), 0, 0.06d, 0);
|
||||
|
||||
if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionFireFuse))
|
||||
{
|
||||
entityLiving.worldObj.spawnParticle("flame", x + SpellHelper.gaussian(1), y - 1.3 + SpellHelper.gaussian(0.3), z + SpellHelper.gaussian(1), 0, 0.06d, 0);
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionHeavyHeart).getAmplifier();
|
||||
double decrease = 0.025 * (i + 1);
|
||||
|
||||
int r = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFireFuse).getAmplifier();
|
||||
int radius = r + 1;
|
||||
if (entityLiving.motionY > -0.9)
|
||||
{
|
||||
entityLiving.motionY -= decrease;
|
||||
}
|
||||
|
||||
if (entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFireFuse).getDuration() <= 2)
|
||||
{
|
||||
entityLiving.worldObj.createExplosion(null, x, y, z, radius, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "Botania")
|
||||
private boolean isManaBurst(Entity projectile)
|
||||
{
|
||||
return projectile instanceof IManaBurst;
|
||||
}
|
||||
if(entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
SpellHelper.setPlayerSpeedFromServer((EntityPlayer)entityLiving, entityLiving.motionX, entityLiving.motionY - decrease, entityLiving.motionZ);
|
||||
}
|
||||
}
|
||||
|
||||
if (entityLiving.isPotionActive(AlchemicalWizardry.customPotionFireFuse))
|
||||
{
|
||||
entityLiving.worldObj.spawnParticle("flame", x + SpellHelper.gaussian(1), y - 1.3 + SpellHelper.gaussian(0.3), z + SpellHelper.gaussian(1), 0, 0.06d, 0);
|
||||
|
||||
int r = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFireFuse).getAmplifier();
|
||||
int radius = r + 1;
|
||||
|
||||
if (entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFireFuse).getDuration() <= 2)
|
||||
{
|
||||
entityLiving.worldObj.createExplosion(null, x, y, z, radius, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
|
||||
if (event.modID.equals("AWWayofTime")) {
|
||||
BloodMagicConfiguration.syncConfig();
|
||||
AlchemicalWizardry.logger.info("Refreshing configuration file.");
|
||||
BloodMagicConfiguration.syncConfig();
|
||||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "Botania")
|
||||
private boolean isManaBurst(Entity projectile)
|
||||
{
|
||||
return projectile instanceof IManaBurst;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.demonVillage;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -64,8 +65,6 @@ public class GridSpaceHolder
|
|||
{
|
||||
GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 1][negZRadius + posZRadius + 2];
|
||||
|
||||
System.out.println("x " + newGrid.length + "z " + newGrid[0].length);
|
||||
|
||||
for (int i = 0; i <= negXRadius + posXRadius; i++)
|
||||
{
|
||||
newGrid[i][0] = new GridSpace();
|
||||
|
@ -147,7 +146,7 @@ public class GridSpaceHolder
|
|||
{
|
||||
if (master != null)
|
||||
{
|
||||
System.out.println("negXRadius: " + negXRadius + " posXRadius: " + posXRadius + " negZRadius: " + negZRadius + " posZRadius: " + posZRadius);
|
||||
AlchemicalWizardry.logger.info("negXRadius: " + negXRadius + " posXRadius: " + posXRadius + " negZRadius: " + negZRadius + " posZRadius: " + posZRadius);
|
||||
for (int i = -negXRadius; i <= posXRadius; i++)
|
||||
{
|
||||
for (int j = -negZRadius; j <= posZRadius; j++)
|
||||
|
@ -158,7 +157,7 @@ public class GridSpaceHolder
|
|||
continue;
|
||||
}
|
||||
|
||||
System.out.println("x: " + i + " z: " + j);
|
||||
AlchemicalWizardry.logger.info("x: " + i + " z: " + j);
|
||||
|
||||
int xOff = 0;
|
||||
int zOff = 0;
|
||||
|
@ -195,7 +194,7 @@ public class GridSpaceHolder
|
|||
|
||||
public void setAllGridSpaces(int xInit, int zInit, int yLevel, ForgeDirection dir, int type, GridSpaceHolder master)
|
||||
{
|
||||
System.out.println("Grid space selected: (" + xInit + "," + zInit + ")");
|
||||
AlchemicalWizardry.logger.info("Grid space selected: (" + xInit + "," + zInit + ")");
|
||||
if (master != null)
|
||||
{
|
||||
for (int i = -negXRadius; i <= posXRadius; i++)
|
||||
|
@ -231,7 +230,7 @@ public class GridSpaceHolder
|
|||
break;
|
||||
}
|
||||
|
||||
System.out.println("Grid space (" + (xInit + xOff) + "," + (zInit + zOff) + ")");
|
||||
AlchemicalWizardry.logger.info("Grid space (" + (xInit + xOff) + "," + (zInit + zOff) + ")");
|
||||
|
||||
master.setGridSpace(xInit + xOff, zInit + zOff, new GridSpace(type, yLevel));
|
||||
}
|
||||
|
|
|
@ -1,19 +1,14 @@
|
|||
package WayofTime.alchemicalWizardry.common.demonVillage.tileEntity;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.*;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.DemonPacketRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.DemonType;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -24,20 +19,13 @@ import net.minecraft.nbt.NBTTagList;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.BuildingSchematic;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.DemonBuilding;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.DemonCrosspath;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.DemonVillagePath;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.GridSpace;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.GridSpaceHolder;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.DemonPacketRegistry;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.DemonType;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class TEDemonPortal extends TileEntity
|
||||
{
|
||||
|
@ -240,11 +228,11 @@ public class TEDemonPortal extends TileEntity
|
|||
this.incrementPoints();
|
||||
this.assignPoints();
|
||||
|
||||
System.out.println("Roads: " + roadCooldown + " Buildings: " + houseCooldown);
|
||||
AlchemicalWizardry.logger.info("Roads: " + roadCooldown + " Buildings: " + houseCooldown);
|
||||
|
||||
if(buildingStage >= 0 && buildingStage <=2)
|
||||
{
|
||||
System.out.println("BuildingStage = " + buildingStage);
|
||||
AlchemicalWizardry.logger.info("BuildingStage = " + buildingStage);
|
||||
this.createPortalBuilding(buildingStage, nextDemonPortalName, tier);
|
||||
buildingStage++;
|
||||
return;
|
||||
|
@ -463,7 +451,7 @@ public class TEDemonPortal extends TileEntity
|
|||
int z = road.zCoord;
|
||||
|
||||
if(printDebug)
|
||||
System.out.println("X: " + x + " Z: " + z + " Direction: " + dir.toString());
|
||||
AlchemicalWizardry.logger.info("X: " + x + " Z: " + z + " Direction: " + dir.toString());
|
||||
|
||||
List<ForgeDirection> directions = this.findValidExtentionDirection(x, z);
|
||||
|
||||
|
@ -495,9 +483,9 @@ public class TEDemonPortal extends TileEntity
|
|||
return 0;
|
||||
}
|
||||
if(printDebug)
|
||||
System.out.println("I got here!");
|
||||
AlchemicalWizardry.logger.info("I got here!");
|
||||
if(printDebug)
|
||||
System.out.println("Distance: " + distance + " Direction: " + dominantDirection.toString() + " yLevel: " + yLevel);
|
||||
AlchemicalWizardry.logger.info("Distance: " + distance + " Direction: " + dominantDirection.toString() + " yLevel: " + yLevel);
|
||||
|
||||
this.createGriddedRoad(x, yLevel, z, dominantDirection, distance + 1, true);
|
||||
|
||||
|
@ -859,7 +847,7 @@ public class TEDemonPortal extends TileEntity
|
|||
{
|
||||
initY = next.yCoord;
|
||||
if(printDebug)
|
||||
System.out.println("" + initY);
|
||||
AlchemicalWizardry.logger.info("" + initY);
|
||||
}
|
||||
|
||||
initGridX += dir.offsetX;
|
||||
|
@ -918,7 +906,7 @@ public class TEDemonPortal extends TileEntity
|
|||
GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 1][negZRadius + posZRadius + 2];
|
||||
|
||||
if(printDebug)
|
||||
System.out.println("x " + newGrid.length + "z " + newGrid[0].length);
|
||||
AlchemicalWizardry.logger.info("x " + newGrid.length + "z " + newGrid[0].length);
|
||||
|
||||
for (int i = 0; i <= negXRadius + posXRadius; i++)
|
||||
{
|
||||
|
@ -1033,7 +1021,7 @@ public class TEDemonPortal extends TileEntity
|
|||
|
||||
public int createPortalBuilding(int buildingTier) //TODO Telepose block next time, then build the new building.
|
||||
{
|
||||
System.out.println("Hello, I am here!");
|
||||
AlchemicalWizardry.logger.info("Hello, I am here!");
|
||||
int x = 0;
|
||||
int z = 0;
|
||||
|
||||
|
@ -1189,7 +1177,7 @@ public class TEDemonPortal extends TileEntity
|
|||
int yLevel = space.yCoord;
|
||||
|
||||
if(printDebug)
|
||||
System.out.println("Road space - x: " + x + " z: " + z);
|
||||
AlchemicalWizardry.logger.info("Road space - x: " + x + " z: " + z);
|
||||
|
||||
GridSpaceHolder grid = this.createGSH();
|
||||
|
||||
|
@ -1240,7 +1228,7 @@ public class TEDemonPortal extends TileEntity
|
|||
}
|
||||
} else
|
||||
{
|
||||
System.out.println("This ISN'T valid!");
|
||||
AlchemicalWizardry.logger.info("This ISN'T valid!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -356,7 +356,7 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem
|
|||
}
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
System.out.println("x: " + (i - range) + " y: " + (j - range) + " z: " + (k - range));
|
||||
AlchemicalWizardry.logger.info("x: " + (i - range) + " y: " + (j - range) + " z: " + (k - range));
|
||||
|
||||
|
||||
if (fluid == null || world.getBlockMetadata(x + i - range, y + j - range, z + k - range) != 0)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -37,7 +38,7 @@ public class DigAreaTunnel extends DigAreaEffect
|
|||
ForgeDirection sidehit = ForgeDirection.getOrientation(blockPos.sideHit);
|
||||
ForgeDirection opposite = sidehit.getOpposite();
|
||||
|
||||
System.out.println(opposite.toString());
|
||||
AlchemicalWizardry.logger.info(opposite.toString());
|
||||
|
||||
double initialLength = this.getRandomVectorLength();
|
||||
|
||||
|
@ -149,7 +150,7 @@ public class DigAreaTunnel extends DigAreaEffect
|
|||
public void travelVector(Vec3 vector, World world, double x, double y, double z)
|
||||
{
|
||||
double vecLength = vector.lengthVector();
|
||||
System.out.println(vecLength);
|
||||
AlchemicalWizardry.logger.info(vecLength);
|
||||
Vec3 normVec = Vec3.createVectorHelper(vector.xCoord, vector.yCoord, vector.zCoord);
|
||||
normVec = normVec.normalize();
|
||||
|
||||
|
@ -158,7 +159,7 @@ public class DigAreaTunnel extends DigAreaEffect
|
|||
|
||||
while (distanceTravelled < vecLength)
|
||||
{
|
||||
System.out.println(distanceTravelled);
|
||||
AlchemicalWizardry.logger.info(distanceTravelled);
|
||||
double stepLength = this.getRandomStepLength();
|
||||
|
||||
prevVec = prevVec.addVector(stepLength * normVec.xCoord, stepLength * normVec.yCoord, normVec.zCoord);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.tileEntity;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.BuildingSchematic;
|
||||
import com.google.gson.Gson;
|
||||
|
@ -45,13 +46,13 @@ public class TESchematicSaver extends TileEntity
|
|||
}
|
||||
}
|
||||
|
||||
System.out.println("" + i);
|
||||
AlchemicalWizardry.logger.info("" + i);
|
||||
}
|
||||
|
||||
System.out.println("I got here!");
|
||||
AlchemicalWizardry.logger.info("I got here!");
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String json = gson.toJson(schematic);
|
||||
System.out.println("Here, too!");
|
||||
AlchemicalWizardry.logger.info("Here, too!");
|
||||
Writer writer;
|
||||
try
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue