Anti-comments sweep!
This commit is contained in:
parent
e6a10f3f06
commit
dea1f87078
454 changed files with 23594 additions and 26739 deletions
|
@ -1,11 +1,13 @@
|
|||
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.common.entity.projectile.EnergyBlastProjectile;
|
||||
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.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
|
@ -26,138 +28,132 @@ import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
|||
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 WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
|
||||
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.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class AlchemicalWizardryEventHooks
|
||||
{
|
||||
public static Map<String,Boolean> playerFlightBuff = new HashMap();
|
||||
public static Map<String,Boolean> playerBoostStepHeight = new HashMap();
|
||||
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();
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerDamageEvent(LivingAttackEvent event)
|
||||
{
|
||||
if(event.source.isProjectile())
|
||||
{
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionProjProt) && event.isCancelable())
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
String respawnRitual = "AW028SpawnWard";
|
||||
|
||||
Integer dimension = new Integer(event.world.provider.dimensionId);
|
||||
if(respawnMap.containsKey(dimension))
|
||||
{
|
||||
List<CoordAndRange> list = respawnMap.get(dimension);
|
||||
|
||||
if(list != null)
|
||||
{
|
||||
for(CoordAndRange coords : list)
|
||||
{
|
||||
TileEntity tile = event.world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
|
||||
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(event.entityLiving instanceof EntityCreeper)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
String forceSpawnRitual = "AW029VeilOfEvil";
|
||||
|
||||
if(forceSpawnMap.containsKey(dimension))
|
||||
{
|
||||
List<CoordAndRange> list = forceSpawnMap.get(dimension);
|
||||
|
||||
if(list != null)
|
||||
{
|
||||
for(CoordAndRange coords : list)
|
||||
{
|
||||
TileEntity tile = event.world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
|
||||
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 instanceof EntityMob))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
String respawnRitual = "AW028SpawnWard";
|
||||
|
||||
Integer dimension = new Integer(event.world.provider.dimensionId);
|
||||
if (respawnMap.containsKey(dimension))
|
||||
{
|
||||
List<CoordAndRange> list = respawnMap.get(dimension);
|
||||
|
||||
if (list != null)
|
||||
{
|
||||
for (CoordAndRange coords : list)
|
||||
{
|
||||
TileEntity tile = event.world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
|
||||
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 (event.entityLiving instanceof EntityCreeper)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
String forceSpawnRitual = "AW029VeilOfEvil";
|
||||
|
||||
if (forceSpawnMap.containsKey(dimension))
|
||||
{
|
||||
List<CoordAndRange> list = forceSpawnMap.get(dimension);
|
||||
|
||||
if (list != null)
|
||||
{
|
||||
for (CoordAndRange coords : list)
|
||||
{
|
||||
TileEntity tile = event.world.getTileEntity(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerRespawnEvent(PlayerRespawnEvent event)
|
||||
{
|
||||
if(AlchemicalWizardry.respawnWithDebuff)
|
||||
{
|
||||
event.player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionSoulFray.id, 20*60*5,0));
|
||||
}
|
||||
if (AlchemicalWizardry.respawnWithDebuff)
|
||||
{
|
||||
event.player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionSoulFray.id, 20 * 60 * 5, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingJumpEvent(LivingJumpEvent event)
|
||||
{
|
||||
|
@ -165,21 +161,21 @@ public class AlchemicalWizardryEventHooks
|
|||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionBoost).getAmplifier();
|
||||
event.entityLiving.motionY += (0.1f) * (2 + i);
|
||||
}
|
||||
|
||||
if(event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionHeavyHeart))
|
||||
}
|
||||
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionHeavyHeart))
|
||||
{
|
||||
event.entityLiving.motionY = 0;
|
||||
event.entityLiving.motionY = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEndermanTeleportEvent(EnderTeleportEvent event)
|
||||
{
|
||||
if(event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionPlanarBinding) && event.isCancelable())
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionPlanarBinding) && event.isCancelable())
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
@ -198,18 +194,18 @@ public class AlchemicalWizardryEventHooks
|
|||
((EntityLivingBase) entityAttacking).attackEntityFrom(DamageSource.generic, damageRecieve);
|
||||
}
|
||||
}
|
||||
|
||||
if(entityAttacked.isPotionActive(AlchemicalWizardry.customPotionFlameCloak))
|
||||
|
||||
if (entityAttacked.isPotionActive(AlchemicalWizardry.customPotionFlameCloak))
|
||||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFlameCloak).getAmplifier();
|
||||
|
||||
Entity entityAttacking = event.source.getSourceOfDamage();
|
||||
|
||||
if(entityAttacking != null && entityAttacking instanceof EntityLivingBase && !entityAttacking.isImmuneToFire() && !((EntityLivingBase)entityAttacking).isPotionActive(Potion.fireResistance))
|
||||
{
|
||||
entityAttacking.attackEntityFrom(DamageSource.inFire, 2*i+2);
|
||||
entityAttacking.setFire(3);
|
||||
}
|
||||
Entity entityAttacking = event.source.getSourceOfDamage();
|
||||
|
||||
if (entityAttacking != null && entityAttacking instanceof EntityLivingBase && !entityAttacking.isImmuneToFire() && !((EntityLivingBase) entityAttacking).isPotionActive(Potion.fireResistance))
|
||||
{
|
||||
entityAttacking.attackEntityFrom(DamageSource.inFire, 2 * i + 2);
|
||||
entityAttacking.setFire(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -227,7 +223,7 @@ public class AlchemicalWizardryEventHooks
|
|||
// ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, event.player.capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"});
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityUpdate(LivingUpdateEvent event)
|
||||
{
|
||||
|
@ -235,17 +231,17 @@ public class AlchemicalWizardryEventHooks
|
|||
double x = entityLiving.posX;
|
||||
double y = entityLiving.posY;
|
||||
double z = entityLiving.posZ;
|
||||
|
||||
Vec3 blockVector = SpellHelper.getEntityBlockVector(entityLiving);
|
||||
int xPos = (int)(blockVector.xCoord);
|
||||
int yPos = (int)(blockVector.yCoord);
|
||||
int zPos = (int)(blockVector.zCoord);
|
||||
|
||||
if(entityLiving instanceof EntityPlayer)
|
||||
Vec3 blockVector = SpellHelper.getEntityBlockVector(entityLiving);
|
||||
int xPos = (int) (blockVector.xCoord);
|
||||
int yPos = (int) (blockVector.yCoord);
|
||||
int zPos = (int) (blockVector.zCoord);
|
||||
|
||||
if (entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, ((EntityPlayer)event.entityLiving).capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"});
|
||||
ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, ((EntityPlayer) event.entityLiving).capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"});
|
||||
}
|
||||
|
||||
|
||||
if (entityLiving instanceof EntityPlayer && entityLiving.worldObj.isRemote)
|
||||
{
|
||||
EntityPlayer entityPlayer = (EntityPlayer) entityLiving;
|
||||
|
@ -266,9 +262,9 @@ public class AlchemicalWizardryEventHooks
|
|||
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionFeatherFall))
|
||||
{
|
||||
event.entityLiving.fallDistance = 0;
|
||||
event.entityLiving.fallDistance = 0;
|
||||
}
|
||||
|
||||
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionDrowning))
|
||||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionDrowning).getAmplifier();
|
||||
|
@ -293,8 +289,8 @@ public class AlchemicalWizardryEventHooks
|
|||
EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving;
|
||||
entityPlayer.stepHeight = 1.0f;
|
||||
|
||||
if((entityPlayer.onGround || entityPlayer.capabilities.isFlying) && entityPlayer.moveForward > 0F)
|
||||
entityPlayer.moveFlying(0F, 1F, entityPlayer.capabilities.isFlying ? (percentIncrease/2.0f) : percentIncrease);
|
||||
if ((entityPlayer.onGround || entityPlayer.capabilities.isFlying) && entityPlayer.moveForward > 0F)
|
||||
entityPlayer.moveFlying(0F, 1F, entityPlayer.capabilities.isFlying ? (percentIncrease / 2.0f) : percentIncrease);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -306,7 +302,7 @@ public class AlchemicalWizardryEventHooks
|
|||
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);
|
||||
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();
|
||||
|
@ -325,7 +321,7 @@ public class AlchemicalWizardryEventHooks
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Entity throwingEntity = null;
|
||||
|
||||
if (projectile instanceof EntityArrow)
|
||||
|
@ -334,29 +330,29 @@ public class AlchemicalWizardryEventHooks
|
|||
} else if (projectile instanceof EnergyBlastProjectile)
|
||||
{
|
||||
throwingEntity = ((EnergyBlastProjectile) projectile).shootingEntity;
|
||||
}else if(projectile instanceof EntityThrowable)
|
||||
} else if (projectile instanceof EntityThrowable)
|
||||
{
|
||||
throwingEntity = ((EntityThrowable) projectile).getThrower();
|
||||
throwingEntity = ((EntityThrowable) projectile).getThrower();
|
||||
}
|
||||
|
||||
if(throwingEntity != null && throwingEntity.equals(entity))
|
||||
|
||||
if (throwingEntity != null && throwingEntity.equals(entity))
|
||||
{
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
|
||||
double delX = projectile.posX - entity.posX;
|
||||
double delY = projectile.posY - entity.posY;
|
||||
double delZ = projectile.posZ - entity.posZ;
|
||||
|
||||
if(throwingEntity != null)
|
||||
|
||||
if (throwingEntity != null)
|
||||
{
|
||||
delX = -projectile.posX + throwingEntity.posX;
|
||||
delX = -projectile.posX + throwingEntity.posX;
|
||||
delY = -projectile.posY + (throwingEntity.posY + throwingEntity.getEyeHeight());
|
||||
delZ = -projectile.posZ + throwingEntity.posZ;
|
||||
}
|
||||
|
||||
|
||||
double curVel = Math.sqrt(delX * delX + delY * delY + delZ * delZ);
|
||||
|
||||
|
||||
delX /= curVel;
|
||||
delY /= curVel;
|
||||
delZ /= curVel;
|
||||
|
@ -376,7 +372,6 @@ public class AlchemicalWizardryEventHooks
|
|||
String ownerName = SpellHelper.getUsername(entityPlayer);
|
||||
playerFlightBuff.put(ownerName, true);
|
||||
entityPlayer.capabilities.allowFlying = true;
|
||||
//entityPlayer.sendPlayerAbilities();
|
||||
}
|
||||
} else
|
||||
{
|
||||
|
@ -403,75 +398,75 @@ public class AlchemicalWizardryEventHooks
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(entityLiving.isPotionActive(AlchemicalWizardry.customPotionFlameCloak))
|
||||
|
||||
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);
|
||||
|
||||
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.customPotionFlameCloak).getAmplifier();
|
||||
double range = i*0.5;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
double range = i * 0.5;
|
||||
|
||||
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.customPotionIceCloak))
|
||||
|
||||
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.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 r = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionIceCloak).getAmplifier();
|
||||
int horizRange = r+1;
|
||||
int vertRange = 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.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 i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionHeavyHeart).getAmplifier();
|
||||
double decrease = 0.025*(i+1);
|
||||
|
||||
if(entityLiving.motionY>-0.9)
|
||||
{
|
||||
entityLiving.motionY-=decrease;
|
||||
}
|
||||
int horizRange = r + 1;
|
||||
int vertRange = 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.isPotionActive(AlchemicalWizardry.customPotionFireFuse))
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
if (entityLiving.motionY > -0.9)
|
||||
{
|
||||
entityLiving.motionY -= decrease;
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
int radius = r + 1;
|
||||
|
||||
if (entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFireFuse).getDuration() <= 2)
|
||||
{
|
||||
entityLiving.worldObj.createExplosion(null, x, y, z, radius, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.LavaCrystal;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.common.IFuelHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -7,10 +11,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.LavaCrystal;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.common.IFuelHandler;
|
||||
|
||||
public class AlchemicalWizardryFuelHandler implements IFuelHandler
|
||||
{
|
||||
|
@ -18,19 +18,15 @@ public class AlchemicalWizardryFuelHandler implements IFuelHandler
|
|||
public int getBurnTime(ItemStack fuel)
|
||||
{
|
||||
ItemStack itemStack = fuel;
|
||||
if(itemStack == null)
|
||||
if (itemStack == null)
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Item fuelItem = itemStack.getItem();
|
||||
|
||||
if (fuelItem.equals(ModItems.lavaCrystal))
|
||||
{
|
||||
/*ItemStack newItem = new ItemStack(AlchemicalWizardry.lavaCrystal);
|
||||
newItem.getItem().setDamage(newItem, 50);
|
||||
fuel.getItem().setContainerItem(((LavaCrystal)newItem.getItem()).change());
|
||||
*/
|
||||
LavaCrystal item = (LavaCrystal) fuel.getItem();
|
||||
|
||||
if (item.hasEnoughEssence(fuel))
|
||||
|
@ -66,7 +62,7 @@ public class AlchemicalWizardryFuelHandler implements IFuelHandler
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.PlayerCapabilities;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
|
||||
@Deprecated
|
||||
public class AlchemicalWizardryTickHandler //implements ITickHandler
|
||||
{
|
||||
// public void tickStart(EnumSet<TickType> type, Object... tickData)
|
||||
// {
|
||||
// }
|
||||
//
|
||||
// public EnumSet<TickType> ticks()
|
||||
// {
|
||||
// return EnumSet.of(TickType.PLAYER);
|
||||
// }
|
||||
//
|
||||
// public String getLabel()
|
||||
// {
|
||||
// return "BloodMagic";
|
||||
// }
|
||||
//
|
||||
// public void tickEnd(EnumSet<TickType> type, Object... tickData)
|
||||
// {
|
||||
// String[] usernames = MinecraftServer.getServer().getAllUsernames();
|
||||
//
|
||||
// if (usernames == null)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// for (String userName : usernames)
|
||||
// {
|
||||
// EntityPlayer entityPlayer = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(userName);
|
||||
//
|
||||
// if (entityPlayer != null)
|
||||
// {
|
||||
// ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, entityPlayer.capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"});
|
||||
// //entityPlayer.sendPlayerAbilities();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
|
@ -1,27 +1,13 @@
|
|||
package WayofTime.alchemicalWizardry.common;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityBloodLightProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaSecondaryProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityMeteor;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.ExplosionProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.LightningBoltProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.TeleportProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.WaterProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.WindGustProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.*;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class CommonProxy
|
||||
{
|
||||
|
@ -49,7 +35,6 @@ public class CommonProxy
|
|||
|
||||
public void registerEvents()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void registerSoundHandler()
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
package WayofTime.alchemicalWizardry.common;
|
||||
|
||||
public class CoordAndRange
|
||||
public class CoordAndRange
|
||||
{
|
||||
public int xCoord;
|
||||
public int yCoord;
|
||||
public int zCoord;
|
||||
public int horizRadius;
|
||||
public int vertRadius;
|
||||
|
||||
public CoordAndRange(int x, int y, int z, int horiz, int vert)
|
||||
{
|
||||
this.xCoord = x;
|
||||
this.yCoord = y;
|
||||
this.zCoord = z;
|
||||
this.horizRadius = horiz;
|
||||
this.vertRadius = vert;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
return o instanceof CoordAndRange ? ((CoordAndRange)o).xCoord == this.xCoord && ((CoordAndRange)o).yCoord == this.yCoord && ((CoordAndRange)o).zCoord == this.zCoord && ((CoordAndRange)o).horizRadius == this.horizRadius && ((CoordAndRange)o).vertRadius == this.vertRadius: false;
|
||||
}
|
||||
public int xCoord;
|
||||
public int yCoord;
|
||||
public int zCoord;
|
||||
public int horizRadius;
|
||||
public int vertRadius;
|
||||
|
||||
public CoordAndRange(int x, int y, int z, int horiz, int vert)
|
||||
{
|
||||
this.xCoord = x;
|
||||
this.yCoord = y;
|
||||
this.zCoord = z;
|
||||
this.horizRadius = horiz;
|
||||
this.vertRadius = vert;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
return o instanceof CoordAndRange ? ((CoordAndRange) o).xCoord == this.xCoord && ((CoordAndRange) o).yCoord == this.yCoord && ((CoordAndRange) o).zCoord == this.zCoord && ((CoordAndRange) o).horizRadius == this.horizRadius && ((CoordAndRange) o).vertRadius == this.vertRadius : false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common;
|
||||
|
||||
public class EntityAIFly
|
||||
{
|
||||
}
|
|
@ -1,15 +1,14 @@
|
|||
package WayofTime.alchemicalWizardry.common;
|
||||
|
||||
import ibxm.Player;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityElemental;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityElemental;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class EntityAirElemental extends EntityElemental implements IMob
|
||||
{
|
||||
|
@ -22,7 +21,7 @@ public class EntityAirElemental extends EntityElemental implements IMob
|
|||
{
|
||||
if (target instanceof EntityPlayer)
|
||||
{
|
||||
SpellHelper.setPlayerSpeedFromServer((EntityPlayer)target, target.motionX, target.motionY + 3, target.motionZ);
|
||||
SpellHelper.setPlayerSpeedFromServer((EntityPlayer) target, target.motionX, target.motionY + 3, target.motionZ);
|
||||
((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 150, 0));
|
||||
} else if (target instanceof EntityLivingBase)
|
||||
{
|
||||
|
|
|
@ -3,36 +3,36 @@ package WayofTime.alchemicalWizardry.common;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
|
||||
public class Int3
|
||||
public class Int3
|
||||
{
|
||||
public int xCoord;
|
||||
public int yCoord;
|
||||
public int zCoord;
|
||||
|
||||
public Int3(int xCoord, int yCoord, int zCoord)
|
||||
{
|
||||
this.xCoord = xCoord;
|
||||
this.yCoord = yCoord;
|
||||
this.zCoord = zCoord;
|
||||
}
|
||||
|
||||
public static Int3 readFromNBT(NBTTagCompound tag)
|
||||
{
|
||||
return new Int3(tag.getInteger("xCoord"), tag.getInteger("yCoord"), tag.getInteger("zCoord"));
|
||||
}
|
||||
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tag)
|
||||
{
|
||||
tag.setInteger("xCoord", xCoord);
|
||||
tag.setInteger("yCoord", yCoord);
|
||||
tag.setInteger("zCoord", zCoord);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
return o instanceof Int3 ? ((Int3)o).xCoord == this.xCoord && ((Int3)o).yCoord == this.yCoord && ((Int3)o).zCoord == this.zCoord : false;
|
||||
}
|
||||
public int xCoord;
|
||||
public int yCoord;
|
||||
public int zCoord;
|
||||
|
||||
public Int3(int xCoord, int yCoord, int zCoord)
|
||||
{
|
||||
this.xCoord = xCoord;
|
||||
this.yCoord = yCoord;
|
||||
this.zCoord = zCoord;
|
||||
}
|
||||
|
||||
public static Int3 readFromNBT(NBTTagCompound tag)
|
||||
{
|
||||
return new Int3(tag.getInteger("xCoord"), tag.getInteger("yCoord"), tag.getInteger("zCoord"));
|
||||
}
|
||||
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tag)
|
||||
{
|
||||
tag.setInteger("xCoord", xCoord);
|
||||
tag.setInteger("yCoord", yCoord);
|
||||
tag.setInteger("zCoord", zCoord);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
return o instanceof Int3 ? ((Int3) o).xCoord == this.xCoord && ((Int3) o).yCoord == this.yCoord && ((Int3) o).zCoord == this.zCoord : false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package WayofTime.alchemicalWizardry.common;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class LifeBucketHandler
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ public class LifeBucketHandler
|
|||
{
|
||||
Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
|
||||
|
||||
if (block!=null && (block.equals(ModBlocks.blockLifeEssence)) && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0)
|
||||
if (block != null && (block.equals(ModBlocks.blockLifeEssence)) && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0)
|
||||
{
|
||||
world.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ);
|
||||
return new ItemStack(ModItems.bucketLife);
|
||||
|
|
|
@ -7,11 +7,8 @@ public class LifeEssence extends Fluid
|
|||
public LifeEssence(String fluidName)
|
||||
{
|
||||
super(fluidName);
|
||||
//setUnlocalizedName("lifeEssence");
|
||||
//setBlockID(id);
|
||||
this.setDensity(2000);
|
||||
this.setViscosity(2000);
|
||||
//this.setFlowingIcon(flowingIcon)
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package WayofTime.alchemicalWizardry.common;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class ModLivingDropsEvent
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,966 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common;
|
||||
|
||||
import ibxm.Player;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.bloodAltarUpgrade.UpgradedAltars;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEOrientable;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteStreams;
|
||||
import com.jcraft.jogg.Packet;
|
||||
|
||||
public class PacketHandler //implements IPacketHandler
|
||||
{
|
||||
// @Override
|
||||
// public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player)
|
||||
// {
|
||||
// if (packet.channel.equals("BloodAltar"))
|
||||
// {
|
||||
// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data);
|
||||
// int x = dat.readInt();
|
||||
// int y = dat.readInt();
|
||||
// int z = dat.readInt();
|
||||
// boolean hasStacks = dat.readByte() != 0;
|
||||
// int[] items = new int[0];
|
||||
//
|
||||
// if (hasStacks)
|
||||
// {
|
||||
// items = new int[1 * 3];
|
||||
//
|
||||
// for (int i = 0; i < items.length; i++)
|
||||
// {
|
||||
// items[i] = dat.readInt();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// int fluidIDMain = dat.readInt();
|
||||
// int fluidAmountMain = dat.readInt();
|
||||
// int fluidIDOutput = dat.readInt();
|
||||
// int fluidAmountOutput = dat.readInt();
|
||||
// int fluidIDInput = dat.readInt();
|
||||
// int fluidAmountInput = dat.readInt();
|
||||
// int capacity = dat.readInt();
|
||||
// World world = AlchemicalWizardry.proxy.getClientWorld();
|
||||
// TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||
//
|
||||
// if (tileEntity instanceof TEAltar)
|
||||
// {
|
||||
// TEAltar tileEntityAltar = (TEAltar) tileEntity;
|
||||
// FluidStack flMain = new FluidStack(fluidIDMain, fluidAmountMain);
|
||||
// FluidStack flOutput = new FluidStack(fluidIDOutput, fluidAmountOutput);
|
||||
// FluidStack flInput = new FluidStack(fluidIDInput, fluidAmountInput);
|
||||
// tileEntityAltar.handlePacketData(items, flMain, flOutput, flInput, capacity);
|
||||
// }
|
||||
// } else if (packet.channel.equals("FallReset"))
|
||||
// {
|
||||
// if (player instanceof EntityPlayer)
|
||||
// {
|
||||
// ((EntityPlayer) player).fallDistance = 0;
|
||||
// }
|
||||
// } else if (packet.channel.equals("particle"))
|
||||
// {
|
||||
// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data);
|
||||
// DataInputStream din = new DataInputStream(bin);
|
||||
// Random rand = new Random();
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// double x = din.readDouble();
|
||||
// double y = din.readDouble();
|
||||
// double z = din.readDouble();
|
||||
// short particleType = din.readShort();
|
||||
// World world = ((EntityPlayer) player).worldObj;
|
||||
//
|
||||
// if (particleType == 1)
|
||||
// {
|
||||
// world.spawnParticle("mobSpell", x + 0.5D + rand.nextGaussian() / 8, y + 1.1D, z + 0.5D + rand.nextGaussian() / 8, 0.5117D, 0.0117D, 0.0117D);
|
||||
// }
|
||||
//
|
||||
// if (particleType == 2)
|
||||
// {
|
||||
// world.spawnParticle("reddust", x + 0.5D + rand.nextGaussian() / 8, y + 1.1D, z + 0.5D + rand.nextGaussian() / 8, 0.82D, 0.941D, 0.91D);
|
||||
// }
|
||||
//
|
||||
// if (particleType == 3)
|
||||
// {
|
||||
// world.spawnParticle("mobSpell", x + 0.5D + rand.nextGaussian() / 8, y + 1.1D, z + 0.5D + rand.nextGaussian() / 8, 1.0D, 0.371D, 0.371D);
|
||||
// }
|
||||
//
|
||||
// if (particleType == 4)
|
||||
// {
|
||||
// float f = (float) 1.0F;
|
||||
// float f1 = f * 0.6F + 0.4F;
|
||||
// float f2 = f * f * 0.7F - 0.5F;
|
||||
// float f3 = f * f * 0.6F - 0.7F;
|
||||
//
|
||||
// for (int l = 0; l < 8; ++l)
|
||||
// {
|
||||
// world.spawnParticle("reddust", x + Math.random() - Math.random(), y + Math.random() - Math.random(), z + Math.random() - Math.random(), f1, f2, f3);
|
||||
// }
|
||||
// }
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// } else if (packet.channel.equals("CustomParticle"))
|
||||
// {
|
||||
// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data);
|
||||
// DataInputStream din = new DataInputStream(bin);
|
||||
// Random rand = new Random();
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// World world = ((EntityPlayer) player).worldObj;
|
||||
// int size = din.readInt();
|
||||
// String str = "";
|
||||
//
|
||||
// for (int i = 0; i < size; i++)
|
||||
// {
|
||||
// str = str + din.readChar();
|
||||
// }
|
||||
//
|
||||
// double x = din.readDouble();
|
||||
// double y = din.readDouble();
|
||||
// double z = din.readDouble();
|
||||
// double xVel = din.readDouble();
|
||||
// double yVel = din.readDouble();
|
||||
// double zVel = din.readDouble();
|
||||
// world.spawnParticle(str, x, y, z, xVel, yVel, zVel);
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// } else if (packet.channel.equals("SetLifeEssence")) //Sets the data for the character
|
||||
// {
|
||||
// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data);
|
||||
// DataInputStream din = new DataInputStream(bin);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// EntityPlayer user = (EntityPlayer) player;
|
||||
// int length = din.readInt();
|
||||
// String ownerName = "";
|
||||
//
|
||||
// for (int i = 0; i < length; i++)
|
||||
// {
|
||||
// ownerName = ownerName + din.readChar();
|
||||
// }
|
||||
//
|
||||
// int addedEssence = din.readInt();
|
||||
// int maxEssence = din.readInt();
|
||||
// World world = MinecraftServer.getServer().worldServers[0];
|
||||
// LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
|
||||
//
|
||||
// if (data == null)
|
||||
// {
|
||||
// data = new LifeEssenceNetwork(ownerName);
|
||||
// world.setItemData(ownerName, data);
|
||||
// }
|
||||
//
|
||||
// if (addedEssence > 0)
|
||||
// {
|
||||
// if (data.currentEssence < maxEssence)
|
||||
// {
|
||||
// data.currentEssence = Math.min(maxEssence, data.currentEssence + addedEssence);
|
||||
// data.markDirty();
|
||||
// }
|
||||
//
|
||||
// if (!user.capabilities.isCreativeMode)
|
||||
// {
|
||||
// for (int i = 0; i < ((addedEssence + 99) / 100); i++)
|
||||
// {
|
||||
// //player.setEntityHealth((player.getHealth()-1));
|
||||
// user.setHealth((user.getHealth() - 1));
|
||||
//
|
||||
// if (user.getHealth() <= 0.5f)
|
||||
// {
|
||||
// //user.inventory.dropAllItems();
|
||||
// user.onDeath(DamageSource.generic);
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } else
|
||||
// {
|
||||
// int removedEssence = -addedEssence;
|
||||
//
|
||||
// if ((data.currentEssence - removedEssence) >= 0)
|
||||
// {
|
||||
// data.currentEssence -= removedEssence;
|
||||
// data.markDirty();
|
||||
// } else
|
||||
// {
|
||||
// if (removedEssence >= 100)
|
||||
// {
|
||||
// for (int i = 0; i < ((removedEssence + 99) / 100); i++)
|
||||
// {
|
||||
// //player.setEntityHealth((player.getHealth()-1));
|
||||
// user.setHealth((user.getHealth() - 1));
|
||||
//
|
||||
// if (user.getHealth() <= 0.5f)
|
||||
// {
|
||||
// //user.inventory.dropAllItems();
|
||||
// user.onDeath(DamageSource.generic);
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// } else
|
||||
// {
|
||||
// if (user.worldObj.rand.nextInt(100) <= removedEssence)
|
||||
// {
|
||||
// user.setHealth((user.getHealth() - 1));
|
||||
//
|
||||
// if (user.getHealth() <= 0.5f)
|
||||
// {
|
||||
// //user.inventory.dropAllItems();
|
||||
// user.onDeath(DamageSource.generic);
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// //PacketDispatcher.sendPacketToPlayer(PacketHandler.getPacket(ownerName), (Player)user);
|
||||
//// data.currentEssence = addedEssence;
|
||||
//// data.markDirty();
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// } else if (packet.channel.equals("InfiniteLPPath"))
|
||||
// {
|
||||
// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data);
|
||||
// DataInputStream din = new DataInputStream(bin);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// EntityPlayer user = (EntityPlayer) player;
|
||||
// int length = din.readInt();
|
||||
// String ownerName = "";
|
||||
//
|
||||
// for (int i = 0; i < length; i++)
|
||||
// {
|
||||
// ownerName = ownerName + din.readChar();
|
||||
// }
|
||||
//
|
||||
// boolean fill = din.readBoolean();
|
||||
// World world = MinecraftServer.getServer().worldServers[0];
|
||||
// LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
|
||||
//
|
||||
// if (data == null)
|
||||
// {
|
||||
// data = new LifeEssenceNetwork(ownerName);
|
||||
// world.setItemData(ownerName, data);
|
||||
// }
|
||||
//
|
||||
// if (fill)
|
||||
// {
|
||||
// data.currentEssence += 1000000;
|
||||
// data.markDirty();
|
||||
// } else
|
||||
// {
|
||||
// data.currentEssence = 0;
|
||||
// data.markDirty();
|
||||
// }
|
||||
//
|
||||
// //PacketDispatcher.sendPacketToPlayer(PacketHandler.getPacket(ownerName), (Player)user);
|
||||
//// data.currentEssence = addedEssence;
|
||||
//// data.markDirty();
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// } else if (packet.channel.equals("GetLifeEssence"))
|
||||
// {
|
||||
// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data);
|
||||
// DataInputStream din = new DataInputStream(bin);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// int length = din.readInt();
|
||||
// String ownerName = "";
|
||||
//
|
||||
// for (int i = 0; i < length; i++)
|
||||
// {
|
||||
// ownerName = ownerName + din.readChar();
|
||||
// }
|
||||
//
|
||||
// World world = MinecraftServer.getServer().worldServers[0];
|
||||
// LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName);
|
||||
//
|
||||
// if (data == null)
|
||||
// {
|
||||
// data = new LifeEssenceNetwork(ownerName);
|
||||
// world.setItemData(ownerName, data);
|
||||
// }
|
||||
//
|
||||
// if (player instanceof EntityPlayer)
|
||||
// {
|
||||
// EntityPlayer owner = (EntityPlayer) player;
|
||||
// ChatMessageComponent chatmessagecomponent = new ChatMessageComponent();
|
||||
// //chatmessagecomponent.func_111072_b("Current Essence: " + data.currentEssence + "LP");
|
||||
// chatmessagecomponent.addText("Current Essence: " + data.currentEssence + "LP");
|
||||
// owner.sendChatToPlayer(chatmessagecomponent);
|
||||
// }
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// } else if (packet.channel.equals("GetAltarEssence"))
|
||||
// {
|
||||
// ByteArrayInputStream bin = new ByteArrayInputStream(packet.data);
|
||||
// DataInputStream din = new DataInputStream(bin);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// int x = din.readInt();
|
||||
// int y = din.readInt();
|
||||
// int z = din.readInt();
|
||||
//
|
||||
// if (player instanceof EntityPlayer)
|
||||
// {
|
||||
// EntityPlayer owner = (EntityPlayer) player;
|
||||
// World world = owner.worldObj;
|
||||
// TEAltar tileEntity = (TEAltar) world.getBlockTileEntity(x, y, z);
|
||||
//
|
||||
// if (tileEntity != null)
|
||||
// {
|
||||
// int level = UpgradedAltars.isAltarValid(world, x, y, z);
|
||||
// ChatMessageComponent chatmessagecomponent = new ChatMessageComponent();
|
||||
// chatmessagecomponent.addText("Altar's Current Essence: " + tileEntity.getFluidAmount() + "LP" + "\n" + "Altar's Current Tier: " + level + "\nCapacity: " + tileEntity.getCapacity() + "LP");
|
||||
// //chatmessagecomponent.addText();
|
||||
// owner.sendChatToPlayer(chatmessagecomponent);
|
||||
// }
|
||||
// }
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// } else if (packet.channel.equals("TESocket"))
|
||||
// {
|
||||
// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data);
|
||||
// int x = dat.readInt();
|
||||
// int y = dat.readInt();
|
||||
// int z = dat.readInt();
|
||||
// boolean hasStacks = dat.readByte() != 0;
|
||||
// int[] items = new int[0];
|
||||
//
|
||||
// if (hasStacks)
|
||||
// {
|
||||
// items = new int[1 * 3];
|
||||
//
|
||||
// for (int i = 0; i < items.length; i++)
|
||||
// {
|
||||
// items[i] = dat.readInt();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// World world = AlchemicalWizardry.proxy.getClientWorld();
|
||||
// TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||
//
|
||||
// if (tileEntity instanceof TESocket)
|
||||
// {
|
||||
// TESocket tileEntityAltar = (TESocket) tileEntity;
|
||||
// tileEntityAltar.handlePacketData(items);
|
||||
// }
|
||||
// } else if (packet.channel.equals("TEWritingTable"))
|
||||
// {
|
||||
// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data);
|
||||
// int x = dat.readInt();
|
||||
// int y = dat.readInt();
|
||||
// int z = dat.readInt();
|
||||
// boolean hasStacks = dat.readByte() != 0;
|
||||
// int[] items = new int[0];
|
||||
//
|
||||
// if (hasStacks)
|
||||
// {
|
||||
// items = new int[7 * 3];
|
||||
//
|
||||
// for (int i = 0; i < items.length; i++)
|
||||
// {
|
||||
// items[i] = dat.readInt();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// World world = AlchemicalWizardry.proxy.getClientWorld();
|
||||
// TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||
//
|
||||
// if (tileEntity instanceof TEWritingTable)
|
||||
// {
|
||||
// TEWritingTable tileEntityAltar = (TEWritingTable) tileEntity;
|
||||
// tileEntityAltar.handlePacketData(items);
|
||||
// }
|
||||
// } else if (packet.channel.equals("TEOrientor"))
|
||||
// {
|
||||
// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data);
|
||||
// int x = dat.readInt();
|
||||
// int y = dat.readInt();
|
||||
// int z = dat.readInt();
|
||||
// World world = AlchemicalWizardry.proxy.getClientWorld();
|
||||
// TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||
//
|
||||
// if (tileEntity instanceof TEOrientable)
|
||||
// {
|
||||
// TEOrientable tileEntityOrientable = (TEOrientable) tileEntity;
|
||||
// tileEntityOrientable.setInputDirection(ForgeDirection.getOrientation(dat.readInt()));
|
||||
// tileEntityOrientable.setOutputDirection(ForgeDirection.getOrientation(dat.readInt()));
|
||||
// world.markBlockForRenderUpdate(x, y, z);
|
||||
// }
|
||||
// } else if (packet.channel.equals("TEPedestal"))
|
||||
// {
|
||||
// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data);
|
||||
// int x = dat.readInt();
|
||||
// int y = dat.readInt();
|
||||
// int z = dat.readInt();
|
||||
// boolean hasStacks = dat.readByte() != 0;
|
||||
// int[] items = new int[0];
|
||||
//
|
||||
// if (hasStacks)
|
||||
// {
|
||||
// items = new int[1 * 3];
|
||||
//
|
||||
// for (int i = 0; i < items.length; i++)
|
||||
// {
|
||||
// items[i] = dat.readInt();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// World world = AlchemicalWizardry.proxy.getClientWorld();
|
||||
// TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||
//
|
||||
// if (tileEntity instanceof TEPedestal)
|
||||
// {
|
||||
// TEPedestal tileEntityAltar = (TEPedestal) tileEntity;
|
||||
// tileEntityAltar.handlePacketData(items);
|
||||
// }
|
||||
// } else if (packet.channel.equals("TEPlinth"))
|
||||
// {
|
||||
// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data);
|
||||
// int x = dat.readInt();
|
||||
// int y = dat.readInt();
|
||||
// int z = dat.readInt();
|
||||
// boolean hasStacks = dat.readByte() != 0;
|
||||
// int[] items = new int[0];
|
||||
//
|
||||
// if (hasStacks)
|
||||
// {
|
||||
// items = new int[1 * 3];
|
||||
//
|
||||
// for (int i = 0; i < items.length; i++)
|
||||
// {
|
||||
// items[i] = dat.readInt();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// World world = AlchemicalWizardry.proxy.getClientWorld();
|
||||
// TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||
//
|
||||
// if (tileEntity instanceof TEPlinth)
|
||||
// {
|
||||
// TEPlinth tileEntityAltar = (TEPlinth) tileEntity;
|
||||
// tileEntityAltar.handlePacketData(items);
|
||||
// }
|
||||
// } else if (packet.channel.equals("TETeleposer"))
|
||||
// {
|
||||
// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data);
|
||||
// int x = dat.readInt();
|
||||
// int y = dat.readInt();
|
||||
// int z = dat.readInt();
|
||||
// boolean hasStacks = dat.readByte() != 0;
|
||||
// int[] items = new int[0];
|
||||
//
|
||||
// if (hasStacks)
|
||||
// {
|
||||
// items = new int[1 * 3];
|
||||
//
|
||||
// for (int i = 0; i < items.length; i++)
|
||||
// {
|
||||
// items[i] = dat.readInt();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// World world = AlchemicalWizardry.proxy.getClientWorld();
|
||||
// TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||
//
|
||||
// if (tileEntity instanceof TETeleposer)
|
||||
// {
|
||||
// TETeleposer tileEntityAltar = (TETeleposer) tileEntity;
|
||||
// tileEntityAltar.handlePacketData(items);
|
||||
// }
|
||||
// } else if (packet.channel.equals("SetPlayerVel"))
|
||||
// {
|
||||
// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data);
|
||||
// double xVel = dat.readDouble();
|
||||
// double yVel = dat.readDouble();
|
||||
// double zVel = dat.readDouble();
|
||||
// ((EntityPlayer) player).setVelocity(xVel, yVel, zVel);
|
||||
// } else if (packet.channel.equals("SetPlayerPos"))
|
||||
// {
|
||||
// ByteArrayDataInput dat = ByteStreams.newDataInput(packet.data);
|
||||
// double xVel = dat.readDouble();
|
||||
// double yVel = dat.readDouble();
|
||||
// double zVel = dat.readDouble();
|
||||
// ((EntityPlayer) player).setPosition(xVel, yVel, zVel);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public static Packet getPacket(TEAltar tileEntity)
|
||||
// {
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(140);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
// int[] items = tileEntity.buildIntDataList();
|
||||
// boolean hasStacks = (items != null);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// dos.writeInt(tileEntity.xCoord);
|
||||
// dos.writeInt(tileEntity.yCoord);
|
||||
// dos.writeInt(tileEntity.zCoord);
|
||||
// dos.writeByte(hasStacks ? 1 : 0);
|
||||
//
|
||||
// if (hasStacks)
|
||||
// {
|
||||
// for (int i = 0; i < 3; i++)
|
||||
// {
|
||||
// dos.writeInt(items[i]);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// FluidStack flMain = tileEntity.getFluid();
|
||||
//
|
||||
// if (flMain == null)
|
||||
// {
|
||||
// dos.writeInt(AlchemicalWizardry.lifeEssenceFluid.getBlockID());
|
||||
// dos.writeInt(0);
|
||||
// } else
|
||||
// {
|
||||
// dos.writeInt(flMain.fluidID);
|
||||
// dos.writeInt(flMain.amount);
|
||||
// }
|
||||
//
|
||||
// FluidStack flOut = tileEntity.getOutputFluid();
|
||||
//
|
||||
// if (flOut == null)
|
||||
// {
|
||||
// dos.writeInt(AlchemicalWizardry.lifeEssenceFluid.getBlockID());
|
||||
// dos.writeInt(0);
|
||||
// } else
|
||||
// {
|
||||
// dos.writeInt(flOut.fluidID);
|
||||
// dos.writeInt(flOut.amount);
|
||||
// }
|
||||
//
|
||||
// FluidStack flIn = tileEntity.getInputFluid();
|
||||
//
|
||||
// if (flIn == null)
|
||||
// {
|
||||
// dos.writeInt(AlchemicalWizardry.lifeEssenceFluid.getBlockID());
|
||||
// dos.writeInt(0);
|
||||
// } else
|
||||
// {
|
||||
// dos.writeInt(flIn.fluidID);
|
||||
// dos.writeInt(flIn.amount);
|
||||
// }
|
||||
//
|
||||
// dos.writeInt(tileEntity.capacity);
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = "BloodAltar";
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// pkt.isChunkDataPacket = true;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// public static Packet getPacket(TESocket tileEntity)
|
||||
// {
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(140);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
// int[] items = tileEntity.buildIntDataList();
|
||||
// boolean hasStacks = (items != null);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// dos.writeInt(tileEntity.xCoord);
|
||||
// dos.writeInt(tileEntity.yCoord);
|
||||
// dos.writeInt(tileEntity.zCoord);
|
||||
// dos.writeByte(hasStacks ? 1 : 0);
|
||||
//
|
||||
// if (hasStacks)
|
||||
// {
|
||||
// for (int i = 0; i < 3; i++)
|
||||
// {
|
||||
// dos.writeInt(items[i]);
|
||||
// }
|
||||
// }
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = "TESocket";
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// pkt.isChunkDataPacket = true;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// public static Packet getPacket(String ownerName, int addedEssence, int maxEssence)
|
||||
// //Packet to be sent to server to change essence
|
||||
// {
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(140);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// dos.writeInt(ownerName.length());
|
||||
// dos.writeChars(ownerName);
|
||||
// dos.writeInt(addedEssence);
|
||||
// dos.writeInt(maxEssence); //Used for Blood Orbs, but does nothing for other items
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = "SetLifeEssence";
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// //pkt.isChunkDataPacket = true;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// public static Packet getPacket(String ownerName) //stores the current essence in the player's NBT
|
||||
// {
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(140);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// dos.writeInt(ownerName.length());
|
||||
// dos.writeChars(ownerName);
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = "GetLifeEssence";
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// //pkt.isChunkDataPacket = true;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// public static Packet getAltarPacket(int x, int y, int z)
|
||||
// {
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(140);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// dos.writeInt(x);
|
||||
// dos.writeInt(y);
|
||||
// dos.writeInt(z);
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = "GetAltarEssence";
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// //pkt.isChunkDataPacket = true;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// public static Packet getPacket(TEWritingTable tileEntity)
|
||||
// {
|
||||
// // TODO Auto-generated method stub
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(140);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
// int[] items = tileEntity.buildIntDataList();
|
||||
// boolean hasStacks = (items != null);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// dos.writeInt(tileEntity.xCoord);
|
||||
// dos.writeInt(tileEntity.yCoord);
|
||||
// dos.writeInt(tileEntity.zCoord);
|
||||
// dos.writeByte(hasStacks ? 1 : 0);
|
||||
//
|
||||
// if (hasStacks)
|
||||
// {
|
||||
// for (int i = 0; i < 3 * 7; i++)
|
||||
// {
|
||||
// dos.writeInt(items[i]);
|
||||
// }
|
||||
// }
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = "TEWritingTable";
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// pkt.isChunkDataPacket = true;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// public static Packet getPacket(TEPedestal tileEntity)
|
||||
// {
|
||||
// // TODO Auto-generated method stub
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(140);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
// int[] items = tileEntity.buildIntDataList();
|
||||
// boolean hasStacks = (items != null);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// dos.writeInt(tileEntity.xCoord);
|
||||
// dos.writeInt(tileEntity.yCoord);
|
||||
// dos.writeInt(tileEntity.zCoord);
|
||||
// dos.writeByte(hasStacks ? 1 : 0);
|
||||
//
|
||||
// if (hasStacks)
|
||||
// {
|
||||
// for (int i = 0; i < 3 * 1; i++)
|
||||
// {
|
||||
// dos.writeInt(items[i]);
|
||||
// }
|
||||
// }
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = "TEPedestal";
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// pkt.isChunkDataPacket = true;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// public static Packet getPacket(TEPlinth tileEntity)
|
||||
// {
|
||||
// // TODO Auto-generated method stub
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(140);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
// int[] items = tileEntity.buildIntDataList();
|
||||
// boolean hasStacks = (items != null);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// dos.writeInt(tileEntity.xCoord);
|
||||
// dos.writeInt(tileEntity.yCoord);
|
||||
// dos.writeInt(tileEntity.zCoord);
|
||||
// dos.writeByte(hasStacks ? 1 : 0);
|
||||
//
|
||||
// if (hasStacks)
|
||||
// {
|
||||
// for (int i = 0; i < 3 * 1; i++)
|
||||
// {
|
||||
// dos.writeInt(items[i]);
|
||||
// }
|
||||
// }
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = "TEPlinth";
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// pkt.isChunkDataPacket = true;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// public static Packet getPacket(TETeleposer tileEntity)
|
||||
// {
|
||||
// // TODO Auto-generated method stub
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(140);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
// int[] items = tileEntity.buildIntDataList();
|
||||
// boolean hasStacks = (items != null);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// dos.writeInt(tileEntity.xCoord);
|
||||
// dos.writeInt(tileEntity.yCoord);
|
||||
// dos.writeInt(tileEntity.zCoord);
|
||||
// dos.writeByte(hasStacks ? 1 : 0);
|
||||
//
|
||||
// if (hasStacks)
|
||||
// {
|
||||
// for (int i = 0; i < 3 * 1; i++)
|
||||
// {
|
||||
// dos.writeInt(items[i]);
|
||||
// }
|
||||
// }
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = "TETeleposer";
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// pkt.isChunkDataPacket = true;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// public static Packet getCustomParticlePacket(String str, double x, double y, double z, double xVel, double yVel, double zVel)
|
||||
// {
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(140);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// dos.writeInt(str.length());
|
||||
// dos.writeChars(str);
|
||||
// dos.writeDouble(x);
|
||||
// dos.writeDouble(y);
|
||||
// dos.writeDouble(z);
|
||||
// dos.writeDouble(xVel);
|
||||
// dos.writeDouble(yVel);
|
||||
// dos.writeDouble(zVel);
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = "CustomParticle";
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// pkt.isChunkDataPacket = false;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// public static Packet getPlayerVelocitySettingPacket(double xVel, double yVel, double zVel)
|
||||
// {
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(140);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// dos.writeDouble(xVel);
|
||||
// dos.writeDouble(yVel);
|
||||
// dos.writeDouble(zVel);
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = "SetPlayerVel";
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// pkt.isChunkDataPacket = false;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// public static Packet getPlayerPositionSettingPacket(double xVel, double yVel, double zVel)
|
||||
// {
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(140);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// dos.writeDouble(xVel);
|
||||
// dos.writeDouble(yVel);
|
||||
// dos.writeDouble(zVel);
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = "SetPlayerPos";
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// pkt.isChunkDataPacket = false;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// public static Packet getCreativeCheatPacket(String ownerName, boolean isFill)
|
||||
// {
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(140);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// dos.writeInt(ownerName.length());
|
||||
// dos.writeChars(ownerName);
|
||||
// dos.writeBoolean(isFill);
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = "InfiniteLPPath";
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// pkt.isChunkDataPacket = false;
|
||||
// return pkt;
|
||||
// }
|
||||
//
|
||||
// public static Packet getBlockOrientationPacket(TEOrientable tileEntity)
|
||||
// {
|
||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream(140);
|
||||
// DataOutputStream dos = new DataOutputStream(bos);
|
||||
//
|
||||
// try
|
||||
// {
|
||||
// dos.writeInt(tileEntity.xCoord);
|
||||
// dos.writeInt(tileEntity.yCoord);
|
||||
// dos.writeInt(tileEntity.zCoord);
|
||||
// dos.writeInt(tileEntity.getIntForForgeDirection(tileEntity.getInputDirection()));
|
||||
// dos.writeInt(tileEntity.getIntForForgeDirection(tileEntity.getOutputDirection()));
|
||||
// } catch (IOException e)
|
||||
// {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// Packet250CustomPayload pkt = new Packet250CustomPayload();
|
||||
// pkt.channel = "TEOrientor";
|
||||
// pkt.data = bos.toByteArray();
|
||||
// pkt.length = bos.size();
|
||||
// pkt.isChunkDataPacket = true;
|
||||
// return pkt;
|
||||
// }
|
||||
}
|
|
@ -2,26 +2,26 @@ package WayofTime.alchemicalWizardry.common.alchemy;
|
|||
|
||||
import net.minecraft.potion.Potion;
|
||||
|
||||
public class CombinedPotionComponent
|
||||
public class CombinedPotionComponent
|
||||
{
|
||||
public Potion result;
|
||||
public Potion pot1;
|
||||
public Potion pot2;
|
||||
|
||||
public CombinedPotionComponent(Potion result, Potion pot1, Potion pot2)
|
||||
{
|
||||
this.result = result;
|
||||
this.pot1 = pot1;
|
||||
this.pot2 = pot2;
|
||||
}
|
||||
|
||||
public boolean isRecipeValid(Potion test1, Potion test2)
|
||||
{
|
||||
return (test1 == pot1 && test2 == pot2) || (test1 == pot2 && test2 == pot1);
|
||||
}
|
||||
|
||||
public boolean isRecipeValid(int test1, int test2)
|
||||
{
|
||||
return (test1 == pot1.id && test2 == pot2.id) || (test1 == pot2.id && test2 == pot1.id);
|
||||
}
|
||||
public Potion result;
|
||||
public Potion pot1;
|
||||
public Potion pot2;
|
||||
|
||||
public CombinedPotionComponent(Potion result, Potion pot1, Potion pot2)
|
||||
{
|
||||
this.result = result;
|
||||
this.pot1 = pot1;
|
||||
this.pot2 = pot2;
|
||||
}
|
||||
|
||||
public boolean isRecipeValid(Potion test1, Potion test2)
|
||||
{
|
||||
return (test1 == pot1 && test2 == pot2) || (test1 == pot2 && test2 == pot1);
|
||||
}
|
||||
|
||||
public boolean isRecipeValid(int test1, int test2)
|
||||
{
|
||||
return (test1 == pot1.id && test2 == pot2.id) || (test1 == pot2.id && test2 == pot1.id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,182 +1,182 @@
|
|||
package WayofTime.alchemicalWizardry.common.alchemy;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper;
|
||||
import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyPotionHelper;
|
||||
import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask;
|
||||
|
||||
public class CombinedPotionRegistry
|
||||
public class CombinedPotionRegistry
|
||||
{
|
||||
public static List<CombinedPotionComponent> potionList = new ArrayList();
|
||||
|
||||
public static void registerCombinedPotionRecipe(Potion result, Potion pot1, Potion pot2)
|
||||
{
|
||||
potionList.add(new CombinedPotionComponent(result, pot1, pot2));
|
||||
}
|
||||
|
||||
public static boolean isRecipeValid(Potion pot1, Potion pot2)
|
||||
{
|
||||
for(CombinedPotionComponent recipe : potionList)
|
||||
{
|
||||
if(recipe.isRecipeValid(pot1, pot2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isRecipeValid(int pot1, int pot2)
|
||||
{
|
||||
for(CombinedPotionComponent recipe : potionList)
|
||||
{
|
||||
if(recipe.isRecipeValid(pot1, pot2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Potion getPotion(Potion pot1, Potion pot2)
|
||||
{
|
||||
for(CombinedPotionComponent recipe : potionList)
|
||||
{
|
||||
if(recipe.isRecipeValid(pot1, pot2))
|
||||
{
|
||||
return recipe.result;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Potion getPotion(int pot1, int pot2)
|
||||
{
|
||||
for(CombinedPotionComponent recipe : potionList)
|
||||
{
|
||||
if(recipe.isRecipeValid(pot1, pot2))
|
||||
{
|
||||
return recipe.result;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ItemStack applyPotionEffect(ItemStack stack)
|
||||
{
|
||||
if(stack == null || !(stack.getItem() instanceof AlchemyFlask))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
List<AlchemyPotionHelper> list = AlchemyFlask.getEffects(stack);
|
||||
if(list == null)
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
|
||||
boolean isDone = false;
|
||||
|
||||
for(AlchemyPotionHelper helper1 : list)
|
||||
{
|
||||
if(isDone)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for(int i=0; i<list.size(); i++)
|
||||
{
|
||||
if(isDone)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
AlchemyPotionHelper helper2 = list.get(i);
|
||||
|
||||
PotionEffect potEffect = getResultantPotion(helper1, helper2);
|
||||
|
||||
if(potEffect != null)
|
||||
{
|
||||
AlchemyPotionHelper potHelper = new AlchemyPotionHelper(potEffect.getPotionID(), potEffect.getDuration(), 0, potEffect.getAmplifier());
|
||||
|
||||
list.remove(helper1);
|
||||
list.remove(helper2);
|
||||
|
||||
list.add(potHelper);
|
||||
|
||||
isDone = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isDone)
|
||||
{
|
||||
AlchemyFlask.setEffects(stack, list);
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean hasCombinablePotionEffect(ItemStack stack)
|
||||
{
|
||||
if(stack == null || !(stack.getItem() instanceof AlchemyFlask))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
List<AlchemyPotionHelper> list = AlchemyFlask.getEffects(stack);
|
||||
if(list == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for(AlchemyPotionHelper helper1 : list)
|
||||
{
|
||||
for(AlchemyPotionHelper helper2 : list)
|
||||
{
|
||||
int pot1 = helper1.getPotionID();
|
||||
int pot2 = helper2.getPotionID();
|
||||
|
||||
if(isRecipeValid(pot1, pot2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static PotionEffect getResultantPotion(AlchemyPotionHelper potE1, AlchemyPotionHelper potE2)
|
||||
{
|
||||
if(potE1 == null || potE2 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int pot1 = potE1.getPotionID();
|
||||
int pot2 = potE2.getPotionID();
|
||||
|
||||
if(isRecipeValid(pot1, pot2))
|
||||
{
|
||||
int duration = (int)((potE1.getTickDuration()* Math.pow(8.0f / 3.0f, potE1.getdurationFactor()) + potE2.getdurationFactor() * Math.pow(8.0f / 3.0f, potE2.getdurationFactor()))/2.0);
|
||||
int amplifier = (potE1.getConcentration() + potE2.getConcentration())/2;
|
||||
|
||||
Potion pot = getPotion(pot1, pot2);
|
||||
|
||||
return new PotionEffect(pot.id, duration, amplifier);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
public static List<CombinedPotionComponent> potionList = new ArrayList();
|
||||
|
||||
public static void registerCombinedPotionRecipe(Potion result, Potion pot1, Potion pot2)
|
||||
{
|
||||
potionList.add(new CombinedPotionComponent(result, pot1, pot2));
|
||||
}
|
||||
|
||||
public static boolean isRecipeValid(Potion pot1, Potion pot2)
|
||||
{
|
||||
for (CombinedPotionComponent recipe : potionList)
|
||||
{
|
||||
if (recipe.isRecipeValid(pot1, pot2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isRecipeValid(int pot1, int pot2)
|
||||
{
|
||||
for (CombinedPotionComponent recipe : potionList)
|
||||
{
|
||||
if (recipe.isRecipeValid(pot1, pot2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Potion getPotion(Potion pot1, Potion pot2)
|
||||
{
|
||||
for (CombinedPotionComponent recipe : potionList)
|
||||
{
|
||||
if (recipe.isRecipeValid(pot1, pot2))
|
||||
{
|
||||
return recipe.result;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Potion getPotion(int pot1, int pot2)
|
||||
{
|
||||
for (CombinedPotionComponent recipe : potionList)
|
||||
{
|
||||
if (recipe.isRecipeValid(pot1, pot2))
|
||||
{
|
||||
return recipe.result;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ItemStack applyPotionEffect(ItemStack stack)
|
||||
{
|
||||
if (stack == null || !(stack.getItem() instanceof AlchemyFlask))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
List<AlchemyPotionHelper> list = AlchemyFlask.getEffects(stack);
|
||||
if (list == null)
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
|
||||
boolean isDone = false;
|
||||
|
||||
for (AlchemyPotionHelper helper1 : list)
|
||||
{
|
||||
if (isDone)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
{
|
||||
if (isDone)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
AlchemyPotionHelper helper2 = list.get(i);
|
||||
|
||||
PotionEffect potEffect = getResultantPotion(helper1, helper2);
|
||||
|
||||
if (potEffect != null)
|
||||
{
|
||||
AlchemyPotionHelper potHelper = new AlchemyPotionHelper(potEffect.getPotionID(), potEffect.getDuration(), 0, potEffect.getAmplifier());
|
||||
|
||||
list.remove(helper1);
|
||||
list.remove(helper2);
|
||||
|
||||
list.add(potHelper);
|
||||
|
||||
isDone = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isDone)
|
||||
{
|
||||
AlchemyFlask.setEffects(stack, list);
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean hasCombinablePotionEffect(ItemStack stack)
|
||||
{
|
||||
if (stack == null || !(stack.getItem() instanceof AlchemyFlask))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
List<AlchemyPotionHelper> list = AlchemyFlask.getEffects(stack);
|
||||
if (list == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (AlchemyPotionHelper helper1 : list)
|
||||
{
|
||||
for (AlchemyPotionHelper helper2 : list)
|
||||
{
|
||||
int pot1 = helper1.getPotionID();
|
||||
int pot2 = helper2.getPotionID();
|
||||
|
||||
if (isRecipeValid(pot1, pot2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static PotionEffect getResultantPotion(AlchemyPotionHelper potE1, AlchemyPotionHelper potE2)
|
||||
{
|
||||
if (potE1 == null || potE2 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int pot1 = potE1.getPotionID();
|
||||
int pot2 = potE2.getPotionID();
|
||||
|
||||
if (isRecipeValid(pot1, pot2))
|
||||
{
|
||||
int duration = (int) ((potE1.getTickDuration() * Math.pow(8.0f / 3.0f, potE1.getdurationFactor()) + potE2.getdurationFactor() * Math.pow(8.0f / 3.0f, potE2.getdurationFactor())) / 2.0);
|
||||
int amplifier = (potE1.getConcentration() + potE2.getConcentration()) / 2;
|
||||
|
||||
Potion pot = getPotion(pot1, pot2);
|
||||
|
||||
return new PotionEffect(pot.id, duration, amplifier);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.alchemy;
|
||||
|
||||
public interface ICombinationalCatalyst
|
||||
public interface ICombinationalCatalyst
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.ArmourComponent;
|
||||
import WayofTime.alchemicalWizardry.common.items.BoundArmour;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -14,16 +20,9 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.ArmourComponent;
|
||||
import WayofTime.alchemicalWizardry.common.items.BoundArmour;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ArmourForge extends Block
|
||||
{
|
||||
|
@ -39,8 +38,6 @@ public class ArmourForge extends Block
|
|||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("armourForge");
|
||||
//setUnlocalizedName("armourForge");
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -160,7 +157,6 @@ public class ArmourForge extends Block
|
|||
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
//PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, world.provider.dimensionId, TEAltar.getParticlePacket(xCoord, yCoord, zCoord, (short) 1));
|
||||
SpellHelper.sendIndexedParticleToAllAround(world, xCoord, yCoord, zCoord, 20, world.provider.dimensionId, 1, xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -12,29 +14,27 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockAlchemicCalcinator extends BlockContainer
|
||||
{
|
||||
public BlockAlchemicCalcinator()
|
||||
{
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
public BlockAlchemicCalcinator()
|
||||
{
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("alchemicCalcinator");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TEAlchemicCalcinator();
|
||||
}
|
||||
|
||||
@Override
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("alchemicCalcinator");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TEAlchemicCalcinator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
|
@ -57,13 +57,13 @@ public class BlockAlchemicCalcinator extends BlockContainer
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
|
||||
{
|
||||
|
@ -110,11 +110,11 @@ public class BlockAlchemicCalcinator extends BlockContainer
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
{
|
||||
TEAlchemicCalcinator tileEntity = (TEAlchemicCalcinator) world.getTileEntity(x, y, z);
|
||||
TEAlchemicCalcinator tileEntity = (TEAlchemicCalcinator) world.getTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity == null || player.isSneaking())
|
||||
{
|
||||
|
@ -122,45 +122,44 @@ public class BlockAlchemicCalcinator extends BlockContainer
|
|||
}
|
||||
|
||||
ItemStack playerItem = player.getCurrentEquippedItem();
|
||||
|
||||
|
||||
if (playerItem != null)
|
||||
{
|
||||
if(playerItem.getItem() instanceof IReagentManipulator)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(playerItem.getItem() instanceof IBloodOrb)
|
||||
{
|
||||
if(tileEntity.getStackInSlot(0) == null)
|
||||
{
|
||||
ItemStack newItem = playerItem.copy();
|
||||
if (playerItem.getItem() instanceof IReagentManipulator)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (playerItem.getItem() instanceof IBloodOrb)
|
||||
{
|
||||
if (tileEntity.getStackInSlot(0) == null)
|
||||
{
|
||||
ItemStack newItem = playerItem.copy();
|
||||
newItem.stackSize = 1;
|
||||
--playerItem.stackSize;
|
||||
tileEntity.setInventorySlotContents(0, newItem);
|
||||
}
|
||||
}
|
||||
else if(tileEntity.getStackInSlot(1) == null)
|
||||
{
|
||||
ItemStack newItem = playerItem.copy();
|
||||
}
|
||||
} else if (tileEntity.getStackInSlot(1) == null)
|
||||
{
|
||||
ItemStack newItem = playerItem.copy();
|
||||
newItem.stackSize = 1;
|
||||
--playerItem.stackSize;
|
||||
tileEntity.setInventorySlotContents(1, newItem);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (playerItem == null)
|
||||
{
|
||||
if(tileEntity.getStackInSlot(1) != null)
|
||||
{
|
||||
if (tileEntity.getStackInSlot(1) != null)
|
||||
{
|
||||
player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(1));
|
||||
tileEntity.setInventorySlotContents(1, null);
|
||||
}else if(tileEntity.getStackInSlot(0) != null)
|
||||
{
|
||||
player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0));
|
||||
} else if (tileEntity.getStackInSlot(0) != null)
|
||||
{
|
||||
player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0));
|
||||
tileEntity.setInventorySlotContents(0, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tileEntity.getWorldObj().markBlockForUpdate(x, y, z);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -15,17 +18,9 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.PacketHandler;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyBattery;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockAltar extends BlockContainer
|
||||
{
|
||||
|
@ -45,8 +40,6 @@ public class BlockAltar extends BlockContainer
|
|||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("bloodAltar");
|
||||
//setUnlocalizedName("blockAltar");
|
||||
//func_111022_d("AlchemicalWizardry:blocks");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -67,29 +60,23 @@ public class BlockAltar extends BlockContainer
|
|||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
|
||||
case 1:
|
||||
return topIcon;
|
||||
|
||||
//case 2: return sideIcon1;
|
||||
//case 3: return sideIcon1;
|
||||
//case 4: return sideIcon2;
|
||||
//case 5: return sideIcon2;
|
||||
default:
|
||||
return sideIcon2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride()
|
||||
{
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int meta)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if (tile instanceof TEAltar)
|
||||
{
|
||||
|
@ -113,8 +100,6 @@ public class BlockAltar extends BlockContainer
|
|||
{
|
||||
TEAltar tileEntity = (TEAltar) world.getTileEntity(x, y, z);
|
||||
|
||||
// world.scheduleBlockUpdate(x, y, z, this.blockID, 0);
|
||||
|
||||
if (tileEntity == null || player.isSneaking())
|
||||
{
|
||||
return false;
|
||||
|
@ -129,26 +114,24 @@ public class BlockAltar extends BlockContainer
|
|||
if (player.worldObj.isRemote)
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}else
|
||||
} else
|
||||
{
|
||||
tileEntity.sendChatInfoToPlayer(player);
|
||||
tileEntity.sendChatInfoToPlayer(player);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if(playerItem.getItem().equals(ModItems.itemSeerSigil))
|
||||
} else if (playerItem.getItem().equals(ModItems.itemSeerSigil))
|
||||
{
|
||||
if (player.worldObj.isRemote)
|
||||
if (player.worldObj.isRemote)
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}else
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
} else
|
||||
{
|
||||
tileEntity.sendMoreChatInfoToPlayer(player);
|
||||
tileEntity.sendMoreChatInfoToPlayer(player);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (playerItem.getItem().equals(ModItems.sigilOfHolding))
|
||||
} else if (playerItem.getItem().equals(ModItems.sigilOfHolding))
|
||||
{
|
||||
ItemStack item = ((SigilOfHolding) playerItem.getItem()).getCurrentItem(playerItem);
|
||||
|
||||
|
@ -156,24 +139,23 @@ public class BlockAltar extends BlockContainer
|
|||
{
|
||||
if (player.worldObj.isRemote)
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}else
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
} else
|
||||
{
|
||||
tileEntity.sendChatInfoToPlayer(player);
|
||||
tileEntity.sendChatInfoToPlayer(player);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
else if(item !=null && item.getItem().equals(ModItems.itemSeerSigil))
|
||||
} else if (item != null && item.getItem().equals(ModItems.itemSeerSigil))
|
||||
{
|
||||
if (player.worldObj.isRemote)
|
||||
if (player.worldObj.isRemote)
|
||||
{
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}else
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
} else
|
||||
{
|
||||
tileEntity.sendMoreChatInfoToPlayer(player);
|
||||
tileEntity.sendMoreChatInfoToPlayer(player);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -183,27 +165,16 @@ public class BlockAltar extends BlockContainer
|
|||
{
|
||||
ItemStack newItem = playerItem.copy();
|
||||
newItem.stackSize = 1;
|
||||
// if(newItem.getMaxDamage()==0)
|
||||
// {
|
||||
// newItem.setItemDamage(0);
|
||||
// }
|
||||
--playerItem.stackSize;
|
||||
tileEntity.setInventorySlotContents(0, newItem);
|
||||
tileEntity.startCycle();
|
||||
} else if (tileEntity.getStackInSlot(0) != null && playerItem == null)
|
||||
{
|
||||
/**stub method
|
||||
* Add the item that is in the slot to the player's inventory, and
|
||||
* then set the slot to null.
|
||||
*/
|
||||
player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0));
|
||||
tileEntity.setInventorySlotContents(0, null);
|
||||
tileEntity.setActive();
|
||||
}
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
//player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z);
|
||||
//PacketDispatcher.sendPacketToServer(tileEntity.getDescriptionPacket());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -294,21 +265,9 @@ public class BlockAltar extends BlockContainer
|
|||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
||||
// {
|
||||
// return 1;
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public boolean canProvidePower()
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2)
|
||||
{
|
||||
return new TEAltar();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2)
|
||||
{
|
||||
return new TEAltar();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -9,84 +9,43 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class BlockBelljar extends BlockContainer
|
||||
{
|
||||
public BlockBelljar()
|
||||
{
|
||||
super(Material.glass);
|
||||
setHardness(2.0F);
|
||||
public BlockBelljar()
|
||||
{
|
||||
super(Material.glass);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("crystalBelljar");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack stack)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if(tile instanceof TEBellJar)
|
||||
{
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
if(tag != null)
|
||||
{
|
||||
((TEBellJar) tile).readTankNBTOnPlace(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
|
||||
// {
|
||||
// if(world.isRemote)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// TileEntity tile = world.getTileEntity(x, y, z);
|
||||
//
|
||||
// if(tile == null)
|
||||
// {
|
||||
// System.out.println("Tile has been removed already!");
|
||||
// }
|
||||
//
|
||||
// if(tile instanceof TEBellJar)
|
||||
// {
|
||||
// if(((TEBellJar) tile).areTanksEmpty())
|
||||
// {
|
||||
// super.breakBlock(world, x, y, z, par5, par6);
|
||||
// return;
|
||||
// }
|
||||
// System.out.println("Writing...");
|
||||
// ItemStack droppedStack = new ItemStack(ModBlocks.blockCrystalBelljar);
|
||||
// droppedStack.setTagCompound(new NBTTagCompound());
|
||||
//
|
||||
// NBTTagCompound savedTag = droppedStack.getTagCompound();
|
||||
// ((TEBellJar) tile).writeTankNBT(savedTag);
|
||||
//
|
||||
// this.dropBlockAsItem(world, x, y, z, droppedStack);
|
||||
//
|
||||
// world.removeTileEntity(x, y, z);
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// super.breakBlock(world, x, y, z, par5, par6);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TEBellJar();
|
||||
}
|
||||
|
||||
@Override
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("crystalBelljar");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack stack)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if (tile instanceof TEBellJar)
|
||||
{
|
||||
NBTTagCompound tag = stack.getTagCompound();
|
||||
if (tag != null)
|
||||
{
|
||||
((TEBellJar) tile).readTankNBTOnPlace(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TEBellJar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
|
@ -108,50 +67,49 @@ public class BlockBelljar extends BlockContainer
|
|||
public boolean hasTileEntity()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride()
|
||||
{
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int meta)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if(tile instanceof TEBellJar)
|
||||
{
|
||||
return ((TEBellJar) tile).getRSPowerOutput();
|
||||
}
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile instanceof TEBellJar)
|
||||
{
|
||||
return ((TEBellJar) tile).getRSPowerOutput();
|
||||
}
|
||||
return 15;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player)
|
||||
{
|
||||
this.dropBlockAsItem(world, x, y, z, meta, 0);
|
||||
|
||||
super.onBlockHarvested(world, x, y, z, meta, player);
|
||||
this.dropBlockAsItem(world, x, y, z, meta, 0);
|
||||
super.onBlockHarvested(world, x, y, z, meta, player);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune)
|
||||
{
|
||||
ArrayList<ItemStack> list = new ArrayList();
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if(tile instanceof TEBellJar)
|
||||
{
|
||||
ItemStack drop = new ItemStack(this);
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
((TEBellJar)tile).writeTankNBT(tag);
|
||||
drop.stackTagCompound = tag;
|
||||
|
||||
list.add(drop);
|
||||
}
|
||||
|
||||
return list;
|
||||
ArrayList<ItemStack> list = new ArrayList();
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if (tile instanceof TEBellJar)
|
||||
{
|
||||
ItemStack drop = new ItemStack(this);
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
((TEBellJar) tile).writeTankNBT(tag);
|
||||
drop.stackTagCompound = tag;
|
||||
|
||||
list.add(drop);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -10,15 +9,15 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockBloodLightSource extends Block
|
||||
{
|
||||
public BlockBloodLightSource()
|
||||
{
|
||||
super(Material.cloth);
|
||||
//setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("blockBloodLightSource");
|
||||
}
|
||||
|
||||
|
@ -65,7 +64,6 @@ public class BlockBloodLightSource extends Block
|
|||
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
|
||||
{
|
||||
this.setBlockBounds(0.40F, 0.40F, 0.40F, 0.60F, 0.60F, 0.60F);
|
||||
//super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
||||
}
|
||||
|
||||
public int quantityDropped(Random par1Random)
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockConduit extends BlockOrientable
|
||||
{
|
||||
|
@ -28,7 +28,6 @@ public class BlockConduit extends BlockOrientable
|
|||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("blockConduit");
|
||||
//func_111022_d("AlchemicalWizardry:blocks");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -49,14 +48,8 @@ public class BlockConduit extends BlockOrientable
|
|||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
|
||||
case 1:
|
||||
return topIcon;
|
||||
|
||||
//case 2: return sideIcon1;
|
||||
//case 3: return sideIcon1;
|
||||
//case 4: return sideIcon2;
|
||||
//case 5: return sideIcon2;
|
||||
default:
|
||||
return sideIcon2;
|
||||
}
|
||||
|
@ -65,7 +58,6 @@ public class BlockConduit extends BlockOrientable
|
|||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6)
|
||||
{
|
||||
//dropItems(world, x, y, z);
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,43 +1,42 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEDemonPortal;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEDemonPortal;
|
||||
|
||||
public class BlockDemonPortal extends BlockContainer
|
||||
{
|
||||
public BlockDemonPortal()
|
||||
{
|
||||
super(Material.rock);
|
||||
public BlockDemonPortal()
|
||||
{
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("demonPortal");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2)
|
||||
{
|
||||
return new TEDemonPortal();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2)
|
||||
{
|
||||
return new TEDemonPortal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are)
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TEDemonPortal tileEntity = (TEDemonPortal) world.getTileEntity(x, y, z);
|
||||
|
||||
tileEntity.rightClickBlock(player, side);
|
||||
|
||||
return false;
|
||||
if (world.isRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TEDemonPortal tileEntity = (TEDemonPortal) world.getTileEntity(x, y, z);
|
||||
|
||||
tileEntity.rightClickBlock(player, side);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.items.BlankSpell;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -9,11 +14,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.items.BlankSpell;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockHomHeart extends BlockContainer
|
||||
{
|
||||
|
@ -47,14 +47,8 @@ public class BlockHomHeart extends BlockContainer
|
|||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
|
||||
case 1:
|
||||
return topIcon;
|
||||
|
||||
//case 2: return sideIcon1;
|
||||
//case 3: return sideIcon1;
|
||||
//case 4: return sideIcon2;
|
||||
//case 5: return sideIcon2;
|
||||
default:
|
||||
return sideIcon;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.items.ActivationCrystal;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -8,11 +13,6 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.items.ActivationCrystal;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockMasterStone extends BlockContainer
|
||||
{
|
||||
|
@ -23,7 +23,6 @@ public class BlockMasterStone extends BlockContainer
|
|||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("blockMasterStone");
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,17 +31,17 @@ public class BlockMasterStone extends BlockContainer
|
|||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:MasterStone");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if(tile instanceof TEMasterStone)
|
||||
{
|
||||
((TEMasterStone) tile).useOnRitualBroken();
|
||||
}
|
||||
|
||||
super.onBlockHarvested(world, x, y, z, meta, player);
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile instanceof TEMasterStone)
|
||||
{
|
||||
((TEMasterStone) tile).useOnRitualBroken();
|
||||
}
|
||||
|
||||
super.onBlockHarvested(world, x, y, z, meta, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,49 +1,34 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEOrientable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockOrientable extends BlockContainer
|
||||
{
|
||||
{
|
||||
public BlockOrientable()
|
||||
{
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
//setUnlocalizedName("bloodSocket");
|
||||
//func_111022_d("AlchemicalWizardry:blocks");
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int dunno)
|
||||
{
|
||||
return new TEOrientable();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are)
|
||||
{
|
||||
//Right-click orients the output face. Shift-right-click orients the input face.
|
||||
//Right-click orients the output face. Shift-right-click orients the input face.
|
||||
if (world.isRemote)
|
||||
{
|
||||
return false;
|
||||
|
@ -54,137 +39,167 @@ public class BlockOrientable extends BlockContainer
|
|||
|
||||
if (tile instanceof TEOrientable)
|
||||
{
|
||||
TEOrientable newTile = (TEOrientable)tile;
|
||||
if(player.isSneaking())
|
||||
{
|
||||
int nextSide = TEOrientable.getIntForForgeDirection(newTile.getInputDirection())+1;
|
||||
|
||||
if(nextSide>5)
|
||||
{
|
||||
nextSide = 0;
|
||||
}
|
||||
if(ForgeDirection.getOrientation(nextSide)==newTile.getOutputDirection())
|
||||
{
|
||||
nextSide++;
|
||||
if(nextSide>5)
|
||||
{
|
||||
nextSide = 0;
|
||||
}
|
||||
}
|
||||
|
||||
newTile.setInputDirection(ForgeDirection.getOrientation(nextSide));
|
||||
}else
|
||||
{
|
||||
int nextSide = TEOrientable.getIntForForgeDirection(newTile.getOutputDirection())+1;
|
||||
|
||||
if(nextSide>5)
|
||||
{
|
||||
nextSide = 0;
|
||||
}
|
||||
if(ForgeDirection.getOrientation(nextSide)==newTile.getInputDirection())
|
||||
{
|
||||
nextSide++;
|
||||
if(nextSide>5)
|
||||
{
|
||||
nextSide = 0;
|
||||
}
|
||||
}
|
||||
|
||||
newTile.setOutputDirection(ForgeDirection.getOrientation(nextSide));
|
||||
}
|
||||
TEOrientable newTile = (TEOrientable) tile;
|
||||
if (player.isSneaking())
|
||||
{
|
||||
int nextSide = TEOrientable.getIntForForgeDirection(newTile.getInputDirection()) + 1;
|
||||
|
||||
if (nextSide > 5)
|
||||
{
|
||||
nextSide = 0;
|
||||
}
|
||||
if (ForgeDirection.getOrientation(nextSide) == newTile.getOutputDirection())
|
||||
{
|
||||
nextSide++;
|
||||
if (nextSide > 5)
|
||||
{
|
||||
nextSide = 0;
|
||||
}
|
||||
}
|
||||
|
||||
newTile.setInputDirection(ForgeDirection.getOrientation(nextSide));
|
||||
} else
|
||||
{
|
||||
int nextSide = TEOrientable.getIntForForgeDirection(newTile.getOutputDirection()) + 1;
|
||||
|
||||
if (nextSide > 5)
|
||||
{
|
||||
nextSide = 0;
|
||||
}
|
||||
if (ForgeDirection.getOrientation(nextSide) == newTile.getInputDirection())
|
||||
{
|
||||
nextSide++;
|
||||
if (nextSide > 5)
|
||||
{
|
||||
nextSide = 0;
|
||||
}
|
||||
}
|
||||
|
||||
newTile.setOutputDirection(ForgeDirection.getOrientation(nextSide));
|
||||
}
|
||||
}
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public int getTextureIndexForSideAndOrientation(int side, ForgeDirection input, ForgeDirection output)
|
||||
{
|
||||
if(ForgeDirection.getOrientation(side) == input)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if(ForgeDirection.getOrientation(side) == output)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if(ForgeDirection.getOrientation(side) == output.getOpposite())
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
|
||||
switch(side)
|
||||
{
|
||||
case 0: //BOTTOM
|
||||
switch(output)
|
||||
{
|
||||
case NORTH: return 2; //UP
|
||||
case SOUTH: return 3; //DOWN
|
||||
case EAST: return 4; //LEFT
|
||||
case WEST: return 5; //RIGHT
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
case 1: //TOP
|
||||
switch(output)
|
||||
{
|
||||
case NORTH: return 2; //UP
|
||||
case SOUTH: return 3; //DOWN
|
||||
case EAST: return 5;
|
||||
case WEST: return 4;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
case 2: //NORTH
|
||||
switch(output)
|
||||
{
|
||||
case DOWN: return 3;
|
||||
case UP: return 2;
|
||||
case EAST: return 4;
|
||||
case WEST: return 5;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
case 3: //SOUTH
|
||||
switch(output)
|
||||
{
|
||||
case DOWN: return 3;
|
||||
case UP: return 2;
|
||||
case EAST: return 5;
|
||||
case WEST: return 4;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
case 4: //WEST
|
||||
switch(output)
|
||||
{
|
||||
case DOWN: return 3;
|
||||
case UP: return 2;
|
||||
case NORTH: return 5;
|
||||
case SOUTH: return 4;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
case 5: //EAST
|
||||
switch(output)
|
||||
{
|
||||
case DOWN: return 3;
|
||||
case UP: return 2;
|
||||
case NORTH: return 4;
|
||||
case SOUTH: return 5;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
if (ForgeDirection.getOrientation(side) == input)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (ForgeDirection.getOrientation(side) == output)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if (ForgeDirection.getOrientation(side) == output.getOpposite())
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
|
||||
switch (side)
|
||||
{
|
||||
case 0: //BOTTOM
|
||||
switch (output)
|
||||
{
|
||||
case NORTH:
|
||||
return 2; //UP
|
||||
case SOUTH:
|
||||
return 3; //DOWN
|
||||
case EAST:
|
||||
return 4; //LEFT
|
||||
case WEST:
|
||||
return 5; //RIGHT
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1: //TOP
|
||||
switch (output)
|
||||
{
|
||||
case NORTH:
|
||||
return 2; //UP
|
||||
case SOUTH:
|
||||
return 3; //DOWN
|
||||
case EAST:
|
||||
return 5;
|
||||
case WEST:
|
||||
return 4;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2: //NORTH
|
||||
switch (output)
|
||||
{
|
||||
case DOWN:
|
||||
return 3;
|
||||
case UP:
|
||||
return 2;
|
||||
case EAST:
|
||||
return 4;
|
||||
case WEST:
|
||||
return 5;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 3: //SOUTH
|
||||
switch (output)
|
||||
{
|
||||
case DOWN:
|
||||
return 3;
|
||||
case UP:
|
||||
return 2;
|
||||
case EAST:
|
||||
return 5;
|
||||
case WEST:
|
||||
return 4;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 4: //WEST
|
||||
switch (output)
|
||||
{
|
||||
case DOWN:
|
||||
return 3;
|
||||
case UP:
|
||||
return 2;
|
||||
case NORTH:
|
||||
return 5;
|
||||
case SOUTH:
|
||||
return 4;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 5: //EAST
|
||||
switch (output)
|
||||
{
|
||||
case DOWN:
|
||||
return 3;
|
||||
case UP:
|
||||
return 2;
|
||||
case NORTH:
|
||||
return 4;
|
||||
case SOUTH:
|
||||
return 5;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int damageDropped(int metadata)
|
||||
{
|
||||
return metadata;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -16,10 +18,8 @@ import net.minecraft.util.IIcon;
|
|||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockPedestal extends BlockContainer
|
||||
{
|
||||
|
@ -39,7 +39,6 @@ public class BlockPedestal extends BlockContainer
|
|||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("bloodPedestal");
|
||||
//func_111022_d("AlchemicalWizardry:blocks");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -60,14 +59,8 @@ public class BlockPedestal extends BlockContainer
|
|||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
|
||||
case 1:
|
||||
return topIcon;
|
||||
|
||||
//case 2: return sideIcon1;
|
||||
//case 3: return sideIcon1;
|
||||
//case 4: return sideIcon2;
|
||||
//case 5: return sideIcon2;
|
||||
default:
|
||||
return sideIcon2;
|
||||
}
|
||||
|
@ -93,18 +86,11 @@ public class BlockPedestal extends BlockContainer
|
|||
tileEntity.setInventorySlotContents(0, newItem);
|
||||
} else if (tileEntity.getStackInSlot(0) != null && playerItem == null)
|
||||
{
|
||||
/**stub method
|
||||
* Add the item that is in the slot to the player's inventory, and
|
||||
* then set the slot to null.
|
||||
*/
|
||||
player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0));
|
||||
tileEntity.setInventorySlotContents(0, null);
|
||||
tileEntity.setActive();
|
||||
}
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
//player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z);
|
||||
//PacketDispatcher.sendPacketToServer(tileEntity.getDescriptionPacket());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -16,10 +18,8 @@ import net.minecraft.util.IIcon;
|
|||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockPlinth extends BlockContainer
|
||||
{
|
||||
|
@ -39,7 +39,6 @@ public class BlockPlinth extends BlockContainer
|
|||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("bloodPlinth");
|
||||
//func_111022_d("AlchemicalWizardry:blocks");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -60,14 +59,8 @@ public class BlockPlinth extends BlockContainer
|
|||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
|
||||
case 1:
|
||||
return topIcon;
|
||||
|
||||
//case 2: return sideIcon1;
|
||||
//case 3: return sideIcon1;
|
||||
//case 4: return sideIcon2;
|
||||
//case 5: return sideIcon2;
|
||||
default:
|
||||
return sideIcon2;
|
||||
}
|
||||
|
@ -93,18 +86,11 @@ public class BlockPlinth extends BlockContainer
|
|||
tileEntity.setInventorySlotContents(0, newItem);
|
||||
} else if (tileEntity.getStackInSlot(0) != null && playerItem == null)
|
||||
{
|
||||
/**stub method
|
||||
* Add the item that is in the slot to the player's inventory, and
|
||||
* then set the slot to null.
|
||||
*/
|
||||
player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0));
|
||||
tileEntity.setInventorySlotContents(0, null);
|
||||
tileEntity.setActive();
|
||||
}
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
//player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z);
|
||||
//PacketDispatcher.sendPacketToServer(tileEntity.getDescriptionPacket());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,83 +1,67 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEReagentConduit;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockReagentConduit extends BlockContainer
|
||||
{
|
||||
public BlockReagentConduit()
|
||||
{
|
||||
super(Material.cloth);
|
||||
setHardness(2.0F);
|
||||
{
|
||||
public BlockReagentConduit()
|
||||
{
|
||||
super(Material.cloth);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
this.setBlockName("blockReagentConduit");
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
this.setBlockName("blockReagentConduit");
|
||||
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:SimpleTransCircle");
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:SimpleTransCircle");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TEReagentConduit();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
// {
|
||||
// if (this.equals(ModBlocks.blockSpellParadigm))
|
||||
// {
|
||||
// par3List.add(new ItemStack(par1, 1, 0));
|
||||
// par3List.add(new ItemStack(par1, 1, 1));
|
||||
// par3List.add(new ItemStack(par1, 1, 2));
|
||||
// par3List.add(new ItemStack(par1, 1, 3));
|
||||
// } else
|
||||
// {
|
||||
// super.getSubBlocks(par1, par2CreativeTabs, par3List);
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are)
|
||||
{
|
||||
return super.onBlockActivated(world, x, y, z, player, side, what, these, are);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are)
|
||||
{
|
||||
return super.onBlockActivated(world, x, y, z, player, side, what, these, are);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,43 +1,42 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESchematicSaver;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEDemonPortal;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESchematicSaver;
|
||||
|
||||
public class BlockSchematicSaver extends BlockContainer
|
||||
{
|
||||
public BlockSchematicSaver()
|
||||
{
|
||||
super(Material.rock);
|
||||
public BlockSchematicSaver()
|
||||
{
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("schematicSaver");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2)
|
||||
{
|
||||
return new TESchematicSaver();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2)
|
||||
{
|
||||
return new TESchematicSaver();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are)
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TESchematicSaver tileEntity = (TESchematicSaver) world.getTileEntity(x, y, z);
|
||||
|
||||
tileEntity.rightClickBlock(player, side);
|
||||
|
||||
return false;
|
||||
if (world.isRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TESchematicSaver tileEntity = (TESchematicSaver) world.getTileEntity(x, y, z);
|
||||
|
||||
tileEntity.rightClickBlock(player, side);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -14,11 +17,8 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockSocket extends BlockContainer
|
||||
{
|
||||
|
@ -59,14 +59,8 @@ public class BlockSocket extends BlockContainer
|
|||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
|
||||
case 1:
|
||||
return topIcon;
|
||||
|
||||
//case 2: return sideIcon1;
|
||||
//case 3: return sideIcon1;
|
||||
//case 4: return sideIcon2;
|
||||
//case 5: return sideIcon2;
|
||||
default:
|
||||
return sideIcon2;
|
||||
}
|
||||
|
@ -83,7 +77,6 @@ public class BlockSocket extends BlockContainer
|
|||
}
|
||||
|
||||
ItemStack playerItem = player.getCurrentEquippedItem();
|
||||
|
||||
if (tileEntity.getStackInSlot(0) == null && playerItem != null)
|
||||
{
|
||||
if (playerItem.getItem() instanceof ArmourUpgrade)
|
||||
|
@ -95,18 +88,11 @@ public class BlockSocket extends BlockContainer
|
|||
}
|
||||
} else if (tileEntity.getStackInSlot(0) != null && playerItem == null)
|
||||
{
|
||||
/**stub method
|
||||
* Add the item that is in the slot to the player's inventory, and
|
||||
* then set the slot to null.
|
||||
*/
|
||||
player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0));
|
||||
tileEntity.setInventorySlotContents(0, null);
|
||||
tileEntity.setActive();
|
||||
}
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
//player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z);
|
||||
//PacketDispatcher.sendPacketToServer(tileEntity.getDescriptionPacket());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralContainer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -11,18 +11,17 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralContainer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockSpectralContainer extends BlockContainer
|
||||
{
|
||||
public BlockSpectralContainer()
|
||||
{
|
||||
super(Material.cloth);
|
||||
//setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("blockSpectralContainer");
|
||||
this.setBlockBounds(0,0,0,0,0,0);
|
||||
this.setBlockBounds(0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -54,22 +53,22 @@ public class BlockSpectralContainer extends BlockContainer
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReplaceable(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAir(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2)
|
||||
{
|
||||
return new TESpectralContainer();
|
||||
}
|
||||
@Override
|
||||
public boolean isReplaceable(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAir(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int var2)
|
||||
{
|
||||
return new TESpectralContainer();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
@ -9,25 +9,25 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class BlockSpellEffect extends BlockOrientable
|
||||
public class BlockSpellEffect extends BlockOrientable
|
||||
{
|
||||
public BlockSpellEffect()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("blockSpellEffect");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockSpellEffect()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("blockSpellEffect");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TESpellEffectBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
|
@ -44,16 +44,16 @@ public class BlockSpellEffect extends BlockOrientable
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
if (this.equals(ModBlocks.blockSpellEffect))
|
||||
{
|
||||
for(int i=0; i<4; i++)
|
||||
{
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
} else
|
||||
{
|
||||
super.getSubBlocks(par1, par2CreativeTabs, par3List);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEnhancementBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
@ -9,27 +9,25 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEnhancementBlock;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class BlockSpellEnhancement extends BlockOrientable
|
||||
public class BlockSpellEnhancement extends BlockOrientable
|
||||
{
|
||||
public BlockSpellEnhancement()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("blockSpellEnhancement");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockSpellEnhancement()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("blockSpellEnhancement");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TESpellEnhancementBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
|
@ -46,16 +44,16 @@ public class BlockSpellEnhancement extends BlockOrientable
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
if (this.equals(ModBlocks.blockSpellEnhancement))
|
||||
{
|
||||
for(int i=0; i<15; i++)
|
||||
{
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
for (int i = 0; i < 15; i++)
|
||||
{
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
} else
|
||||
{
|
||||
super.getSubBlocks(par1, par2CreativeTabs, par3List);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
@ -9,55 +9,54 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellModifierBlock;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class BlockSpellModifier extends BlockOrientable
|
||||
public class BlockSpellModifier extends BlockOrientable
|
||||
{
|
||||
public BlockSpellModifier()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("blockSpellModifier");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockSpellModifier()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("blockSpellModifier");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TESpellModifierBlock();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
if (this.equals(ModBlocks.blockSpellModifier))
|
||||
{
|
||||
for(int i=0; i<4; i++)
|
||||
{
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
} else
|
||||
{
|
||||
super.getSubBlocks(par1, par2CreativeTabs, par3List);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,40 +1,38 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.items.ItemComplexSpellCrystal;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.items.ItemComplexSpellCrystal;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpellParadigmBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockSpellParadigm extends BlockOrientable
|
||||
import java.util.List;
|
||||
|
||||
public class BlockSpellParadigm extends BlockOrientable
|
||||
{
|
||||
public static final float minPos = (3f/16f);
|
||||
public static final float maxPos = (13f/16f);
|
||||
|
||||
public BlockSpellParadigm()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("blockSpellParadigm");
|
||||
}
|
||||
|
||||
@Override
|
||||
public static final float minPos = (3f / 16f);
|
||||
public static final float maxPos = (13f / 16f);
|
||||
|
||||
public BlockSpellParadigm()
|
||||
{
|
||||
super();
|
||||
this.setBlockName("blockSpellParadigm");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
{
|
||||
return new TESpellParadigmBlock();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
||||
|
@ -52,14 +50,14 @@ public class BlockSpellParadigm extends BlockOrientable
|
|||
super.getSubBlocks(par1, par2CreativeTabs, par3List);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are)
|
||||
{
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
|
||||
if(stack != null && stack.getItem() instanceof ItemComplexSpellCrystal)
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float what, float these, float are)
|
||||
{
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
|
||||
if (stack != null && stack.getItem() instanceof ItemComplexSpellCrystal)
|
||||
{
|
||||
if (stack.stackTagCompound == null)
|
||||
{
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
|
@ -71,26 +69,26 @@ public class BlockSpellParadigm extends BlockOrientable
|
|||
itemTag.setInteger("zCoord", z);
|
||||
itemTag.setInteger("dimensionId", world.provider.dimensionId);
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onBlockActivated(world, x, y, z, player, side, what, these, are);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return super.onBlockActivated(world, x, y, z, player, side, what, these, are);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.items.TelepositionFocus;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.BlockMobSpawner;
|
||||
|
@ -16,11 +19,8 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.items.TelepositionFocus;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockTeleposer extends BlockContainer
|
||||
{
|
||||
|
@ -40,7 +40,6 @@ public class BlockTeleposer extends BlockContainer
|
|||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("bloodTeleposer");
|
||||
//func_111022_d("AlchemicalWizardry:blocks");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -61,14 +60,8 @@ public class BlockTeleposer extends BlockContainer
|
|||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
|
||||
case 1:
|
||||
return topIcon;
|
||||
|
||||
//case 2: return sideIcon1;
|
||||
//case 3: return sideIcon1;
|
||||
//case 4: return sideIcon2;
|
||||
//case 5: return sideIcon2;
|
||||
default:
|
||||
return sideIcon2;
|
||||
}
|
||||
|
@ -97,13 +90,7 @@ public class BlockTeleposer extends BlockContainer
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
player.openGui(AlchemicalWizardry.instance, 1, world, x, y, z);
|
||||
// this.swapBlocks(world, x, y+1, z, x, y+2, z);
|
||||
//
|
||||
// world.markBlockForUpdate(x, y, z);
|
||||
//player.openGui(AlchemicalWizardry.instance, 0, world, x, y, z);
|
||||
//PacketDispatcher.sendPacketToServer(tileEntity.getDescriptionPacket());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -216,11 +203,6 @@ public class BlockTeleposer extends BlockContainer
|
|||
}
|
||||
|
||||
//TILES CLEARED
|
||||
// worldF.destroyBlock(xf, yf, zf, false);
|
||||
// worldI.destroyBlock(xi, yi, zi, false);
|
||||
// worldI.setBlockToAir(xi, yi, zi);
|
||||
// worldF.setBlockToAir(xf, yf, zf);
|
||||
|
||||
worldF.setBlock(xf, yf, zf, initialBlock, metaI, 3);
|
||||
|
||||
if (tileEntityI != null)
|
||||
|
@ -230,12 +212,6 @@ public class BlockTeleposer extends BlockContainer
|
|||
newTileEntityI.xCoord = xf;
|
||||
newTileEntityI.yCoord = yf;
|
||||
newTileEntityI.zCoord = zf;
|
||||
|
||||
// TileEntity tile = worldI.getTileEntity(xf, yf, zf);
|
||||
// if(tile instanceof TileMultipart)
|
||||
// {
|
||||
// TileMultipart.createFromNBT(nbttag1);
|
||||
// }
|
||||
}
|
||||
|
||||
worldI.setBlock(xi, yi, zi, finalBlock, metaF, 3);
|
||||
|
@ -247,12 +223,6 @@ public class BlockTeleposer extends BlockContainer
|
|||
newTileEntityF.xCoord = xi;
|
||||
newTileEntityF.yCoord = yi;
|
||||
newTileEntityF.zCoord = zi;
|
||||
|
||||
TileEntity tile = worldI.getTileEntity(xi, yi, zi);
|
||||
// if(tile instanceof TileMultipart)
|
||||
// {
|
||||
// TileMultipart.createFromNBT(nbttag2);
|
||||
// }
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
@ -17,10 +18,9 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockWritingTable extends BlockContainer
|
||||
{
|
||||
|
@ -60,14 +60,8 @@ public class BlockWritingTable extends BlockContainer
|
|||
{
|
||||
case 0:
|
||||
return bottomIcon;
|
||||
|
||||
case 1:
|
||||
return topIcon;
|
||||
|
||||
//case 2: return sideIcon1;
|
||||
//case 3: return sideIcon1;
|
||||
//case 4: return sideIcon2;
|
||||
//case 5: return sideIcon2;
|
||||
default:
|
||||
return sideIcon2;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -11,10 +11,8 @@ import net.minecraft.creativetab.CreativeTabs;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BloodRune extends Block
|
||||
{
|
||||
|
@ -59,9 +57,9 @@ public class BloodRune extends Block
|
|||
|
||||
case 3: //Orb Capacity rune
|
||||
return 7;
|
||||
|
||||
|
||||
case 4: //Better Capacity rune
|
||||
return 8;
|
||||
return 8;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -104,9 +102,9 @@ public class BloodRune extends Block
|
|||
|
||||
case 3:
|
||||
return this.orbCapacityRuneIcon;
|
||||
|
||||
|
||||
case 4:
|
||||
return this.betterCapacityRuneIcon;
|
||||
return this.betterCapacityRuneIcon;
|
||||
|
||||
default:
|
||||
return blockIcon;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class BloodStoneBrick extends Block
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class EfficiencyRune extends BloodRune
|
||||
{
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class EmptySocket extends Block
|
||||
{
|
||||
|
@ -16,7 +16,6 @@ public class EmptySocket extends Block
|
|||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("emptySocket");
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -10,12 +14,6 @@ import net.minecraft.init.Blocks;
|
|||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.PacketHandler;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ImperfectRitualStone extends Block
|
||||
{
|
||||
|
@ -26,7 +24,6 @@ public class ImperfectRitualStone extends Block
|
|||
setResistance(5.0F);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("imperfectRitualStone");
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -39,25 +36,19 @@ public class ImperfectRitualStone extends Block
|
|||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xOff, float yOff, float zOff)
|
||||
{
|
||||
//ItemStack ist = player.getItemInUse();
|
||||
//if (!world.isRemote)
|
||||
{
|
||||
Block block = world.getBlock(x, y + 1, z);
|
||||
|
||||
if (block == Blocks.water)
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode && !world.isRemote)
|
||||
if (!player.capabilities.isCreativeMode && !world.isRemote)
|
||||
{
|
||||
EnergyItems.drainPlayerNetwork(player, 5000);
|
||||
EnergyItems.drainPlayerNetwork(player, 5000);
|
||||
}
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z));
|
||||
// if (!player.capabilities.isCreativeMode)
|
||||
// {
|
||||
// PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(player.getEntityName(), -5000, 0));
|
||||
// }
|
||||
}
|
||||
|
||||
world.getWorldInfo().setRaining(true);
|
||||
|
@ -73,19 +64,13 @@ public class ImperfectRitualStone extends Block
|
|||
return true;
|
||||
} else if (block == Blocks.coal_block)
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode && !world.isRemote)
|
||||
if (!player.capabilities.isCreativeMode && !world.isRemote)
|
||||
{
|
||||
EnergyItems.drainPlayerNetwork(player, 5000);
|
||||
EnergyItems.drainPlayerNetwork(player, 5000);
|
||||
}
|
||||
|
||||
//EntityFallenAngel zomb = new EntityFallenAngel(world);
|
||||
EntityZombie zomb = new EntityZombie(world);
|
||||
zomb.setPosition(x + 0.5, y + 2, z + 0.5);
|
||||
// zomb.setCurrentItemOrArmor(4, new ItemStack(Item.helmetIron.itemID,1,0));
|
||||
// zomb.setCurrentItemOrArmor(3, new ItemStack(Item.plateIron.itemID,1,0));
|
||||
// zomb.setCurrentItemOrArmor(2, new ItemStack(Item.legsIron.itemID,1,0));
|
||||
// zomb.setCurrentItemOrArmor(1, new ItemStack(Item.bootsIron.itemID,1,0));
|
||||
//zomb.setCurrentItemOrArmor(0, new ItemStack(AlchemicalWizardry.energySword.itemID,1,0));
|
||||
zomb.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2000));
|
||||
zomb.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 20000, 7));
|
||||
zomb.addPotionEffect(new PotionEffect(Potion.resistance.id, 20000, 3));
|
||||
|
@ -94,44 +79,31 @@ public class ImperfectRitualStone extends Block
|
|||
{
|
||||
world.spawnEntityInWorld(zomb);
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z));
|
||||
// if (!player.capabilities.isCreativeMode)
|
||||
// {
|
||||
// PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(player.getEntityName(), -5000, 0));
|
||||
// }
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (block== Blocks.lapis_block)
|
||||
} else if (block == Blocks.lapis_block)
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode && !world.isRemote)
|
||||
{
|
||||
EnergyItems.drainPlayerNetwork(player, 5000);
|
||||
EnergyItems.drainPlayerNetwork(player, 5000);
|
||||
}
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z));
|
||||
world.setWorldTime((world.getWorldTime() / 24000) * 24000 + 13800);
|
||||
// if (!player.capabilities.isCreativeMode)
|
||||
// {
|
||||
// PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(player.getEntityName(), -5000, 0));
|
||||
// }
|
||||
}
|
||||
} else if (block == Blocks.bedrock)
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode && !world.isRemote)
|
||||
if (!player.capabilities.isCreativeMode && !world.isRemote)
|
||||
{
|
||||
EnergyItems.drainPlayerNetwork(player, 5000);
|
||||
EnergyItems.drainPlayerNetwork(player, 5000);
|
||||
}
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
world.addWeatherEffect(new EntityLightningBolt(world, x, y + 2, z));
|
||||
//world.setWorldTime((world.getWorldTime()/24000)*24000+13800);
|
||||
// if (!player.capabilities.isCreativeMode)
|
||||
// {
|
||||
// PacketDispatcher.sendPacketToServer(PacketHandler.getPacket(player.getEntityName(), -5000, 0));
|
||||
// }
|
||||
}
|
||||
|
||||
player.addPotionEffect(new PotionEffect(Potion.resistance.id, 60 * 20, 1));
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class LargeBloodStoneBrick extends Block
|
||||
{
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class LifeEssenceBlock extends BlockFluidClassic
|
||||
{
|
||||
|
@ -16,8 +16,6 @@ public class LifeEssenceBlock extends BlockFluidClassic
|
|||
{
|
||||
super(AlchemicalWizardry.lifeEssenceFluid, Material.water);
|
||||
AlchemicalWizardry.lifeEssenceFluid.setBlock(this);
|
||||
|
||||
//setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setBlockName("lifeEssenceFluidBlock");
|
||||
}
|
||||
|
||||
|
@ -35,7 +33,6 @@ public class LifeEssenceBlock extends BlockFluidClassic
|
|||
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:lifeEssenceStill");
|
||||
AlchemicalWizardry.lifeEssenceFluid.setFlowingIcon(blockIcon);
|
||||
AlchemicalWizardry.lifeEssenceFluid.setStillIcon(blockIcon);
|
||||
//this.getFluid().setIcons(blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.IRitualStone;
|
||||
import WayofTime.alchemicalWizardry.common.items.ScribeTool;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -8,11 +13,6 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.IRitualStone;
|
||||
import WayofTime.alchemicalWizardry.common.items.ScribeTool;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class RitualStone extends Block implements IRitualStone
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class RuneOfSacrifice extends BloodRune
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class RuneOfSelfSacrifice extends BloodRune
|
||||
{
|
||||
|
|
|
@ -1,22 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Facing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class SpectralBlock extends BlockContainer
|
||||
{
|
||||
|
@ -26,13 +25,6 @@ public class SpectralBlock extends BlockContainer
|
|||
this.setBlockName("spectralBlock");
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public int tickRate(World par1World)
|
||||
// {
|
||||
// return 10;
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
|
@ -43,7 +35,7 @@ public class SpectralBlock extends BlockContainer
|
|||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
Block d;
|
||||
Block d;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -52,7 +44,7 @@ public class SpectralBlock extends BlockContainer
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_)
|
||||
{
|
||||
|
@ -83,7 +75,6 @@ public class SpectralBlock extends BlockContainer
|
|||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
|
||||
{
|
||||
//TEAltar tileEntity = (TEAltar)world.getBlockTileEntity(x, y, z);
|
||||
if (player.isSneaking())
|
||||
{
|
||||
return false;
|
||||
|
@ -95,7 +86,7 @@ public class SpectralBlock extends BlockContainer
|
|||
{
|
||||
if (playerItem.getItem() instanceof ItemBlock)
|
||||
{
|
||||
world.setBlock(x, y, z, ((ItemBlock)(playerItem.getItem())).field_150939_a, playerItem.getItemDamage(), 3);
|
||||
world.setBlock(x, y, z, ((ItemBlock) (playerItem.getItem())).field_150939_a, playerItem.getItemDamage(), 3);
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
|
@ -112,9 +103,9 @@ public class SpectralBlock extends BlockContainer
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
|
||||
{
|
||||
return new TESpectralBlock();
|
||||
}
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
|
||||
{
|
||||
return new TESpectralBlock();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.block;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class SpeedRune extends BloodRune
|
||||
{
|
||||
|
|
|
@ -57,10 +57,10 @@ public class AltarUpgradeComponent
|
|||
{
|
||||
orbCapacitiveUpgrades++;
|
||||
}
|
||||
|
||||
|
||||
public void addBetterCapacitiveUpgrade()
|
||||
{
|
||||
betterCapacitiveUpgrades++;
|
||||
betterCapacitiveUpgrades++;
|
||||
}
|
||||
|
||||
public int getSpeedUpgrades()
|
||||
|
@ -97,9 +97,9 @@ public class AltarUpgradeComponent
|
|||
{
|
||||
return this.orbCapacitiveUpgrades;
|
||||
}
|
||||
|
||||
|
||||
public int getBetterCapacitiveUpgrades()
|
||||
{
|
||||
return this.betterCapacitiveUpgrades;
|
||||
return this.betterCapacitiveUpgrades;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.block.BloodRune;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.block.BloodRune;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class UpgradedAltars
|
||||
{
|
||||
|
@ -189,10 +188,10 @@ public class UpgradedAltars
|
|||
case 7:
|
||||
upgrades.addorbCapacitiveUpgrade();
|
||||
break;
|
||||
|
||||
|
||||
case 8:
|
||||
upgrades.addBetterCapacitiveUpgrade();
|
||||
break;
|
||||
upgrades.addBetterCapacitiveUpgrade();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,195 +1,195 @@
|
|||
package WayofTime.alchemicalWizardry.common.demonVillage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
|
||||
|
||||
public class BlockSet
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockSet
|
||||
{
|
||||
protected String blockid;
|
||||
protected int[] metadata;
|
||||
protected List<Int3> positions;
|
||||
|
||||
public BlockSet()
|
||||
{
|
||||
this(Blocks.stone);
|
||||
}
|
||||
|
||||
public BlockSet(String blockid)
|
||||
{
|
||||
this.blockid = blockid;
|
||||
this.metadata = new int[4];
|
||||
positions = new ArrayList();
|
||||
}
|
||||
|
||||
public BlockSet(Block block)
|
||||
{
|
||||
this(BlockSet.getPairedIdForBlock(block));
|
||||
}
|
||||
|
||||
public BlockSet(Block block, int meta)
|
||||
{
|
||||
this(block);
|
||||
for(int i=0; i<metadata.length; i++)
|
||||
{
|
||||
metadata[i] = meta;
|
||||
}
|
||||
if(block instanceof BlockStairs)
|
||||
{
|
||||
int[] northSet = new int[]{2,3,0,1};
|
||||
int[] eastSet = new int[]{1,0,2,3};
|
||||
int[] southSet = new int[]{3,2,1,0};
|
||||
int[] westSet = new int[]{0,1,3,2};
|
||||
int[] northUpSet = new int[]{6,7,4,5};
|
||||
int[] eastUpSet = new int[]{5,4,6,7};
|
||||
int[] southUpSet = new int[]{7,6,5,4};
|
||||
int[] westUpSet = new int[]{4,5,7,6};
|
||||
|
||||
switch(meta)
|
||||
{
|
||||
case 0:
|
||||
metadata = westSet;
|
||||
break;
|
||||
case 1:
|
||||
metadata = eastSet;
|
||||
break;
|
||||
case 2:
|
||||
metadata = northSet;
|
||||
break;
|
||||
case 3:
|
||||
metadata = southSet;
|
||||
break;
|
||||
case 4:
|
||||
metadata = westUpSet;
|
||||
break;
|
||||
case 5:
|
||||
metadata = eastUpSet;
|
||||
break;
|
||||
case 6:
|
||||
metadata = northUpSet;
|
||||
break;
|
||||
case 7:
|
||||
metadata = southUpSet;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<Int3> getPositions()
|
||||
{
|
||||
return positions;
|
||||
}
|
||||
|
||||
public void addPositionToBlock(int xOffset, int yOffset, int zOffset)
|
||||
{
|
||||
positions.add(new Int3(xOffset, yOffset, zOffset));
|
||||
}
|
||||
|
||||
public Block getBlock()
|
||||
{
|
||||
return this.getBlockForString(blockid);
|
||||
}
|
||||
|
||||
public static String getPairedIdForBlock(Block block)
|
||||
{
|
||||
UniqueIdentifier un = GameRegistry.findUniqueIdentifierFor(block);
|
||||
String name = "";
|
||||
|
||||
if(un != null)
|
||||
{
|
||||
name = un.modId + ":" + un.name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public static Block getBlockForString(String str)
|
||||
{
|
||||
String[] parts = str.split(":");
|
||||
String modId = parts[0];
|
||||
String name = parts[1];
|
||||
return GameRegistry.findBlock(modId, name);
|
||||
}
|
||||
|
||||
public int getMetaForDirection(ForgeDirection dir)
|
||||
{
|
||||
if(metadata.length < 4)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch(dir)
|
||||
{
|
||||
case NORTH:
|
||||
return metadata[0];
|
||||
case SOUTH:
|
||||
return metadata[1];
|
||||
case WEST:
|
||||
return metadata[2];
|
||||
case EAST:
|
||||
return metadata[3];
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void buildAtIndex(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir, int index)
|
||||
{
|
||||
Block block = this.getBlock();
|
||||
if(index >= positions.size() || block == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Int3 position = positions.get(index);
|
||||
int xOff = position.xCoord;
|
||||
int yOff = position.yCoord;
|
||||
int zOff = position.zCoord;
|
||||
int meta = this.getMetaForDirection(dir);
|
||||
|
||||
switch(dir)
|
||||
{
|
||||
case NORTH:
|
||||
break;
|
||||
case SOUTH:
|
||||
xOff *= -1;
|
||||
zOff *= -1;
|
||||
break;
|
||||
case WEST:
|
||||
int temp = zOff;
|
||||
zOff = xOff * -1;
|
||||
xOff = temp;
|
||||
break;
|
||||
case EAST:
|
||||
int temp2 = zOff * -1;
|
||||
zOff = xOff;
|
||||
xOff = temp2;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
world.setBlock(xCoord + xOff, yCoord + yOff, zCoord + zOff, block, meta, 3);
|
||||
}
|
||||
|
||||
public void buildAll(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
|
||||
{
|
||||
for(int i=0; i<positions.size(); i++)
|
||||
{
|
||||
this.buildAtIndex(world, xCoord, yCoord, zCoord, dir, i);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isContained(Block block, int defaultMeta)
|
||||
{
|
||||
Block thisBlock = this.getBlock();
|
||||
return thisBlock == null ? false : thisBlock.equals(block) && this.metadata[0] == defaultMeta;
|
||||
}
|
||||
protected String blockid;
|
||||
protected int[] metadata;
|
||||
protected List<Int3> positions;
|
||||
|
||||
public BlockSet()
|
||||
{
|
||||
this(Blocks.stone);
|
||||
}
|
||||
|
||||
public BlockSet(String blockid)
|
||||
{
|
||||
this.blockid = blockid;
|
||||
this.metadata = new int[4];
|
||||
positions = new ArrayList();
|
||||
}
|
||||
|
||||
public BlockSet(Block block)
|
||||
{
|
||||
this(BlockSet.getPairedIdForBlock(block));
|
||||
}
|
||||
|
||||
public BlockSet(Block block, int meta)
|
||||
{
|
||||
this(block);
|
||||
for (int i = 0; i < metadata.length; i++)
|
||||
{
|
||||
metadata[i] = meta;
|
||||
}
|
||||
if (block instanceof BlockStairs)
|
||||
{
|
||||
int[] northSet = new int[]{2, 3, 0, 1};
|
||||
int[] eastSet = new int[]{1, 0, 2, 3};
|
||||
int[] southSet = new int[]{3, 2, 1, 0};
|
||||
int[] westSet = new int[]{0, 1, 3, 2};
|
||||
int[] northUpSet = new int[]{6, 7, 4, 5};
|
||||
int[] eastUpSet = new int[]{5, 4, 6, 7};
|
||||
int[] southUpSet = new int[]{7, 6, 5, 4};
|
||||
int[] westUpSet = new int[]{4, 5, 7, 6};
|
||||
|
||||
switch (meta)
|
||||
{
|
||||
case 0:
|
||||
metadata = westSet;
|
||||
break;
|
||||
case 1:
|
||||
metadata = eastSet;
|
||||
break;
|
||||
case 2:
|
||||
metadata = northSet;
|
||||
break;
|
||||
case 3:
|
||||
metadata = southSet;
|
||||
break;
|
||||
case 4:
|
||||
metadata = westUpSet;
|
||||
break;
|
||||
case 5:
|
||||
metadata = eastUpSet;
|
||||
break;
|
||||
case 6:
|
||||
metadata = northUpSet;
|
||||
break;
|
||||
case 7:
|
||||
metadata = southUpSet;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<Int3> getPositions()
|
||||
{
|
||||
return positions;
|
||||
}
|
||||
|
||||
public void addPositionToBlock(int xOffset, int yOffset, int zOffset)
|
||||
{
|
||||
positions.add(new Int3(xOffset, yOffset, zOffset));
|
||||
}
|
||||
|
||||
public Block getBlock()
|
||||
{
|
||||
return this.getBlockForString(blockid);
|
||||
}
|
||||
|
||||
public static String getPairedIdForBlock(Block block)
|
||||
{
|
||||
UniqueIdentifier un = GameRegistry.findUniqueIdentifierFor(block);
|
||||
String name = "";
|
||||
|
||||
if (un != null)
|
||||
{
|
||||
name = un.modId + ":" + un.name;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public static Block getBlockForString(String str)
|
||||
{
|
||||
String[] parts = str.split(":");
|
||||
String modId = parts[0];
|
||||
String name = parts[1];
|
||||
return GameRegistry.findBlock(modId, name);
|
||||
}
|
||||
|
||||
public int getMetaForDirection(ForgeDirection dir)
|
||||
{
|
||||
if (metadata.length < 4)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (dir)
|
||||
{
|
||||
case NORTH:
|
||||
return metadata[0];
|
||||
case SOUTH:
|
||||
return metadata[1];
|
||||
case WEST:
|
||||
return metadata[2];
|
||||
case EAST:
|
||||
return metadata[3];
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void buildAtIndex(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir, int index)
|
||||
{
|
||||
Block block = this.getBlock();
|
||||
if (index >= positions.size() || block == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Int3 position = positions.get(index);
|
||||
int xOff = position.xCoord;
|
||||
int yOff = position.yCoord;
|
||||
int zOff = position.zCoord;
|
||||
int meta = this.getMetaForDirection(dir);
|
||||
|
||||
switch (dir)
|
||||
{
|
||||
case NORTH:
|
||||
break;
|
||||
case SOUTH:
|
||||
xOff *= -1;
|
||||
zOff *= -1;
|
||||
break;
|
||||
case WEST:
|
||||
int temp = zOff;
|
||||
zOff = xOff * -1;
|
||||
xOff = temp;
|
||||
break;
|
||||
case EAST:
|
||||
int temp2 = zOff * -1;
|
||||
zOff = xOff;
|
||||
xOff = temp2;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
world.setBlock(xCoord + xOff, yCoord + yOff, zCoord + zOff, block, meta, 3);
|
||||
}
|
||||
|
||||
public void buildAll(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
|
||||
{
|
||||
for (int i = 0; i < positions.size(); i++)
|
||||
{
|
||||
this.buildAtIndex(world, xCoord, yCoord, zCoord, dir, i);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isContained(Block block, int defaultMeta)
|
||||
{
|
||||
Block thisBlock = this.getBlock();
|
||||
return thisBlock == null ? false : thisBlock.equals(block) && this.metadata[0] == defaultMeta;
|
||||
}
|
||||
}
|
|
@ -1,183 +1,180 @@
|
|||
package WayofTime.alchemicalWizardry.common.demonVillage;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
|
||||
public class BuildingSchematic
|
||||
public class BuildingSchematic
|
||||
{
|
||||
public String name;
|
||||
public int doorX;
|
||||
public int doorZ;
|
||||
public int doorY;
|
||||
public int buildingTier;
|
||||
public int buildingType;
|
||||
public List<BlockSet> blockList;
|
||||
|
||||
public BuildingSchematic()
|
||||
{
|
||||
this("");
|
||||
}
|
||||
|
||||
public BuildingSchematic(String name)
|
||||
{
|
||||
this.name = name;
|
||||
blockList = new ArrayList();
|
||||
this.doorX = 0;
|
||||
this.doorZ = 0;
|
||||
this.doorY = 0;
|
||||
this.buildingTier = 0;
|
||||
this.buildingType = DemonBuilding.BUILDING_HOUSE;
|
||||
}
|
||||
|
||||
public void addBlockWithMeta(Block block, int meta, int xOffset, int yOffset, int zOffset)
|
||||
{
|
||||
for(BlockSet set : blockList)
|
||||
{
|
||||
if(set.isContained(block, meta))
|
||||
{
|
||||
set.addPositionToBlock(xOffset, yOffset, zOffset);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
BlockSet set = new BlockSet(block, meta);
|
||||
set.addPositionToBlock(xOffset, yOffset, zOffset);
|
||||
blockList.add(set);
|
||||
}
|
||||
|
||||
public void buildAll(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
|
||||
{
|
||||
for(BlockSet set : blockList)
|
||||
{
|
||||
set.buildAll(world, xCoord, yCoord, zCoord, dir);
|
||||
}
|
||||
}
|
||||
|
||||
public GridSpaceHolder createGSH()
|
||||
{
|
||||
GridSpaceHolder holder = new GridSpaceHolder();
|
||||
|
||||
for(BlockSet set : blockList)
|
||||
{
|
||||
for(Int3 coords : set.getPositions())
|
||||
{
|
||||
int gridX = (int)((coords.xCoord+2*Math.signum(coords.xCoord))/5);
|
||||
int gridZ = (int)((coords.zCoord+2*Math.signum(coords.zCoord))/5);
|
||||
|
||||
holder.setGridSpace(gridX, gridZ, new GridSpace(GridSpace.HOUSE,0));
|
||||
}
|
||||
}
|
||||
|
||||
return holder;
|
||||
}
|
||||
|
||||
public Int3 getGridSpotOfDoor()
|
||||
{
|
||||
int gridX = (int)((doorX+2*Math.signum(doorX))/5);
|
||||
int gridZ = (int)((doorZ+2*Math.signum(doorZ))/5);
|
||||
|
||||
return new Int3(gridX, doorY, gridZ);
|
||||
}
|
||||
|
||||
public List<Int3> getGriddedPositions(ForgeDirection dir)
|
||||
{
|
||||
List<Int3> positionList = new ArrayList();
|
||||
|
||||
for(BlockSet blockSet : blockList)
|
||||
{
|
||||
for(Int3 pos : blockSet.getPositions())
|
||||
{
|
||||
int xOff = pos.xCoord;
|
||||
int zOff = pos.zCoord;
|
||||
|
||||
switch(dir)
|
||||
{
|
||||
case SOUTH:
|
||||
xOff *= -1;
|
||||
zOff *= -1;
|
||||
break;
|
||||
case WEST:
|
||||
int temp = zOff;
|
||||
zOff = xOff * -1;
|
||||
xOff = temp;
|
||||
break;
|
||||
case EAST:
|
||||
int temp2 = zOff * -1;
|
||||
zOff = xOff;
|
||||
xOff = temp2;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
Int3 nextPos = new Int3(xOff, 0, zOff);
|
||||
if(!positionList.contains(nextPos))
|
||||
{
|
||||
positionList.add(nextPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return positionList;
|
||||
}
|
||||
|
||||
public void destroyAllInField(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
|
||||
{
|
||||
GridSpaceHolder grid = this.createGSH(); //GridSpaceHolder is not aware of the buildings - need to use the schematic
|
||||
|
||||
List<Int3> positionList = getGriddedPositions(dir);
|
||||
|
||||
for(int i=this.getMinY(); i<=this.getMaxY(); i++)
|
||||
{
|
||||
for(Int3 pos : positionList)
|
||||
{
|
||||
Block block = world.getBlock(xCoord + pos.xCoord, yCoord + i, zCoord + pos.zCoord);
|
||||
if(block != ModBlocks.blockDemonPortal)
|
||||
{
|
||||
world.setBlockToAir(xCoord + pos.xCoord, yCoord + i, zCoord + pos.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
//grid.destroyAllInGridSpaces(world, xCoord, yCoord + i, zCoord, dir); //Deprecated method
|
||||
}
|
||||
}
|
||||
|
||||
public int getMinY()
|
||||
{
|
||||
int min = 0;
|
||||
for(BlockSet set : blockList)
|
||||
{
|
||||
for(Int3 pos : set.getPositions())
|
||||
{
|
||||
if(pos.yCoord < min)
|
||||
{
|
||||
min = pos.yCoord;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return min;
|
||||
}
|
||||
|
||||
public int getMaxY()
|
||||
{
|
||||
int max = 0;
|
||||
for(BlockSet set : blockList)
|
||||
{
|
||||
for(Int3 pos : set.getPositions())
|
||||
{
|
||||
if(pos.yCoord > max)
|
||||
{
|
||||
max = pos.yCoord;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return max;
|
||||
}
|
||||
public String name;
|
||||
public int doorX;
|
||||
public int doorZ;
|
||||
public int doorY;
|
||||
public int buildingTier;
|
||||
public int buildingType;
|
||||
public List<BlockSet> blockList;
|
||||
|
||||
public BuildingSchematic()
|
||||
{
|
||||
this("");
|
||||
}
|
||||
|
||||
public BuildingSchematic(String name)
|
||||
{
|
||||
this.name = name;
|
||||
blockList = new ArrayList();
|
||||
this.doorX = 0;
|
||||
this.doorZ = 0;
|
||||
this.doorY = 0;
|
||||
this.buildingTier = 0;
|
||||
this.buildingType = DemonBuilding.BUILDING_HOUSE;
|
||||
}
|
||||
|
||||
public void addBlockWithMeta(Block block, int meta, int xOffset, int yOffset, int zOffset)
|
||||
{
|
||||
for (BlockSet set : blockList)
|
||||
{
|
||||
if (set.isContained(block, meta))
|
||||
{
|
||||
set.addPositionToBlock(xOffset, yOffset, zOffset);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
BlockSet set = new BlockSet(block, meta);
|
||||
set.addPositionToBlock(xOffset, yOffset, zOffset);
|
||||
blockList.add(set);
|
||||
}
|
||||
|
||||
public void buildAll(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
|
||||
{
|
||||
for (BlockSet set : blockList)
|
||||
{
|
||||
set.buildAll(world, xCoord, yCoord, zCoord, dir);
|
||||
}
|
||||
}
|
||||
|
||||
public GridSpaceHolder createGSH()
|
||||
{
|
||||
GridSpaceHolder holder = new GridSpaceHolder();
|
||||
|
||||
for (BlockSet set : blockList)
|
||||
{
|
||||
for (Int3 coords : set.getPositions())
|
||||
{
|
||||
int gridX = (int) ((coords.xCoord + 2 * Math.signum(coords.xCoord)) / 5);
|
||||
int gridZ = (int) ((coords.zCoord + 2 * Math.signum(coords.zCoord)) / 5);
|
||||
|
||||
holder.setGridSpace(gridX, gridZ, new GridSpace(GridSpace.HOUSE, 0));
|
||||
}
|
||||
}
|
||||
|
||||
return holder;
|
||||
}
|
||||
|
||||
public Int3 getGridSpotOfDoor()
|
||||
{
|
||||
int gridX = (int) ((doorX + 2 * Math.signum(doorX)) / 5);
|
||||
int gridZ = (int) ((doorZ + 2 * Math.signum(doorZ)) / 5);
|
||||
|
||||
return new Int3(gridX, doorY, gridZ);
|
||||
}
|
||||
|
||||
public List<Int3> getGriddedPositions(ForgeDirection dir)
|
||||
{
|
||||
List<Int3> positionList = new ArrayList();
|
||||
|
||||
for (BlockSet blockSet : blockList)
|
||||
{
|
||||
for (Int3 pos : blockSet.getPositions())
|
||||
{
|
||||
int xOff = pos.xCoord;
|
||||
int zOff = pos.zCoord;
|
||||
|
||||
switch (dir)
|
||||
{
|
||||
case SOUTH:
|
||||
xOff *= -1;
|
||||
zOff *= -1;
|
||||
break;
|
||||
case WEST:
|
||||
int temp = zOff;
|
||||
zOff = xOff * -1;
|
||||
xOff = temp;
|
||||
break;
|
||||
case EAST:
|
||||
int temp2 = zOff * -1;
|
||||
zOff = xOff;
|
||||
xOff = temp2;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
Int3 nextPos = new Int3(xOff, 0, zOff);
|
||||
if (!positionList.contains(nextPos))
|
||||
{
|
||||
positionList.add(nextPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return positionList;
|
||||
}
|
||||
|
||||
public void destroyAllInField(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
|
||||
{
|
||||
GridSpaceHolder grid = this.createGSH(); //GridSpaceHolder is not aware of the buildings - need to use the schematic
|
||||
|
||||
List<Int3> positionList = getGriddedPositions(dir);
|
||||
|
||||
for (int i = this.getMinY(); i <= this.getMaxY(); i++)
|
||||
{
|
||||
for (Int3 pos : positionList)
|
||||
{
|
||||
Block block = world.getBlock(xCoord + pos.xCoord, yCoord + i, zCoord + pos.zCoord);
|
||||
if (block != ModBlocks.blockDemonPortal)
|
||||
{
|
||||
world.setBlockToAir(xCoord + pos.xCoord, yCoord + i, zCoord + pos.zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getMinY()
|
||||
{
|
||||
int min = 0;
|
||||
for (BlockSet set : blockList)
|
||||
{
|
||||
for (Int3 pos : set.getPositions())
|
||||
{
|
||||
if (pos.yCoord < min)
|
||||
{
|
||||
min = pos.yCoord;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return min;
|
||||
}
|
||||
|
||||
public int getMaxY()
|
||||
{
|
||||
int max = 0;
|
||||
for (BlockSet set : blockList)
|
||||
{
|
||||
for (Int3 pos : set.getPositions())
|
||||
{
|
||||
if (pos.yCoord > max)
|
||||
{
|
||||
max = pos.yCoord;
|
||||
}
|
||||
}
|
||||
}
|
||||
return max;
|
||||
}
|
||||
}
|
|
@ -1,120 +1,120 @@
|
|||
package WayofTime.alchemicalWizardry.common.demonVillage;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
|
||||
public class DemonBuilding
|
||||
public class DemonBuilding
|
||||
{
|
||||
public static final int BUILDING_HOUSE = 0;
|
||||
public static final int BUILDING_PORTAL = 1;
|
||||
|
||||
public BuildingSchematic schematic;
|
||||
public GridSpaceHolder area;
|
||||
public int buildingTier;
|
||||
public int buildingType;
|
||||
public Int3 doorGridSpace;
|
||||
|
||||
public DemonBuilding(BuildingSchematic schematic)
|
||||
{
|
||||
this.schematic = schematic;
|
||||
this.buildingType = schematic.buildingType;
|
||||
this.buildingTier = schematic.buildingTier;
|
||||
this.area = this.createGSHForSchematic(schematic);
|
||||
this.doorGridSpace = schematic.getGridSpotOfDoor();
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return schematic.name;
|
||||
}
|
||||
|
||||
public boolean isValid(GridSpaceHolder master, int gridX, int gridZ, ForgeDirection dir)
|
||||
{
|
||||
return area.doesContainAll(master, gridX, gridZ, dir);
|
||||
}
|
||||
|
||||
public void buildAll(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
|
||||
{
|
||||
schematic.buildAll(world, xCoord, yCoord, zCoord, dir);
|
||||
}
|
||||
|
||||
public void setAllGridSpaces(int xInit, int zInit, int yLevel, ForgeDirection dir, int type, GridSpaceHolder master)
|
||||
{
|
||||
area.setAllGridSpaces(xInit, zInit, yLevel, dir, type, master);
|
||||
}
|
||||
|
||||
public GridSpaceHolder createGSHForSchematic(BuildingSchematic scheme)
|
||||
{
|
||||
switch(this.buildingType)
|
||||
{
|
||||
case DemonBuilding.BUILDING_HOUSE:
|
||||
return scheme.createGSH();
|
||||
case DemonBuilding.BUILDING_PORTAL:
|
||||
|
||||
}
|
||||
return scheme.createGSH();
|
||||
}
|
||||
|
||||
public Int3 getDoorSpace(ForgeDirection dir)
|
||||
{
|
||||
int x = 0;
|
||||
int z = 0;
|
||||
switch(dir)
|
||||
{
|
||||
case SOUTH:
|
||||
x = -doorGridSpace.xCoord;
|
||||
z = -doorGridSpace.zCoord;
|
||||
break;
|
||||
case WEST:
|
||||
x = doorGridSpace.zCoord;
|
||||
z = -doorGridSpace.xCoord;
|
||||
break;
|
||||
case EAST:
|
||||
x = -doorGridSpace.zCoord;
|
||||
z = doorGridSpace.xCoord;
|
||||
break;
|
||||
default:
|
||||
x = doorGridSpace.xCoord;
|
||||
z = doorGridSpace.zCoord;
|
||||
break;
|
||||
}
|
||||
|
||||
return new Int3(x, doorGridSpace.yCoord, z);
|
||||
}
|
||||
|
||||
public Int3 getGridOffsetFromRoad(ForgeDirection sideOfRoad, int yLevel)
|
||||
{
|
||||
Int3 doorSpace = this.getDoorSpace(sideOfRoad);
|
||||
int x = doorSpace.xCoord;
|
||||
int z = doorSpace.zCoord;
|
||||
|
||||
switch(sideOfRoad)
|
||||
{
|
||||
case SOUTH:
|
||||
z++;
|
||||
break;
|
||||
case EAST:
|
||||
x++;
|
||||
break;
|
||||
case WEST:
|
||||
x--;
|
||||
break;
|
||||
default:
|
||||
z--;
|
||||
break;
|
||||
}
|
||||
|
||||
return new Int3(x, yLevel, z);
|
||||
}
|
||||
|
||||
public void destroyAllInField(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
|
||||
{
|
||||
schematic.destroyAllInField(world, xCoord, yCoord, zCoord, dir);
|
||||
}
|
||||
|
||||
public int getNumberOfGridSpaces()
|
||||
{
|
||||
return area.getNumberOfGridSpaces();
|
||||
}
|
||||
public static final int BUILDING_HOUSE = 0;
|
||||
public static final int BUILDING_PORTAL = 1;
|
||||
|
||||
public BuildingSchematic schematic;
|
||||
public GridSpaceHolder area;
|
||||
public int buildingTier;
|
||||
public int buildingType;
|
||||
public Int3 doorGridSpace;
|
||||
|
||||
public DemonBuilding(BuildingSchematic schematic)
|
||||
{
|
||||
this.schematic = schematic;
|
||||
this.buildingType = schematic.buildingType;
|
||||
this.buildingTier = schematic.buildingTier;
|
||||
this.area = this.createGSHForSchematic(schematic);
|
||||
this.doorGridSpace = schematic.getGridSpotOfDoor();
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return schematic.name;
|
||||
}
|
||||
|
||||
public boolean isValid(GridSpaceHolder master, int gridX, int gridZ, ForgeDirection dir)
|
||||
{
|
||||
return area.doesContainAll(master, gridX, gridZ, dir);
|
||||
}
|
||||
|
||||
public void buildAll(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
|
||||
{
|
||||
schematic.buildAll(world, xCoord, yCoord, zCoord, dir);
|
||||
}
|
||||
|
||||
public void setAllGridSpaces(int xInit, int zInit, int yLevel, ForgeDirection dir, int type, GridSpaceHolder master)
|
||||
{
|
||||
area.setAllGridSpaces(xInit, zInit, yLevel, dir, type, master);
|
||||
}
|
||||
|
||||
public GridSpaceHolder createGSHForSchematic(BuildingSchematic scheme)
|
||||
{
|
||||
switch (this.buildingType)
|
||||
{
|
||||
case DemonBuilding.BUILDING_HOUSE:
|
||||
return scheme.createGSH();
|
||||
case DemonBuilding.BUILDING_PORTAL:
|
||||
|
||||
}
|
||||
return scheme.createGSH();
|
||||
}
|
||||
|
||||
public Int3 getDoorSpace(ForgeDirection dir)
|
||||
{
|
||||
int x = 0;
|
||||
int z = 0;
|
||||
switch (dir)
|
||||
{
|
||||
case SOUTH:
|
||||
x = -doorGridSpace.xCoord;
|
||||
z = -doorGridSpace.zCoord;
|
||||
break;
|
||||
case WEST:
|
||||
x = doorGridSpace.zCoord;
|
||||
z = -doorGridSpace.xCoord;
|
||||
break;
|
||||
case EAST:
|
||||
x = -doorGridSpace.zCoord;
|
||||
z = doorGridSpace.xCoord;
|
||||
break;
|
||||
default:
|
||||
x = doorGridSpace.xCoord;
|
||||
z = doorGridSpace.zCoord;
|
||||
break;
|
||||
}
|
||||
|
||||
return new Int3(x, doorGridSpace.yCoord, z);
|
||||
}
|
||||
|
||||
public Int3 getGridOffsetFromRoad(ForgeDirection sideOfRoad, int yLevel)
|
||||
{
|
||||
Int3 doorSpace = this.getDoorSpace(sideOfRoad);
|
||||
int x = doorSpace.xCoord;
|
||||
int z = doorSpace.zCoord;
|
||||
|
||||
switch (sideOfRoad)
|
||||
{
|
||||
case SOUTH:
|
||||
z++;
|
||||
break;
|
||||
case EAST:
|
||||
x++;
|
||||
break;
|
||||
case WEST:
|
||||
x--;
|
||||
break;
|
||||
default:
|
||||
z--;
|
||||
break;
|
||||
}
|
||||
|
||||
return new Int3(x, yLevel, z);
|
||||
}
|
||||
|
||||
public void destroyAllInField(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
|
||||
{
|
||||
schematic.destroyAllInField(world, xCoord, yCoord, zCoord, dir);
|
||||
}
|
||||
|
||||
public int getNumberOfGridSpaces()
|
||||
{
|
||||
return area.getNumberOfGridSpaces();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,21 +2,21 @@ package WayofTime.alchemicalWizardry.common.demonVillage;
|
|||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DemonCrosspath
|
||||
public class DemonCrosspath
|
||||
{
|
||||
private int xCoord;
|
||||
private int yLevel;
|
||||
private int zCoord;
|
||||
|
||||
public DemonCrosspath(int xCoord, int yLevel, int zCoord)
|
||||
{
|
||||
this.xCoord = xCoord;
|
||||
this.yLevel = yLevel;
|
||||
this.zCoord = zCoord;
|
||||
}
|
||||
|
||||
public void createCrosspath(World world)
|
||||
{
|
||||
|
||||
}
|
||||
private int xCoord;
|
||||
private int yLevel;
|
||||
private int zCoord;
|
||||
|
||||
public DemonCrosspath(int xCoord, int yLevel, int zCoord)
|
||||
{
|
||||
this.xCoord = xCoord;
|
||||
this.yLevel = yLevel;
|
||||
this.zCoord = zCoord;
|
||||
}
|
||||
|
||||
public void createCrosspath(World world)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,135 +1,135 @@
|
|||
package WayofTime.alchemicalWizardry.common.demonVillage;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
|
||||
public class DemonVillagePath
|
||||
public class DemonVillagePath
|
||||
{
|
||||
public int xi;
|
||||
public int yi;
|
||||
public int zi;
|
||||
public ForgeDirection dir;
|
||||
public int length;
|
||||
|
||||
public DemonVillagePath(int xi, int yi, int zi, ForgeDirection dir, int length)
|
||||
{
|
||||
this.xi = xi;
|
||||
this.yi = yi;
|
||||
this.zi = zi;
|
||||
this.dir = dir;
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
public Int3 constructFullPath(World world, int clearance, Block block, int meta)
|
||||
{
|
||||
int xPos = this.xi;
|
||||
int yPos = this.yi;
|
||||
int zPos = this.zi;
|
||||
int rad = this.getRoadRadius();
|
||||
|
||||
for(int i=-rad; i<=rad; i++)
|
||||
{
|
||||
this.constructPartialPath(world, clearance, block, meta, xPos-rad*dir.offsetX+i*dir.offsetZ, yPos, zPos-rad*dir.offsetZ+i*dir.offsetX, dir, length+2*rad);
|
||||
}
|
||||
|
||||
return this.getFinalLocation(world, clearance);
|
||||
}
|
||||
|
||||
public void constructPartialPath(World world, int clearance, Block roadBlock, int meta, int xi, int yi, int zi, ForgeDirection dir, int length)
|
||||
{
|
||||
int xPos = xi;
|
||||
int yPos = yi;
|
||||
int zPos = zi;
|
||||
|
||||
for(int i=0; i<length; i++)
|
||||
{
|
||||
int xOffset = i*dir.offsetX;
|
||||
int zOffset = i*dir.offsetZ;
|
||||
|
||||
for(int yOffset=0; yOffset<=clearance; yOffset++)
|
||||
{
|
||||
int sign = 1;
|
||||
|
||||
Block block1 = world.getBlock(xPos + xOffset, yPos + sign*yOffset, zPos + zOffset);
|
||||
Block highBlock1 = world.getBlock(xPos + xOffset, yPos + sign*yOffset + 1, zPos + zOffset);
|
||||
|
||||
if(!block1.isReplaceable(world, xPos + xOffset, yPos + sign*yOffset, zPos + zOffset) && this.isBlockReplaceable(block1) && highBlock1.isReplaceable(world, xPos + xOffset, yPos + sign*yOffset + 1, zPos + zOffset))
|
||||
{
|
||||
world.setBlock(xPos + xOffset, yPos + sign*yOffset, zPos + zOffset, roadBlock, meta, 3);
|
||||
yPos += sign*yOffset;
|
||||
break;
|
||||
}else
|
||||
{
|
||||
sign = -1;
|
||||
Block block2 = world.getBlock(xPos + xOffset, yPos + sign*yOffset, zPos + zOffset);
|
||||
Block highBlock2 = world.getBlock(xPos + xOffset, yPos + sign*yOffset + 1, zPos + zOffset);
|
||||
|
||||
if(!block2.isReplaceable(world, xPos + xOffset, yPos + sign*yOffset, zPos + zOffset) && this.isBlockReplaceable(block1) && highBlock2.isReplaceable(world, xPos + xOffset, yPos + sign*yOffset + 1, zPos + zOffset))
|
||||
{
|
||||
world.setBlock(xPos + xOffset, yPos + sign*yOffset, zPos + zOffset, roadBlock, meta, 3);
|
||||
yPos += sign*yOffset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Int3 getFinalLocation(World world, int clearance)
|
||||
{
|
||||
int xPos = xi;
|
||||
int yPos = yi;
|
||||
int zPos = zi;
|
||||
|
||||
for(int i=0; i<length; i++)
|
||||
{
|
||||
int xOffset = i*dir.offsetX;
|
||||
int zOffset = i*dir.offsetZ;
|
||||
|
||||
for(int yOffset=0; yOffset<=clearance; yOffset++)
|
||||
{
|
||||
int sign = 1;
|
||||
|
||||
Block block1 = world.getBlock(xPos + xOffset, yPos + sign*yOffset, zPos + zOffset);
|
||||
Block highBlock1 = world.getBlock(xPos + xOffset, yPos + sign*yOffset + 1, zPos + zOffset);
|
||||
|
||||
if(!block1.isReplaceable(world, xPos + xOffset, yPos + sign*yOffset, zPos + zOffset) && this.isBlockReplaceable(block1) && highBlock1.isReplaceable(world, xPos + xOffset, yPos + sign*yOffset + 1, zPos + zOffset))
|
||||
{
|
||||
yPos += sign*yOffset;
|
||||
break;
|
||||
}else
|
||||
{
|
||||
sign = -1;
|
||||
Block block2 = world.getBlock(xPos + xOffset, yPos + sign*yOffset, zPos + zOffset);
|
||||
Block highBlock2 = world.getBlock(xPos + xOffset, yPos + sign*yOffset + 1, zPos + zOffset);
|
||||
|
||||
if(!block2.isReplaceable(world, xPos + xOffset, yPos + sign*yOffset, zPos + zOffset) && this.isBlockReplaceable(block1) && highBlock2.isReplaceable(world, xPos + xOffset, yPos + sign*yOffset + 1, zPos + zOffset))
|
||||
{
|
||||
yPos += sign*yOffset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new Int3(xPos,yPos,zPos);
|
||||
}
|
||||
|
||||
public int getRoadRadius()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public boolean isBlockReplaceable(Block block)
|
||||
{
|
||||
if(block.getMaterial() == Material.leaves || block.getMaterial() == Material.vine)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return !block.equals(ModBlocks.blockDemonPortal);
|
||||
}
|
||||
public int xi;
|
||||
public int yi;
|
||||
public int zi;
|
||||
public ForgeDirection dir;
|
||||
public int length;
|
||||
|
||||
public DemonVillagePath(int xi, int yi, int zi, ForgeDirection dir, int length)
|
||||
{
|
||||
this.xi = xi;
|
||||
this.yi = yi;
|
||||
this.zi = zi;
|
||||
this.dir = dir;
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
public Int3 constructFullPath(World world, int clearance, Block block, int meta)
|
||||
{
|
||||
int xPos = this.xi;
|
||||
int yPos = this.yi;
|
||||
int zPos = this.zi;
|
||||
int rad = this.getRoadRadius();
|
||||
|
||||
for (int i = -rad; i <= rad; i++)
|
||||
{
|
||||
this.constructPartialPath(world, clearance, block, meta, xPos - rad * dir.offsetX + i * dir.offsetZ, yPos, zPos - rad * dir.offsetZ + i * dir.offsetX, dir, length + 2 * rad);
|
||||
}
|
||||
|
||||
return this.getFinalLocation(world, clearance);
|
||||
}
|
||||
|
||||
public void constructPartialPath(World world, int clearance, Block roadBlock, int meta, int xi, int yi, int zi, ForgeDirection dir, int length)
|
||||
{
|
||||
int xPos = xi;
|
||||
int yPos = yi;
|
||||
int zPos = zi;
|
||||
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
int xOffset = i * dir.offsetX;
|
||||
int zOffset = i * dir.offsetZ;
|
||||
|
||||
for (int yOffset = 0; yOffset <= clearance; yOffset++)
|
||||
{
|
||||
int sign = 1;
|
||||
|
||||
Block block1 = world.getBlock(xPos + xOffset, yPos + sign * yOffset, zPos + zOffset);
|
||||
Block highBlock1 = world.getBlock(xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset);
|
||||
|
||||
if (!block1.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset, zPos + zOffset) && this.isBlockReplaceable(block1) && highBlock1.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset))
|
||||
{
|
||||
world.setBlock(xPos + xOffset, yPos + sign * yOffset, zPos + zOffset, roadBlock, meta, 3);
|
||||
yPos += sign * yOffset;
|
||||
break;
|
||||
} else
|
||||
{
|
||||
sign = -1;
|
||||
Block block2 = world.getBlock(xPos + xOffset, yPos + sign * yOffset, zPos + zOffset);
|
||||
Block highBlock2 = world.getBlock(xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset);
|
||||
|
||||
if (!block2.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset, zPos + zOffset) && this.isBlockReplaceable(block1) && highBlock2.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset))
|
||||
{
|
||||
world.setBlock(xPos + xOffset, yPos + sign * yOffset, zPos + zOffset, roadBlock, meta, 3);
|
||||
yPos += sign * yOffset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Int3 getFinalLocation(World world, int clearance)
|
||||
{
|
||||
int xPos = xi;
|
||||
int yPos = yi;
|
||||
int zPos = zi;
|
||||
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
int xOffset = i * dir.offsetX;
|
||||
int zOffset = i * dir.offsetZ;
|
||||
|
||||
for (int yOffset = 0; yOffset <= clearance; yOffset++)
|
||||
{
|
||||
int sign = 1;
|
||||
|
||||
Block block1 = world.getBlock(xPos + xOffset, yPos + sign * yOffset, zPos + zOffset);
|
||||
Block highBlock1 = world.getBlock(xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset);
|
||||
|
||||
if (!block1.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset, zPos + zOffset) && this.isBlockReplaceable(block1) && highBlock1.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset))
|
||||
{
|
||||
yPos += sign * yOffset;
|
||||
break;
|
||||
} else
|
||||
{
|
||||
sign = -1;
|
||||
Block block2 = world.getBlock(xPos + xOffset, yPos + sign * yOffset, zPos + zOffset);
|
||||
Block highBlock2 = world.getBlock(xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset);
|
||||
|
||||
if (!block2.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset, zPos + zOffset) && this.isBlockReplaceable(block1) && highBlock2.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset))
|
||||
{
|
||||
yPos += sign * yOffset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new Int3(xPos, yPos, zPos);
|
||||
}
|
||||
|
||||
public int getRoadRadius()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public boolean isBlockReplaceable(Block block)
|
||||
{
|
||||
if (block.getMaterial() == Material.leaves || block.getMaterial() == Material.vine)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return !block.equals(ModBlocks.blockDemonPortal);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,76 +2,76 @@ package WayofTime.alchemicalWizardry.common.demonVillage;
|
|||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class GridSpace
|
||||
public class GridSpace
|
||||
{
|
||||
public static final int EMPTY = 0;
|
||||
public static final int MAIN_PORTAL = 1;
|
||||
public static final int MINI_PORTAL = 2;
|
||||
public static final int ROAD = 3;
|
||||
public static final int CROSSROAD = 4;
|
||||
public static final int HOUSE = 5;
|
||||
|
||||
private int yLevel;
|
||||
private int type;
|
||||
|
||||
public GridSpace()
|
||||
{
|
||||
this(EMPTY, -1);
|
||||
}
|
||||
|
||||
public GridSpace(int type, int yLevel)
|
||||
{
|
||||
this.type = type;
|
||||
this.yLevel = yLevel;
|
||||
}
|
||||
|
||||
public int getGridType()
|
||||
{
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public void setGridType(int type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getYLevel()
|
||||
{
|
||||
return this.yLevel;
|
||||
}
|
||||
|
||||
public void setYLevel(int yLevel)
|
||||
{
|
||||
this.yLevel = yLevel;
|
||||
}
|
||||
|
||||
public boolean isEmpty()
|
||||
{
|
||||
return type == this.EMPTY;
|
||||
}
|
||||
|
||||
public static GridSpace getGridFromTag(NBTTagCompound tag)
|
||||
{
|
||||
return new GridSpace(tag.getInteger("type"), tag.getInteger("yLevel"));
|
||||
}
|
||||
|
||||
public NBTTagCompound getTag()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
|
||||
tag.setInteger("type", type);
|
||||
tag.setInteger("yLevel", yLevel);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
public boolean isRoadSegment()
|
||||
{
|
||||
return type == this.ROAD || type == this.CROSSROAD;
|
||||
}
|
||||
|
||||
public boolean isBuilding()
|
||||
{
|
||||
return type == this.HOUSE;
|
||||
}
|
||||
public static final int EMPTY = 0;
|
||||
public static final int MAIN_PORTAL = 1;
|
||||
public static final int MINI_PORTAL = 2;
|
||||
public static final int ROAD = 3;
|
||||
public static final int CROSSROAD = 4;
|
||||
public static final int HOUSE = 5;
|
||||
|
||||
private int yLevel;
|
||||
private int type;
|
||||
|
||||
public GridSpace()
|
||||
{
|
||||
this(EMPTY, -1);
|
||||
}
|
||||
|
||||
public GridSpace(int type, int yLevel)
|
||||
{
|
||||
this.type = type;
|
||||
this.yLevel = yLevel;
|
||||
}
|
||||
|
||||
public int getGridType()
|
||||
{
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public void setGridType(int type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getYLevel()
|
||||
{
|
||||
return this.yLevel;
|
||||
}
|
||||
|
||||
public void setYLevel(int yLevel)
|
||||
{
|
||||
this.yLevel = yLevel;
|
||||
}
|
||||
|
||||
public boolean isEmpty()
|
||||
{
|
||||
return type == this.EMPTY;
|
||||
}
|
||||
|
||||
public static GridSpace getGridFromTag(NBTTagCompound tag)
|
||||
{
|
||||
return new GridSpace(tag.getInteger("type"), tag.getInteger("yLevel"));
|
||||
}
|
||||
|
||||
public NBTTagCompound getTag()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
|
||||
tag.setInteger("type", type);
|
||||
tag.setInteger("yLevel", yLevel);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
public boolean isRoadSegment()
|
||||
{
|
||||
return type == this.ROAD || type == this.CROSSROAD;
|
||||
}
|
||||
|
||||
public boolean isBuilding()
|
||||
{
|
||||
return type == this.HOUSE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,303 +7,303 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||
|
||||
public class GridSpaceHolder
|
||||
{
|
||||
public GridSpace[][] area;
|
||||
public int negXRadius; //These variables indicate how much the grid has expanded from the 1x1
|
||||
public int posXRadius; //matrix in each direction
|
||||
public int negZRadius;
|
||||
public int posZRadius;
|
||||
|
||||
public GridSpaceHolder()
|
||||
{
|
||||
area = new GridSpace[1][1];
|
||||
area[0][0] = new GridSpace();
|
||||
}
|
||||
|
||||
public void expandAreaInNegX()
|
||||
{
|
||||
GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 2][negZRadius + posZRadius + 1];
|
||||
for(int i=0; i<=negZRadius + posZRadius; i++)
|
||||
{
|
||||
newGrid[0][i] = new GridSpace();
|
||||
}
|
||||
|
||||
for(int i=0; i<=negXRadius + posXRadius; i++)
|
||||
{
|
||||
for(int j=0; j<=negZRadius + posZRadius; j++)
|
||||
{
|
||||
newGrid[i+1][j] = area[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
area = newGrid;
|
||||
negXRadius += 1;
|
||||
}
|
||||
|
||||
public void expandAreaInPosX()
|
||||
{
|
||||
GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 2][negZRadius + posZRadius + 1];
|
||||
|
||||
for(int i=0; i<=negZRadius + posZRadius; i++)
|
||||
{
|
||||
newGrid[negXRadius + posXRadius + 1][i] = new GridSpace();
|
||||
}
|
||||
|
||||
for(int i=0; i<=negXRadius + posXRadius; i++)
|
||||
{
|
||||
for(int j=0; j<=negZRadius + posZRadius; j++)
|
||||
{
|
||||
newGrid[i][j] = area[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
area = newGrid;
|
||||
posXRadius += 1;
|
||||
}
|
||||
|
||||
public void expandAreaInNegZ()
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
for(int i=0; i<=negXRadius + posXRadius; i++)
|
||||
{
|
||||
for(int j=0; j<=negZRadius + posZRadius; j++)
|
||||
{
|
||||
newGrid[i][j+1] = area[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
area = newGrid;
|
||||
negZRadius += 1;
|
||||
}
|
||||
|
||||
public void expandAreaInPosZ()
|
||||
{
|
||||
GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 1][negZRadius + posZRadius + 2];
|
||||
|
||||
for(int i=0; i<=negXRadius + posXRadius; i++)
|
||||
{
|
||||
newGrid[i][negZRadius + posZRadius + 1] = new GridSpace();
|
||||
}
|
||||
|
||||
for(int i=0; i<=negXRadius + posXRadius; i++)
|
||||
{
|
||||
for(int j=0; j<=negZRadius + posZRadius; j++)
|
||||
{
|
||||
newGrid[i][j] = area[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
area = newGrid;
|
||||
posZRadius += 1;
|
||||
}
|
||||
|
||||
public GridSpace getGridSpace(int x, int z)
|
||||
{
|
||||
if(x > posXRadius|| x < -negXRadius || z > posZRadius || z < -negZRadius)
|
||||
{
|
||||
return new GridSpace();
|
||||
}else
|
||||
{
|
||||
return (area[x + negXRadius][z + negZRadius]);
|
||||
}
|
||||
}
|
||||
|
||||
public void setGridSpace(int x, int z, GridSpace space)
|
||||
{
|
||||
if(x > posXRadius)
|
||||
{
|
||||
this.expandAreaInPosX();
|
||||
this.setGridSpace(x, z, space);
|
||||
return;
|
||||
}else if(x < -negXRadius)
|
||||
{
|
||||
this.expandAreaInNegX();
|
||||
this.setGridSpace(x, z, space);
|
||||
return;
|
||||
}else if(z > posZRadius)
|
||||
{
|
||||
this.expandAreaInPosZ();
|
||||
this.setGridSpace(x, z, space);
|
||||
return;
|
||||
}else if(z < -negZRadius)
|
||||
{
|
||||
this.expandAreaInNegZ();
|
||||
this.setGridSpace(x, z, space);
|
||||
return;
|
||||
}else
|
||||
{
|
||||
area[x + negXRadius][z + negZRadius] = space;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean doesContainAll(GridSpaceHolder master, int xInit, int zInit, ForgeDirection dir)
|
||||
{
|
||||
if(master != null)
|
||||
{
|
||||
System.out.println("negXRadius: " + negXRadius + " posXRadius: " + posXRadius + " negZRadius: " + negZRadius + " posZRadius: " + posZRadius);
|
||||
for(int i=-negXRadius; i<=posXRadius; i++)
|
||||
{
|
||||
for(int j=-negZRadius; j<=posZRadius; j++)
|
||||
{
|
||||
GridSpace thisSpace = this.getGridSpace(i, j);
|
||||
if(thisSpace.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
System.out.println("x: " + i + " z: " + j);
|
||||
|
||||
int xOff = 0;
|
||||
int zOff = 0;
|
||||
|
||||
switch(dir)
|
||||
{
|
||||
case SOUTH:
|
||||
xOff = -i;
|
||||
zOff = -j;
|
||||
break;
|
||||
case WEST:
|
||||
xOff = j;
|
||||
zOff = -i;
|
||||
break;
|
||||
case EAST:
|
||||
xOff = -j;
|
||||
zOff = i;
|
||||
break;
|
||||
default:
|
||||
xOff = i;
|
||||
zOff = j;
|
||||
break;
|
||||
}
|
||||
if(!master.getGridSpace(xInit + xOff, zInit + zOff).isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setAllGridSpaces(int xInit, int zInit, int yLevel, ForgeDirection dir, int type, GridSpaceHolder master)
|
||||
{
|
||||
System.out.println("Grid space selected: (" + xInit + "," + zInit + ")");
|
||||
if(master != null)
|
||||
{
|
||||
for(int i=-negXRadius; i<=posXRadius; i++)
|
||||
{
|
||||
for(int j=-negZRadius; j<=posZRadius; j++)
|
||||
{
|
||||
GridSpace thisSpace = this.getGridSpace(i, j);
|
||||
if(thisSpace.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int xOff = 0;
|
||||
int zOff = 0;
|
||||
|
||||
switch(dir)
|
||||
{
|
||||
case SOUTH:
|
||||
xOff = -i;
|
||||
zOff = -j;
|
||||
break;
|
||||
case WEST:
|
||||
xOff = j;
|
||||
zOff = -i;
|
||||
break;
|
||||
case EAST:
|
||||
xOff = -j;
|
||||
zOff = i;
|
||||
break;
|
||||
default:
|
||||
xOff = i;
|
||||
zOff = j;
|
||||
break;
|
||||
}
|
||||
|
||||
System.out.println("Grid space (" + (xInit + xOff) + "," + (zInit + zOff) + ")");
|
||||
|
||||
master.setGridSpace(xInit + xOff, zInit + zOff, new GridSpace(type, yLevel));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void destroyAllInGridSpaces(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
|
||||
{
|
||||
for(int i=-negXRadius; i<=posXRadius; i++)
|
||||
{
|
||||
for(int j=-negZRadius; j<=posZRadius; j++)
|
||||
{
|
||||
GridSpace thisSpace = this.getGridSpace(i, j);
|
||||
if(thisSpace.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int xOff = 0;
|
||||
int zOff = 0;
|
||||
|
||||
switch(dir)
|
||||
{
|
||||
case SOUTH:
|
||||
xOff = -i;
|
||||
zOff = -j;
|
||||
break;
|
||||
case WEST:
|
||||
xOff = j;
|
||||
zOff = -i;
|
||||
break;
|
||||
case EAST:
|
||||
xOff = -j;
|
||||
zOff = i;
|
||||
break;
|
||||
default:
|
||||
xOff = i;
|
||||
zOff = j;
|
||||
break;
|
||||
}
|
||||
|
||||
for(int l = -2; l<=2; l++)
|
||||
{
|
||||
for(int m = -2; m<=2; m++)
|
||||
{
|
||||
Block block = world.getBlock(xCoord + xOff*5 + l, yCoord, zCoord + zOff*5 + m);
|
||||
if(block == ModBlocks.blockDemonPortal)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
world.setBlockToAir(xCoord + xOff*5 + l, yCoord, zCoord + zOff*5 + m);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
public GridSpace[][] area;
|
||||
public int negXRadius; //These variables indicate how much the grid has expanded from the 1x1
|
||||
public int posXRadius; //matrix in each direction
|
||||
public int negZRadius;
|
||||
public int posZRadius;
|
||||
|
||||
public GridSpaceHolder()
|
||||
{
|
||||
area = new GridSpace[1][1];
|
||||
area[0][0] = new GridSpace();
|
||||
}
|
||||
|
||||
public void expandAreaInNegX()
|
||||
{
|
||||
GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 2][negZRadius + posZRadius + 1];
|
||||
for (int i = 0; i <= negZRadius + posZRadius; i++)
|
||||
{
|
||||
newGrid[0][i] = new GridSpace();
|
||||
}
|
||||
|
||||
for (int i = 0; i <= negXRadius + posXRadius; i++)
|
||||
{
|
||||
for (int j = 0; j <= negZRadius + posZRadius; j++)
|
||||
{
|
||||
newGrid[i + 1][j] = area[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
area = newGrid;
|
||||
negXRadius += 1;
|
||||
}
|
||||
|
||||
public void expandAreaInPosX()
|
||||
{
|
||||
GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 2][negZRadius + posZRadius + 1];
|
||||
|
||||
for (int i = 0; i <= negZRadius + posZRadius; i++)
|
||||
{
|
||||
newGrid[negXRadius + posXRadius + 1][i] = new GridSpace();
|
||||
}
|
||||
|
||||
for (int i = 0; i <= negXRadius + posXRadius; i++)
|
||||
{
|
||||
for (int j = 0; j <= negZRadius + posZRadius; j++)
|
||||
{
|
||||
newGrid[i][j] = area[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
area = newGrid;
|
||||
posXRadius += 1;
|
||||
}
|
||||
|
||||
public void expandAreaInNegZ()
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
for (int i = 0; i <= negXRadius + posXRadius; i++)
|
||||
{
|
||||
for (int j = 0; j <= negZRadius + posZRadius; j++)
|
||||
{
|
||||
newGrid[i][j + 1] = area[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
area = newGrid;
|
||||
negZRadius += 1;
|
||||
}
|
||||
|
||||
public void expandAreaInPosZ()
|
||||
{
|
||||
GridSpace[][] newGrid = new GridSpace[negXRadius + posXRadius + 1][negZRadius + posZRadius + 2];
|
||||
|
||||
for (int i = 0; i <= negXRadius + posXRadius; i++)
|
||||
{
|
||||
newGrid[i][negZRadius + posZRadius + 1] = new GridSpace();
|
||||
}
|
||||
|
||||
for (int i = 0; i <= negXRadius + posXRadius; i++)
|
||||
{
|
||||
for (int j = 0; j <= negZRadius + posZRadius; j++)
|
||||
{
|
||||
newGrid[i][j] = area[i][j];
|
||||
}
|
||||
}
|
||||
|
||||
area = newGrid;
|
||||
posZRadius += 1;
|
||||
}
|
||||
|
||||
public GridSpace getGridSpace(int x, int z)
|
||||
{
|
||||
if (x > posXRadius || x < -negXRadius || z > posZRadius || z < -negZRadius)
|
||||
{
|
||||
return new GridSpace();
|
||||
} else
|
||||
{
|
||||
return (area[x + negXRadius][z + negZRadius]);
|
||||
}
|
||||
}
|
||||
|
||||
public void setGridSpace(int x, int z, GridSpace space)
|
||||
{
|
||||
if (x > posXRadius)
|
||||
{
|
||||
this.expandAreaInPosX();
|
||||
this.setGridSpace(x, z, space);
|
||||
return;
|
||||
} else if (x < -negXRadius)
|
||||
{
|
||||
this.expandAreaInNegX();
|
||||
this.setGridSpace(x, z, space);
|
||||
return;
|
||||
} else if (z > posZRadius)
|
||||
{
|
||||
this.expandAreaInPosZ();
|
||||
this.setGridSpace(x, z, space);
|
||||
return;
|
||||
} else if (z < -negZRadius)
|
||||
{
|
||||
this.expandAreaInNegZ();
|
||||
this.setGridSpace(x, z, space);
|
||||
return;
|
||||
} else
|
||||
{
|
||||
area[x + negXRadius][z + negZRadius] = space;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean doesContainAll(GridSpaceHolder master, int xInit, int zInit, ForgeDirection dir)
|
||||
{
|
||||
if (master != null)
|
||||
{
|
||||
System.out.println("negXRadius: " + negXRadius + " posXRadius: " + posXRadius + " negZRadius: " + negZRadius + " posZRadius: " + posZRadius);
|
||||
for (int i = -negXRadius; i <= posXRadius; i++)
|
||||
{
|
||||
for (int j = -negZRadius; j <= posZRadius; j++)
|
||||
{
|
||||
GridSpace thisSpace = this.getGridSpace(i, j);
|
||||
if (thisSpace.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
System.out.println("x: " + i + " z: " + j);
|
||||
|
||||
int xOff = 0;
|
||||
int zOff = 0;
|
||||
|
||||
switch (dir)
|
||||
{
|
||||
case SOUTH:
|
||||
xOff = -i;
|
||||
zOff = -j;
|
||||
break;
|
||||
case WEST:
|
||||
xOff = j;
|
||||
zOff = -i;
|
||||
break;
|
||||
case EAST:
|
||||
xOff = -j;
|
||||
zOff = i;
|
||||
break;
|
||||
default:
|
||||
xOff = i;
|
||||
zOff = j;
|
||||
break;
|
||||
}
|
||||
if (!master.getGridSpace(xInit + xOff, zInit + zOff).isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setAllGridSpaces(int xInit, int zInit, int yLevel, ForgeDirection dir, int type, GridSpaceHolder master)
|
||||
{
|
||||
System.out.println("Grid space selected: (" + xInit + "," + zInit + ")");
|
||||
if (master != null)
|
||||
{
|
||||
for (int i = -negXRadius; i <= posXRadius; i++)
|
||||
{
|
||||
for (int j = -negZRadius; j <= posZRadius; j++)
|
||||
{
|
||||
GridSpace thisSpace = this.getGridSpace(i, j);
|
||||
if (thisSpace.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int xOff = 0;
|
||||
int zOff = 0;
|
||||
|
||||
switch (dir)
|
||||
{
|
||||
case SOUTH:
|
||||
xOff = -i;
|
||||
zOff = -j;
|
||||
break;
|
||||
case WEST:
|
||||
xOff = j;
|
||||
zOff = -i;
|
||||
break;
|
||||
case EAST:
|
||||
xOff = -j;
|
||||
zOff = i;
|
||||
break;
|
||||
default:
|
||||
xOff = i;
|
||||
zOff = j;
|
||||
break;
|
||||
}
|
||||
|
||||
System.out.println("Grid space (" + (xInit + xOff) + "," + (zInit + zOff) + ")");
|
||||
|
||||
master.setGridSpace(xInit + xOff, zInit + zOff, new GridSpace(type, yLevel));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void destroyAllInGridSpaces(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
|
||||
{
|
||||
for (int i = -negXRadius; i <= posXRadius; i++)
|
||||
{
|
||||
for (int j = -negZRadius; j <= posZRadius; j++)
|
||||
{
|
||||
GridSpace thisSpace = this.getGridSpace(i, j);
|
||||
if (thisSpace.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int xOff = 0;
|
||||
int zOff = 0;
|
||||
|
||||
switch (dir)
|
||||
{
|
||||
case SOUTH:
|
||||
xOff = -i;
|
||||
zOff = -j;
|
||||
break;
|
||||
case WEST:
|
||||
xOff = j;
|
||||
zOff = -i;
|
||||
break;
|
||||
case EAST:
|
||||
xOff = -j;
|
||||
zOff = i;
|
||||
break;
|
||||
default:
|
||||
xOff = i;
|
||||
zOff = j;
|
||||
break;
|
||||
}
|
||||
|
||||
for (int l = -2; l <= 2; l++)
|
||||
{
|
||||
for (int m = -2; m <= 2; m++)
|
||||
{
|
||||
Block block = world.getBlock(xCoord + xOff * 5 + l, yCoord, zCoord + zOff * 5 + m);
|
||||
if (block == ModBlocks.blockDemonPortal)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
world.setBlockToAir(xCoord + xOff * 5 + l, yCoord, zCoord + zOff * 5 + m);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,5 +4,5 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
|
||||
public class TileBlockSet extends BlockSet
|
||||
{
|
||||
public NBTTagCompound tag;
|
||||
public NBTTagCompound tag;
|
||||
}
|
||||
|
|
|
@ -1,18 +1,13 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.mob;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
|
||||
import net.minecraft.entity.ai.EntityAIFollowOwner;
|
||||
import net.minecraft.entity.ai.EntityAIHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAILookIdle;
|
||||
import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAIOwnerHurtTarget;
|
||||
import net.minecraft.entity.ai.EntityAISwimming;
|
||||
import net.minecraft.entity.ai.EntityAIWander;
|
||||
import net.minecraft.entity.ai.EntityAIWatchClosest;
|
||||
import net.minecraft.entity.ai.*;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
|
@ -20,17 +15,12 @@ import net.minecraft.entity.passive.EntityHorse;
|
|||
import net.minecraft.entity.passive.EntityWolf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class EntityBileDemon extends EntityDemon
|
||||
{
|
||||
|
@ -46,22 +36,17 @@ public class EntityBileDemon extends EntityDemon
|
|||
this.setSize(1.3F, 2.0F);
|
||||
this.getNavigator().setAvoidsWater(true);
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
//this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
|
||||
this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0D, true));
|
||||
this.tasks.addTask(3, this.aiSit);
|
||||
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
|
||||
//this.tasks.addTask(6, new EntityAIMate(this, 1.0D));
|
||||
this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
|
||||
//this.tasks.addTask(8, new EntityAIBeg(this, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAILookIdle(this));
|
||||
this.tasks.addTask(4, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
|
||||
this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
|
||||
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(7, new EntityAILookIdle(this));
|
||||
this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
|
||||
this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
|
||||
this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
|
||||
//this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
|
||||
this.setTamed(false);
|
||||
attackTimer = 0;
|
||||
//this.isImmuneToFire = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -318,7 +303,7 @@ public class EntityBileDemon extends EntityDemon
|
|||
}
|
||||
}
|
||||
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
{
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
@ -375,7 +360,6 @@ public class EntityBileDemon extends EntityDemon
|
|||
public boolean isBreedingItem(ItemStack par1ItemStack)
|
||||
{
|
||||
return false;
|
||||
//return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -455,7 +439,6 @@ public class EntityBileDemon extends EntityDemon
|
|||
*/
|
||||
protected boolean canDespawn()
|
||||
{
|
||||
//return !this.isTamed() && this.ticksExisted > 2400;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ import WayofTime.alchemicalWizardry.ModItems;
|
|||
import WayofTime.alchemicalWizardry.common.EntityAITargetAggro;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -18,7 +17,6 @@ import net.minecraft.entity.passive.EntityHorse;
|
|||
import net.minecraft.entity.passive.EntityWolf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -28,7 +26,6 @@ import net.minecraft.world.World;
|
|||
|
||||
public class EntityBoulderFist extends EntityDemon
|
||||
{
|
||||
//private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 40, 40, 15.0F);
|
||||
private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false);
|
||||
|
||||
private static float maxTamedHealth = 60.0F;
|
||||
|
@ -44,25 +41,20 @@ public class EntityBoulderFist extends EntityDemon
|
|||
this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
|
||||
this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
|
||||
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
|
||||
//this.tasks.addTask(6, new EntityAIMate(this, 1.0D));
|
||||
this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
|
||||
//this.tasks.addTask(8, new EntityAIBeg(this, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAILookIdle(this));
|
||||
this.tasks.addTask(6, new EntityAIWander(this, 1.0D));
|
||||
this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(8, new EntityAILookIdle(this));
|
||||
this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
|
||||
this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
|
||||
this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
|
||||
this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false));
|
||||
this.setAggro(false);
|
||||
//this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
|
||||
this.setTamed(false);
|
||||
|
||||
if (par1World != null && !par1World.isRemote)
|
||||
{
|
||||
this.setCombatTask();
|
||||
}
|
||||
|
||||
//this.isImmuneToFire = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -80,8 +72,6 @@ public class EntityBoulderFist extends EntityDemon
|
|||
{
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
|
||||
}
|
||||
|
||||
//this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -121,7 +111,6 @@ public class EntityBoulderFist extends EntityDemon
|
|||
super.entityInit();
|
||||
this.dataWatcher.addObject(18, new Float(this.getHealth()));
|
||||
this.dataWatcher.addObject(19, new Byte((byte) 0));
|
||||
//this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -300,7 +289,7 @@ public class EntityBoulderFist extends EntityDemon
|
|||
}
|
||||
}
|
||||
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
{
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
@ -358,7 +347,6 @@ public class EntityBoulderFist extends EntityDemon
|
|||
public boolean isBreedingItem(ItemStack par1ItemStack)
|
||||
{
|
||||
return false;
|
||||
//return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -438,7 +426,6 @@ public class EntityBoulderFist extends EntityDemon
|
|||
*/
|
||||
protected boolean canDespawn()
|
||||
{
|
||||
//return !this.isTamed() && this.ticksExisted > 2400;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.mob;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.IDemon;
|
||||
import WayofTime.alchemicalWizardry.common.items.DemonPlacer;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.passive.EntityTameable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.IDemon;
|
||||
import WayofTime.alchemicalWizardry.common.items.DemonPlacer;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class EntityDemon extends EntityTameable implements IDemon
|
||||
{
|
||||
|
@ -51,11 +51,11 @@ public class EntityDemon extends EntityTameable implements IDemon
|
|||
{
|
||||
ItemStack drop = new ItemStack(ModItems.demonPlacer, 1, this.getDemonID());
|
||||
|
||||
if((this.getOwner() instanceof EntityPlayer))
|
||||
{
|
||||
DemonPlacer.setOwnerName(drop, SpellHelper.getUsername((EntityPlayer)this.getOwner()));
|
||||
}
|
||||
|
||||
if ((this.getOwner() instanceof EntityPlayer))
|
||||
{
|
||||
DemonPlacer.setOwnerName(drop, SpellHelper.getUsername((EntityPlayer) this.getOwner()));
|
||||
}
|
||||
|
||||
if (this.hasCustomNameTag())
|
||||
{
|
||||
drop.setStackDisplayName(this.getCustomNameTag());
|
||||
|
|
|
@ -5,9 +5,7 @@ import WayofTime.alchemicalWizardry.ModItems;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
|
||||
|
@ -15,7 +13,6 @@ import net.minecraft.entity.monster.EntityCreeper;
|
|||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.entity.passive.EntityHorse;
|
||||
import net.minecraft.entity.passive.EntityWolf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -30,7 +27,6 @@ import java.util.List;
|
|||
|
||||
public class EntityElemental extends EntityDemon
|
||||
{
|
||||
//private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 40, 40, 15.0F);
|
||||
private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false);
|
||||
|
||||
private static float maxTamedHealth = 100.0F;
|
||||
|
@ -41,15 +37,12 @@ public class EntityElemental extends EntityDemon
|
|||
super(par1World, demonID);
|
||||
this.setSize(0.5F, 1.0F);
|
||||
this.setAggro(false);
|
||||
//this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
|
||||
this.setTamed(false);
|
||||
|
||||
if (par1World != null && !par1World.isRemote)
|
||||
{
|
||||
this.setCombatTask();
|
||||
}
|
||||
|
||||
//this.isImmuneToFire = true;
|
||||
}
|
||||
|
||||
public int courseChangeCooldown;
|
||||
|
@ -68,11 +61,6 @@ public class EntityElemental extends EntityDemon
|
|||
/**
|
||||
* The explosion radius of spawned fireballs.
|
||||
*/
|
||||
//private int explosionStrength = 1;
|
||||
//
|
||||
// private int heightOffsetUpdateTime;
|
||||
// private float heightOffset = 0.5F;
|
||||
// private int field_70846_g;
|
||||
protected void dropFewItems(boolean par1, int par2)
|
||||
{
|
||||
if (worldObj.rand.nextFloat() < (1 - Math.pow(0.6f, par2 + 1)))
|
||||
|
@ -174,12 +162,6 @@ public class EntityElemental extends EntityDemon
|
|||
|
||||
protected void updateEntityActionState()
|
||||
{
|
||||
// if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0)
|
||||
// {
|
||||
// this.setDead();
|
||||
// }
|
||||
|
||||
//this.despawnEntity();
|
||||
if (this.getHealth() <= this.getMaxHealth() / 2.0f && worldObj.rand.nextInt(200) == 0)
|
||||
{
|
||||
this.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionReciprocation.id, 100, 1));
|
||||
|
@ -265,10 +247,6 @@ public class EntityElemental extends EntityDemon
|
|||
{
|
||||
if (Math.sqrt(d5 * d5 + d6 * d6 + d7 * d7) < 4)
|
||||
{
|
||||
// if (this.attackCounter == 10)
|
||||
// {
|
||||
// this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1007, (int)this.posX, (int)this.posY, (int)this.posZ, 0);
|
||||
// }
|
||||
++this.attackCounter;
|
||||
|
||||
if (this.attackCounter >= 10)
|
||||
|
@ -369,8 +347,6 @@ public class EntityElemental extends EntityDemon
|
|||
{
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
|
||||
}
|
||||
|
||||
//this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -410,7 +386,6 @@ public class EntityElemental extends EntityDemon
|
|||
super.entityInit();
|
||||
this.dataWatcher.addObject(18, new Float(this.getHealth()));
|
||||
this.dataWatcher.addObject(19, new Byte((byte) 0));
|
||||
//this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1)));
|
||||
this.dataWatcher.addObject(25, Byte.valueOf((byte) 0));
|
||||
}
|
||||
|
||||
|
@ -546,7 +521,6 @@ public class EntityElemental extends EntityDemon
|
|||
public boolean isBreedingItem(ItemStack par1ItemStack)
|
||||
{
|
||||
return false;
|
||||
//return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -602,7 +576,6 @@ public class EntityElemental extends EntityDemon
|
|||
*/
|
||||
protected boolean canDespawn()
|
||||
{
|
||||
//return !this.isTamed() && this.ticksExisted > 2400;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -622,7 +595,6 @@ public class EntityElemental extends EntityDemon
|
|||
}
|
||||
|
||||
return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer) par2EntityLivingBase).canAttackPlayer((EntityPlayer) par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse) par1EntityLivingBase).isTame();
|
||||
//return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer)par2EntityLivingBase).func_96122_a((EntityPlayer)par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse)par1EntityLivingBase).func_110248_bS();
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
|
@ -636,7 +608,6 @@ public class EntityElemental extends EntityDemon
|
|||
public void setCombatTask()
|
||||
{
|
||||
this.tasks.removeTask(this.aiAttackOnCollide);
|
||||
//this.tasks.removeTask(this.aiArrowAttack);
|
||||
ItemStack itemstack = this.getHeldItem();
|
||||
this.tasks.addTask(4, this.aiAttackOnCollide);
|
||||
}
|
||||
|
@ -708,7 +679,7 @@ public class EntityElemental extends EntityDemon
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getTotalArmorValue() //TODO
|
||||
public int getTotalArmorValue()
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
|
|
@ -1,21 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.mob;
|
||||
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IRangedAttackMob;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAIArrowAttack;
|
||||
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
|
||||
import net.minecraft.entity.ai.EntityAIFollowOwner;
|
||||
import net.minecraft.entity.ai.EntityAIHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAILookIdle;
|
||||
import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAIOwnerHurtTarget;
|
||||
import net.minecraft.entity.ai.EntityAISwimming;
|
||||
import net.minecraft.entity.ai.EntityAIWander;
|
||||
import net.minecraft.entity.ai.EntityAIWatchClosest;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAITargetAggro;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.ai.*;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
|
@ -29,11 +20,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAITargetAggro;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
|
||||
{
|
||||
|
@ -50,20 +36,15 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
|
|||
this.getNavigator().setAvoidsWater(true);
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
this.tasks.addTask(2, this.aiSit);
|
||||
//this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
|
||||
//this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
|
||||
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
|
||||
//this.tasks.addTask(6, new EntityAIMate(this, 1.0D));
|
||||
this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
|
||||
//this.tasks.addTask(8, new EntityAIBeg(this, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAILookIdle(this));
|
||||
this.tasks.addTask(3, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
|
||||
this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
|
||||
this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(6, new EntityAILookIdle(this));
|
||||
this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
|
||||
this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
|
||||
this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
|
||||
this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false));
|
||||
this.setAggro(false);
|
||||
//this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
|
||||
this.setTamed(false);
|
||||
|
||||
if (par1World != null && !par1World.isRemote)
|
||||
|
@ -89,8 +70,6 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
|
|||
{
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
|
||||
}
|
||||
|
||||
//this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -130,7 +109,6 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
|
|||
super.entityInit();
|
||||
this.dataWatcher.addObject(18, new Float(this.getHealth()));
|
||||
this.dataWatcher.addObject(19, new Byte((byte) 0));
|
||||
//this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -309,7 +287,7 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
|
|||
}
|
||||
}
|
||||
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
{
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
|
|
@ -1,21 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.mob;
|
||||
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IRangedAttackMob;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAIArrowAttack;
|
||||
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
|
||||
import net.minecraft.entity.ai.EntityAIFollowOwner;
|
||||
import net.minecraft.entity.ai.EntityAIHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAILookIdle;
|
||||
import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAIOwnerHurtTarget;
|
||||
import net.minecraft.entity.ai.EntityAISwimming;
|
||||
import net.minecraft.entity.ai.EntityAIWander;
|
||||
import net.minecraft.entity.ai.EntityAIWatchClosest;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAITargetAggro;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.ai.*;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
|
@ -30,11 +21,6 @@ import net.minecraft.pathfinding.PathEntity;
|
|||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAITargetAggro;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.IceProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
|
||||
{
|
||||
|
@ -48,31 +34,23 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
|
|||
{
|
||||
super(par1World, AlchemicalWizardry.entityIceDemonID);
|
||||
this.setSize(0.5F, 2.0F);
|
||||
//this.getNavigator().setAvoidsWater(true);
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
this.tasks.addTask(2, this.aiSit);
|
||||
//this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
|
||||
//this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
|
||||
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
|
||||
//this.tasks.addTask(6, new EntityAIMate(this, 1.0D));
|
||||
this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
|
||||
//this.tasks.addTask(8, new EntityAIBeg(this, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAILookIdle(this));
|
||||
this.tasks.addTask(3, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
|
||||
this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
|
||||
this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(6, new EntityAILookIdle(this));
|
||||
this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
|
||||
this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
|
||||
this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
|
||||
this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false));
|
||||
this.setAggro(false);
|
||||
//this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
|
||||
this.setTamed(false);
|
||||
|
||||
if (par1World != null && !par1World.isRemote)
|
||||
{
|
||||
this.setCombatTask();
|
||||
}
|
||||
|
||||
//this.isImmuneToFire = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -90,8 +68,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
|
|||
{
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
|
||||
}
|
||||
|
||||
//this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -131,7 +107,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
|
|||
super.entityInit();
|
||||
this.dataWatcher.addObject(18, new Float(this.getHealth()));
|
||||
this.dataWatcher.addObject(19, new Byte((byte) 0));
|
||||
//this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -210,12 +185,12 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
|
|||
{
|
||||
super.onLivingUpdate();
|
||||
int range = 2;
|
||||
|
||||
|
||||
Vec3 blockVector = SpellHelper.getEntityBlockVector(this);
|
||||
|
||||
int xCoord = (int)(blockVector.xCoord);
|
||||
int yCoord = (int)(blockVector.yCoord);
|
||||
int zCoord = (int)(blockVector.zCoord);
|
||||
|
||||
int xCoord = (int) (blockVector.xCoord);
|
||||
int yCoord = (int) (blockVector.yCoord);
|
||||
int zCoord = (int) (blockVector.zCoord);
|
||||
|
||||
for (int i = -range; i <= range; i++)
|
||||
{
|
||||
|
@ -330,7 +305,7 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
|
|||
}
|
||||
}
|
||||
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
{
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
@ -388,7 +363,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
|
|||
public boolean isBreedingItem(ItemStack par1ItemStack)
|
||||
{
|
||||
return false;
|
||||
//return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -468,7 +442,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
|
|||
*/
|
||||
protected boolean canDespawn()
|
||||
{
|
||||
//return !this.isTamed() && this.ticksExisted > 2400;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
|||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAITargetAggro;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -17,7 +16,6 @@ import net.minecraft.entity.passive.EntityHorse;
|
|||
import net.minecraft.entity.passive.EntityWolf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -40,15 +38,12 @@ public class EntityLowerGuardian extends EntityDemon
|
|||
this.setSize(0.7F, 1.8F);
|
||||
this.getNavigator().setAvoidsWater(true);
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
//this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
|
||||
this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0D, true));
|
||||
this.tasks.addTask(3, this.aiSit);
|
||||
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
|
||||
//this.tasks.addTask(6, new EntityAIMate(this, 1.0D));
|
||||
this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
|
||||
//this.tasks.addTask(8, new EntityAIBeg(this, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAILookIdle(this));
|
||||
this.tasks.addTask(4, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
|
||||
this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
|
||||
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(7, new EntityAILookIdle(this));
|
||||
this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
|
||||
this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
|
||||
this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
|
||||
|
@ -56,8 +51,6 @@ public class EntityLowerGuardian extends EntityDemon
|
|||
this.setAggro(false);
|
||||
this.setTamed(false);
|
||||
attackTimer = 0;
|
||||
//isAggro = false;
|
||||
//this.isImmuneToFire = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -75,8 +68,6 @@ public class EntityLowerGuardian extends EntityDemon
|
|||
{
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
|
||||
}
|
||||
|
||||
//this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -116,7 +107,6 @@ public class EntityLowerGuardian extends EntityDemon
|
|||
super.entityInit();
|
||||
this.dataWatcher.addObject(18, new Float(this.getHealth()));
|
||||
this.dataWatcher.addObject(19, new Byte((byte) 0));
|
||||
//this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -316,7 +306,7 @@ public class EntityLowerGuardian extends EntityDemon
|
|||
}
|
||||
}
|
||||
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
{
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
@ -374,7 +364,6 @@ public class EntityLowerGuardian extends EntityDemon
|
|||
public boolean isBreedingItem(ItemStack par1ItemStack)
|
||||
{
|
||||
return false;
|
||||
//return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -454,7 +443,6 @@ public class EntityLowerGuardian extends EntityDemon
|
|||
*/
|
||||
protected boolean canDespawn()
|
||||
{
|
||||
//return !this.isTamed() && this.ticksExisted > 2400;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ import WayofTime.alchemicalWizardry.ModItems;
|
|||
import WayofTime.alchemicalWizardry.common.EntityAITargetAggro;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.HolyProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -18,7 +17,6 @@ import net.minecraft.entity.passive.EntityHorse;
|
|||
import net.minecraft.entity.passive.EntityWolf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -28,7 +26,6 @@ import net.minecraft.world.World;
|
|||
|
||||
public class EntityShade extends EntityDemon
|
||||
{
|
||||
//private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 40, 40, 15.0F);
|
||||
private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false);
|
||||
|
||||
private static float maxTamedHealth = 50.0F;
|
||||
|
@ -41,28 +38,22 @@ public class EntityShade extends EntityDemon
|
|||
this.getNavigator().setAvoidsWater(true);
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
this.tasks.addTask(2, this.aiSit);
|
||||
//this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
|
||||
this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
|
||||
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
|
||||
//this.tasks.addTask(6, new EntityAIMate(this, 1.0D));
|
||||
this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
|
||||
//this.tasks.addTask(8, new EntityAIBeg(this, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAILookIdle(this));
|
||||
this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0D, true));
|
||||
this.tasks.addTask(4, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
|
||||
this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
|
||||
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(7, new EntityAILookIdle(this));
|
||||
this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
|
||||
this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
|
||||
this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
|
||||
this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false));
|
||||
this.setAggro(false);
|
||||
//this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
|
||||
this.setTamed(false);
|
||||
|
||||
if (par1World != null && !par1World.isRemote)
|
||||
{
|
||||
this.setCombatTask();
|
||||
}
|
||||
|
||||
//this.isImmuneToFire = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -80,8 +71,6 @@ public class EntityShade extends EntityDemon
|
|||
{
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
|
||||
}
|
||||
|
||||
//this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -121,7 +110,6 @@ public class EntityShade extends EntityDemon
|
|||
super.entityInit();
|
||||
this.dataWatcher.addObject(18, new Float(this.getHealth()));
|
||||
this.dataWatcher.addObject(19, new Byte((byte) 0));
|
||||
//this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -300,7 +288,7 @@ public class EntityShade extends EntityDemon
|
|||
}
|
||||
}
|
||||
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
{
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
@ -358,7 +346,6 @@ public class EntityShade extends EntityDemon
|
|||
public boolean isBreedingItem(ItemStack par1ItemStack)
|
||||
{
|
||||
return false;
|
||||
//return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -438,7 +425,6 @@ public class EntityShade extends EntityDemon
|
|||
*/
|
||||
protected boolean canDespawn()
|
||||
{
|
||||
//return !this.isTamed() && this.ticksExisted > 2400;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,20 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.mob;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IRangedAttackMob;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAIArrowAttack;
|
||||
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
|
||||
import net.minecraft.entity.ai.EntityAIFollowOwner;
|
||||
import net.minecraft.entity.ai.EntityAIHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAILookIdle;
|
||||
import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAIOwnerHurtTarget;
|
||||
import net.minecraft.entity.ai.EntityAISwimming;
|
||||
import net.minecraft.entity.ai.EntityAIWander;
|
||||
import net.minecraft.entity.ai.EntityAIWatchClosest;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAITargetAggro;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.ai.*;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
|
@ -28,11 +20,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAITargetAggro;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.MudProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackMob
|
||||
{
|
||||
|
@ -49,28 +36,21 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
|
|||
this.getNavigator().setAvoidsWater(true);
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
this.tasks.addTask(2, this.aiSit);
|
||||
//this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
|
||||
//this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
|
||||
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
|
||||
//this.tasks.addTask(6, new EntityAIMate(this, 1.0D));
|
||||
this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
|
||||
//this.tasks.addTask(8, new EntityAIBeg(this, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAILookIdle(this));
|
||||
this.tasks.addTask(3, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
|
||||
this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
|
||||
this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(5, new EntityAILookIdle(this));
|
||||
this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
|
||||
this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
|
||||
this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
|
||||
this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false));
|
||||
this.setAggro(false);
|
||||
//this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
|
||||
this.setTamed(false);
|
||||
|
||||
if (par1World != null && !par1World.isRemote)
|
||||
{
|
||||
this.setCombatTask();
|
||||
}
|
||||
|
||||
//this.isImmuneToFire = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -88,8 +68,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
|
|||
{
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
|
||||
}
|
||||
|
||||
//this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -129,7 +107,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
|
|||
super.entityInit();
|
||||
this.dataWatcher.addObject(18, new Float(this.getHealth()));
|
||||
this.dataWatcher.addObject(19, new Byte((byte) 0));
|
||||
//this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -307,7 +284,7 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
|
|||
}
|
||||
}
|
||||
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
{
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
@ -365,7 +342,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
|
|||
public boolean isBreedingItem(ItemStack par1ItemStack)
|
||||
{
|
||||
return false;
|
||||
//return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -445,7 +421,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
|
|||
*/
|
||||
protected boolean canDespawn()
|
||||
{
|
||||
//return !this.isTamed() && this.ticksExisted > 2400;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,21 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.mob;
|
||||
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IRangedAttackMob;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAIArrowAttack;
|
||||
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
|
||||
import net.minecraft.entity.ai.EntityAIFollowOwner;
|
||||
import net.minecraft.entity.ai.EntityAIHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAILookIdle;
|
||||
import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAIOwnerHurtTarget;
|
||||
import net.minecraft.entity.ai.EntityAISwimming;
|
||||
import net.minecraft.entity.ai.EntityAIWander;
|
||||
import net.minecraft.entity.ai.EntityAIWatchClosest;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAITargetAggro;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.ai.*;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
|
@ -23,18 +14,12 @@ import net.minecraft.entity.passive.EntityHorse;
|
|||
import net.minecraft.entity.passive.EntityWolf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.pathfinding.PathEntity;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAITargetAggro;
|
||||
import WayofTime.alchemicalWizardry.common.entity.projectile.FireProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackMob
|
||||
{
|
||||
|
@ -51,20 +36,15 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
|
|||
this.getNavigator().setAvoidsWater(true);
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
this.tasks.addTask(2, this.aiSit);
|
||||
//this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
|
||||
//this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
|
||||
this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
|
||||
//this.tasks.addTask(6, new EntityAIMate(this, 1.0D));
|
||||
this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
|
||||
//this.tasks.addTask(8, new EntityAIBeg(this, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(9, new EntityAILookIdle(this));
|
||||
this.tasks.addTask(3, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
|
||||
this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
|
||||
this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(6, new EntityAILookIdle(this));
|
||||
this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
|
||||
this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
|
||||
this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
|
||||
this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false));
|
||||
this.setAggro(false);
|
||||
//this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
|
||||
this.setTamed(false);
|
||||
|
||||
if (par1World != null && !par1World.isRemote)
|
||||
|
@ -131,7 +111,6 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
|
|||
super.entityInit();
|
||||
this.dataWatcher.addObject(18, new Float(this.getHealth()));
|
||||
this.dataWatcher.addObject(19, new Byte((byte) 0));
|
||||
//this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -309,7 +288,7 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
|
|||
}
|
||||
}
|
||||
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer)this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
if (this.getOwner() instanceof EntityPlayer && SpellHelper.getUsername(par1EntityPlayer).equalsIgnoreCase(SpellHelper.getUsername((EntityPlayer) this.getOwner())) && !this.isBreedingItem(itemstack))
|
||||
{
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
@ -367,7 +346,6 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
|
|||
public boolean isBreedingItem(ItemStack par1ItemStack)
|
||||
{
|
||||
return false;
|
||||
//return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -447,7 +425,6 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
|
|||
*/
|
||||
protected boolean canDespawn()
|
||||
{
|
||||
//return !this.isTamed() && this.ticksExisted > 2400;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.projectile;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.registry.IThrowableEntity;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -11,15 +11,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.registry.IThrowableEntity;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
//Shamelessly ripped off from x3n0ph0b3
|
||||
public class EnergyBlastProjectile extends Entity implements IProjectile, IThrowableEntity
|
||||
|
@ -252,8 +248,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
|
|||
|
||||
if (var18.equals(Block.getBlockById(inTile)) && var19 == inData)
|
||||
{
|
||||
// this.groundImpact();
|
||||
// this.setDead();
|
||||
}
|
||||
} else
|
||||
{
|
||||
|
@ -261,7 +255,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
|
|||
|
||||
if (ticksInAir > 1 && ticksInAir < 3)
|
||||
{
|
||||
//worldObj.spawnParticle("flame", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0D, 0D, 0D);
|
||||
for (int particles = 0; particles < 3; particles++)
|
||||
{
|
||||
this.doFiringParticles();
|
||||
|
@ -328,7 +321,6 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
|
|||
posZ += motionZ;
|
||||
MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
|
||||
this.setPosition(posX, posY, posZ);
|
||||
//this.doBlockCollisions();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -457,12 +449,10 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
|
|||
this.setDead();
|
||||
} else
|
||||
{
|
||||
//doDamage(8 + d6(), mop);
|
||||
if (mop instanceof EntityLivingBase)
|
||||
{
|
||||
((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2));
|
||||
}
|
||||
|
||||
doDamage(projectileDamage, mop);
|
||||
worldObj.createExplosion(shootingEntity, this.posX, this.posY, this.posZ, (float) (0.1), true);
|
||||
}
|
||||
|
@ -509,18 +499,18 @@ public class EnergyBlastProjectile extends Entity implements IProjectile, IThrow
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity getThrower()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return this.shootingEntity;
|
||||
}
|
||||
@Override
|
||||
public Entity getThrower()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return this.shootingEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setThrower(Entity entity)
|
||||
{
|
||||
if(entity instanceof EntityLivingBase)
|
||||
this.shootingEntity = (EntityLivingBase)entity;
|
||||
|
||||
}
|
||||
@Override
|
||||
public void setThrower(Entity entity)
|
||||
{
|
||||
if (entity instanceof EntityLivingBase)
|
||||
this.shootingEntity = (EntityLivingBase) entity;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,11 +6,11 @@ import net.minecraft.world.World;
|
|||
public class EntityBeamParticle extends EntityFX
|
||||
{
|
||||
|
||||
protected EntityBeamParticle(World p_i1218_1_, double p_i1218_2_,
|
||||
double p_i1218_4_, double p_i1218_6_)
|
||||
{
|
||||
super(p_i1218_1_, p_i1218_2_, p_i1218_4_, p_i1218_6_);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
protected EntityBeamParticle(World p_i1218_1_, double p_i1218_2_,
|
||||
double p_i1218_4_, double p_i1218_6_)
|
||||
{
|
||||
super(p_i1218_1_, p_i1218_2_, p_i1218_4_, p_i1218_6_);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.projectile;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
|
||||
|
||||
public class EntityBloodLightProjectile extends EnergyBlastProjectile
|
||||
|
@ -90,8 +89,6 @@ public class EntityBloodLightProjectile extends EnergyBlastProjectile
|
|||
{
|
||||
this.worldObj.setBlock(blockX + 1, blockY, blockZ, ModBlocks.blockBloodLight);
|
||||
}
|
||||
|
||||
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
|
@ -106,18 +103,11 @@ public class EntityBloodLightProjectile extends EnergyBlastProjectile
|
|||
this.setDead();
|
||||
} else
|
||||
{
|
||||
//doDamage(8 + d6(), mop);
|
||||
if (mop instanceof EntityLivingBase)
|
||||
{
|
||||
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
|
||||
|
||||
((EntityLivingBase) mop).setRevengeTarget(shootingEntity);
|
||||
|
||||
doDamage(1, mop);
|
||||
|
||||
}
|
||||
|
||||
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
|
||||
}
|
||||
|
||||
if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ))
|
||||
|
|
|
@ -68,7 +68,6 @@ public class EntityEnergyBazookaMainProjectile extends EnergyBlastProjectile
|
|||
this.setDead();
|
||||
} else
|
||||
{
|
||||
//doDamage(8 + d6(), mop);
|
||||
if (mop instanceof EntityLivingBase)
|
||||
{
|
||||
spawnSecondaryProjectiles();
|
||||
|
|
|
@ -195,8 +195,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
|
|||
|
||||
if (var18.equals(Block.getBlockById(inTile)) && var19 == inData)
|
||||
{
|
||||
// this.groundImpact();
|
||||
// this.setDead();
|
||||
}
|
||||
} else
|
||||
{
|
||||
|
@ -204,7 +202,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
|
|||
|
||||
if (ticksInAir > 1 && ticksInAir < 3)
|
||||
{
|
||||
//worldObj.spawnParticle("flame", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0D, 0D, 0D);
|
||||
for (int particles = 0; particles < 3; particles++)
|
||||
{
|
||||
this.doFiringParticles();
|
||||
|
@ -271,7 +268,6 @@ public class EntityEnergyBazookaSecondaryProjectile extends EnergyBlastProjectil
|
|||
posZ += motionZ;
|
||||
MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
|
||||
this.setPosition(posX, posY, posZ);
|
||||
//this.doBlockCollisions();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.projectile;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry;
|
||||
|
||||
public class EntityMeteor extends EnergyBlastProjectile
|
||||
{
|
||||
private int meteorID;
|
||||
|
||||
|
||||
public boolean hasTerrae;
|
||||
public boolean hasOrbisTerrae;
|
||||
public boolean hasCrystallos;
|
||||
|
@ -28,12 +28,12 @@ public class EntityMeteor extends EnergyBlastProjectile
|
|||
super(par1World, par2, par4, par6);
|
||||
this.meteorID = meteorID;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
super.writeEntityToNBT(par1NBTTagCompound);
|
||||
|
||||
|
||||
par1NBTTagCompound.setInteger("meteorID", meteorID);
|
||||
par1NBTTagCompound.setBoolean("hasTerrae", hasTerrae);
|
||||
par1NBTTagCompound.setBoolean("hasOrbisTerrae", hasOrbisTerrae);
|
||||
|
@ -46,7 +46,7 @@ public class EntityMeteor extends EnergyBlastProjectile
|
|||
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
|
||||
{
|
||||
super.readEntityFromNBT(par1NBTTagCompound);
|
||||
|
||||
|
||||
meteorID = par1NBTTagCompound.getInteger("meteorID");
|
||||
hasTerrae = par1NBTTagCompound.getBoolean("hasTerrae");
|
||||
hasOrbisTerrae = par1NBTTagCompound.getBoolean("hasOrbisTerrae");
|
||||
|
@ -83,7 +83,7 @@ public class EntityMeteor extends EnergyBlastProjectile
|
|||
@Override
|
||||
public void onImpact(Entity mop)
|
||||
{
|
||||
MeteorRegistry.createMeteorImpact(worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, meteorID, new boolean[]{hasTerrae, hasOrbisTerrae, hasCrystallos, hasIncendium, hasTennebrae});
|
||||
MeteorRegistry.createMeteorImpact(worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, meteorID, new boolean[]{hasTerrae, hasOrbisTerrae, hasCrystallos, hasIncendium, hasTennebrae});
|
||||
|
||||
this.setDead();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.projectile;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.registry.IThrowableEntity;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.particle.EntityCloudFX;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -9,10 +13,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.registry.IThrowableEntity;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
//Shamelessly ripped off from x3n0ph0b3
|
||||
public class EntityParticleBeam extends Entity implements IProjectile, IThrowableEntity
|
||||
|
@ -205,31 +205,29 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl
|
|||
posZ += motionZ;
|
||||
MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
|
||||
this.setPosition(posX, posY, posZ);
|
||||
|
||||
|
||||
this.doFiringParticles();
|
||||
|
||||
if(Math.pow(posX - xDest, 2) + Math.pow(posY - yDest, 2) + Math.pow(posZ - zDest, 2) <= 1)
|
||||
|
||||
if (Math.pow(posX - xDest, 2) + Math.pow(posY - yDest, 2) + Math.pow(posZ - zDest, 2) <= 1)
|
||||
{
|
||||
this.scheduledForDeath = true;
|
||||
this.scheduledForDeath = true;
|
||||
}
|
||||
|
||||
if(this.scheduledForDeath)
|
||||
|
||||
if (this.scheduledForDeath)
|
||||
{
|
||||
this.setDead();
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
public void doFiringParticles()
|
||||
{
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
//worldObj.spawnParticle("mobSpellAmbient", posX + smallGauss(0.1D), posY + smallGauss(0.1D), posZ + smallGauss(0.1D), 0.5D, 0.5D, 0.5D);
|
||||
EntityFX particle = new EntityCloudFX(worldObj, posX, posY, posZ, 0, 0, 0);
|
||||
particle.setRBGColorF(colourRed + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()), colourGreen + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()), colourBlue + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()));
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
|
||||
//worldObj.spawnParticle("happyVillager", posX, posY, posZ, 0, 0, 0);
|
||||
if (!worldObj.isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
EntityFX particle = new EntityCloudFX(worldObj, posX, posY, posZ, 0, 0, 0);
|
||||
particle.setRBGColorF(colourRed + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()), colourGreen + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()), colourBlue + 0.15f * (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()));
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -319,32 +317,32 @@ public class EntityParticleBeam extends Entity implements IProjectile, IThrowabl
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity getThrower()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return this.shootingEntity;
|
||||
}
|
||||
@Override
|
||||
public Entity getThrower()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return this.shootingEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setThrower(Entity entity)
|
||||
{
|
||||
if(entity instanceof EntityLivingBase)
|
||||
this.shootingEntity = (EntityLivingBase)entity;
|
||||
|
||||
}
|
||||
|
||||
public void setColour(float red, float green, float blue)
|
||||
{
|
||||
this.colourRed = red;
|
||||
this.colourGreen = green;
|
||||
this.colourBlue = blue;
|
||||
}
|
||||
|
||||
public void setDestination(int xDest, int yDest, int zDest)
|
||||
{
|
||||
this.xDest = xDest;
|
||||
this.yDest = yDest;
|
||||
this.zDest = zDest;
|
||||
}
|
||||
@Override
|
||||
public void setThrower(Entity entity)
|
||||
{
|
||||
if (entity instanceof EntityLivingBase)
|
||||
this.shootingEntity = (EntityLivingBase) entity;
|
||||
|
||||
}
|
||||
|
||||
public void setColour(float red, float green, float blue)
|
||||
{
|
||||
this.colourRed = red;
|
||||
this.colourGreen = green;
|
||||
this.colourBlue = blue;
|
||||
}
|
||||
|
||||
public void setDestination(int xDest, int yDest, int zDest)
|
||||
{
|
||||
this.xDest = xDest;
|
||||
this.yDest = yDest;
|
||||
this.zDest = zDest;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,22 +50,8 @@ public class ExplosionProjectile extends EnergyBlastProjectile
|
|||
}
|
||||
|
||||
worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (2), causesEnvDamage);
|
||||
//this.onImpact(mop.entityHit);
|
||||
} else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
// for(int i=-1;i<=1;i++)
|
||||
// {
|
||||
// for(int j=-1;j<=1;j++)
|
||||
// {
|
||||
// for(int k=-1;k<=1;k++)
|
||||
// {
|
||||
// if(worldObj.isAirBlock((int)this.posX+i, (int)this.posY+j, (int)this.posZ+k))
|
||||
// {
|
||||
// worldObj.setBlock( (int)this.posX+i, (int)this.posY+j, (int)this.posZ+k,Block.fire.blockID);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float) (2), causesEnvDamage);
|
||||
}
|
||||
|
||||
|
@ -81,12 +67,8 @@ public class ExplosionProjectile extends EnergyBlastProjectile
|
|||
this.setDead();
|
||||
} else
|
||||
{
|
||||
//doDamage(8 + d6(), mop);
|
||||
if (mop instanceof EntityLivingBase)
|
||||
{
|
||||
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
|
||||
//((EntityLivingBase)mop).setFire(50);
|
||||
//((EntityLivingBase)mop).setRevengeTarget(shootingEntity);
|
||||
if (((EntityLivingBase) mop).isImmuneToFire())
|
||||
{
|
||||
doDamage((int) (projectileDamage), mop);
|
||||
|
@ -95,13 +77,10 @@ public class ExplosionProjectile extends EnergyBlastProjectile
|
|||
doDamage(projectileDamage, mop);
|
||||
}
|
||||
}
|
||||
|
||||
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
|
||||
}
|
||||
|
||||
if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ))
|
||||
{
|
||||
//worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ,Block.fire.blockID);
|
||||
}
|
||||
|
||||
spawnHitParticles("magicCrit", 8);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.projectile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
@ -68,8 +67,6 @@ public class FireProjectile extends EnergyBlastProjectile
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
|
@ -84,10 +81,8 @@ public class FireProjectile extends EnergyBlastProjectile
|
|||
this.setDead();
|
||||
} else
|
||||
{
|
||||
//doDamage(8 + d6(), mop);
|
||||
if (mop instanceof EntityLivingBase)
|
||||
{
|
||||
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
|
||||
((EntityLivingBase) mop).setFire(50);
|
||||
((EntityLivingBase) mop).setRevengeTarget(shootingEntity);
|
||||
|
||||
|
@ -100,8 +95,6 @@ public class FireProjectile extends EnergyBlastProjectile
|
|||
((EntityLivingBase) mop).hurtResistantTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
|
||||
}
|
||||
|
||||
if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ))
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.projectile;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.PacketHandler;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class HolyProjectile extends EnergyBlastProjectile
|
||||
{
|
||||
|
@ -54,19 +53,6 @@ public class HolyProjectile extends EnergyBlastProjectile
|
|||
this.onImpact(mop.entityHit);
|
||||
} else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
// for(int i=-1;i<=1;i++)
|
||||
// {
|
||||
// for(int j=-1;j<=1;j++)
|
||||
// {
|
||||
// for(int k=-1;k<=1;k++)
|
||||
// {
|
||||
// if(worldObj.isAirBlock((int)this.posX+i, (int)this.posY+j, (int)this.posZ+k))
|
||||
// {
|
||||
// worldObj.setBlock( (int)this.posX+i, (int)this.posY+j, (int)this.posZ+k,Block.fire.blockID);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
|
@ -81,12 +67,8 @@ public class HolyProjectile extends EnergyBlastProjectile
|
|||
this.setDead();
|
||||
} else
|
||||
{
|
||||
//doDamage(8 + d6(), mop);
|
||||
if (mop instanceof EntityLivingBase)
|
||||
{
|
||||
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
|
||||
//((EntityLivingBase)mop).setFire(50);
|
||||
//((EntityLivingBase)mop).setRevengeTarget(shootingEntity);
|
||||
if (((EntityLivingBase) mop).isEntityUndead())
|
||||
{
|
||||
doDamage((int) (projectileDamage * 2), mop);
|
||||
|
@ -95,13 +77,10 @@ public class HolyProjectile extends EnergyBlastProjectile
|
|||
doDamage(projectileDamage, mop);
|
||||
}
|
||||
}
|
||||
|
||||
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
|
||||
}
|
||||
|
||||
if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ))
|
||||
{
|
||||
//worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ,Block.fire.blockID);
|
||||
}
|
||||
|
||||
spawnHitParticles("magicCrit", 8);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.projectile;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.potion.Potion;
|
||||
|
@ -7,9 +9,6 @@ import net.minecraft.potion.PotionEffect;
|
|||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.PacketHandler;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class IceProjectile extends EnergyBlastProjectile
|
||||
{
|
||||
|
@ -57,22 +56,7 @@ public class IceProjectile extends EnergyBlastProjectile
|
|||
this.onImpact(mop.entityHit);
|
||||
} else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
// for(int i=-1;i<=1;i++)
|
||||
// {
|
||||
// for(int j=-1;j<=1;j++)
|
||||
// {
|
||||
// for(int k=-1;k<=1;k++)
|
||||
// {
|
||||
// if(worldObj.isAirBlock((int)this.posX+i, (int)this.posY+j, (int)this.posZ+k))
|
||||
// {
|
||||
// worldObj.setBlock( (int)this.posX+i, (int)this.posY+j, (int)this.posZ+k,Block.fire.blockID);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
|
@ -85,12 +69,8 @@ public class IceProjectile extends EnergyBlastProjectile
|
|||
this.setDead();
|
||||
} else
|
||||
{
|
||||
//doDamage(8 + d6(), mop);
|
||||
if (mop instanceof EntityLivingBase)
|
||||
{
|
||||
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
|
||||
//((EntityLivingBase)mop).setFire(50);
|
||||
//((EntityLivingBase)mop).setRevengeTarget(shootingEntity);
|
||||
if (((EntityLivingBase) mop).isImmuneToFire())
|
||||
{
|
||||
doDamage((int) (projectileDamage * 2), mop);
|
||||
|
@ -101,8 +81,6 @@ public class IceProjectile extends EnergyBlastProjectile
|
|||
((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 1));
|
||||
}
|
||||
}
|
||||
|
||||
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
|
||||
}
|
||||
|
||||
if (worldObj.isAirBlock((int) this.posX, (int) this.posY, (int) this.posZ))
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.projectile;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
|
@ -7,7 +8,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class LightningBoltProjectile extends EnergyBlastProjectile
|
||||
{
|
||||
|
@ -68,23 +68,11 @@ public class LightningBoltProjectile extends EnergyBlastProjectile
|
|||
{
|
||||
if (mop == shootingEntity && ticksInAir > 3)
|
||||
{
|
||||
//shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1);
|
||||
this.setDead();
|
||||
} else
|
||||
{
|
||||
//doDamage(8 + d6(), mop);
|
||||
if (mop instanceof EntityLivingBase)
|
||||
{
|
||||
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
|
||||
//((EntityLivingBase)mop).setFire(50);
|
||||
//((EntityLivingBase)mop).setRevengeTarget(shootingEntity);
|
||||
// if(((EntityLivingBase)mop).isEntityUndead())
|
||||
// {
|
||||
// doDamage((int)(projectileDamage*2),mop);
|
||||
// }else
|
||||
// {
|
||||
// doDamage(projectileDamage, mop);
|
||||
// }
|
||||
if (causeLightning)
|
||||
{
|
||||
this.worldObj.addWeatherEffect(new EntityLightningBolt(this.worldObj, ((EntityLivingBase) mop).posX, ((EntityLivingBase) mop).posY, ((EntityLivingBase) mop).posZ));
|
||||
|
@ -92,11 +80,7 @@ public class LightningBoltProjectile extends EnergyBlastProjectile
|
|||
{
|
||||
doDamage(projectileDamage, mop);
|
||||
}
|
||||
|
||||
//((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2);
|
||||
}
|
||||
|
||||
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
|
||||
}
|
||||
|
||||
spawnHitParticles("magicCrit", 8);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.projectile;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -8,8 +9,6 @@ import net.minecraft.potion.PotionEffect;
|
|||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.PacketHandler;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class MudProjectile extends EnergyBlastProjectile
|
||||
{
|
||||
|
@ -72,23 +71,11 @@ public class MudProjectile extends EnergyBlastProjectile
|
|||
{
|
||||
if (mop == shootingEntity && ticksInAir > 3)
|
||||
{
|
||||
//shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1);
|
||||
this.setDead();
|
||||
} else
|
||||
{
|
||||
//doDamage(8 + d6(), mop);
|
||||
if (mop instanceof EntityLivingBase)
|
||||
{
|
||||
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
|
||||
//((EntityLivingBase)mop).setFire(50);
|
||||
//((EntityLivingBase)mop).setRevengeTarget(shootingEntity);
|
||||
// if(((EntityLivingBase)mop).isEntityUndead())
|
||||
// {
|
||||
// doDamage((int)(projectileDamage*2),mop);
|
||||
// }else
|
||||
// {
|
||||
// doDamage(projectileDamage, mop);
|
||||
// }
|
||||
if (doesBlindness)
|
||||
{
|
||||
((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 0));
|
||||
|
@ -96,12 +83,8 @@ public class MudProjectile extends EnergyBlastProjectile
|
|||
{
|
||||
((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2));
|
||||
}
|
||||
|
||||
doDamage(projectileDamage, mop);
|
||||
//((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2);
|
||||
}
|
||||
|
||||
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
|
||||
}
|
||||
|
||||
spawnHitParticles("magicCrit", 8);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.projectile;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.simple.SpellTeleport;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
@ -9,12 +11,10 @@ import net.minecraft.util.MovingObjectPosition;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.simple.SpellTeleport;
|
||||
|
||||
public class TeleportProjectile extends EnergyBlastProjectile
|
||||
{
|
||||
private boolean isEntityTeleport; //True if the entity firing teleports on hit
|
||||
private boolean isEntityTeleport;
|
||||
|
||||
public TeleportProjectile(World par1World)
|
||||
{
|
||||
|
@ -75,8 +75,7 @@ public class TeleportProjectile extends EnergyBlastProjectile
|
|||
{
|
||||
EntityPlayerMP entityplayermp = (EntityPlayerMP) shootingEntity;
|
||||
|
||||
if(entityplayermp.worldObj == this.worldObj)
|
||||
//if (!entityplayermp.playerNetServerHandler.connectionClosed && entityplayermp.worldObj == this.worldObj)
|
||||
if (entityplayermp.worldObj == this.worldObj)
|
||||
{
|
||||
EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, this.posX, this.posY, this.posZ, 5.0F);
|
||||
|
||||
|
@ -86,10 +85,7 @@ public class TeleportProjectile extends EnergyBlastProjectile
|
|||
{
|
||||
shootingEntity.mountEntity((Entity) null);
|
||||
}
|
||||
|
||||
shootingEntity.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ);
|
||||
// this.getThrower().fallDistance = 0.0F;
|
||||
// this.getThrower().attackEntityFrom(DamageSource.fall, event.attackDamage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -104,34 +100,19 @@ public class TeleportProjectile extends EnergyBlastProjectile
|
|||
{
|
||||
if (mop == shootingEntity && ticksInAir > 3)
|
||||
{
|
||||
//shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1);
|
||||
this.setDead();
|
||||
} else
|
||||
{
|
||||
//doDamage(8 + d6(), mop);
|
||||
if (mop instanceof EntityLivingBase)
|
||||
{
|
||||
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
|
||||
//((EntityLivingBase)mop).setFire(50);
|
||||
//((EntityLivingBase)mop).setRevengeTarget(shootingEntity);
|
||||
// if(((EntityLivingBase)mop).isEntityUndead())
|
||||
// {
|
||||
// doDamage((int)(projectileDamage*2),mop);
|
||||
// }else
|
||||
// {
|
||||
// doDamage(projectileDamage, mop);
|
||||
// }
|
||||
if (isEntityTeleport)
|
||||
{
|
||||
if (shootingEntity != null && shootingEntity instanceof EntityPlayerMP)
|
||||
{
|
||||
EntityPlayerMP entityplayermp = (EntityPlayerMP) shootingEntity;
|
||||
|
||||
if(entityplayermp.worldObj == this.worldObj)
|
||||
//if (!entityplayermp.playerNetServerHandler.connectionClosed && entityplayermp.worldObj == this.worldObj)
|
||||
if (entityplayermp.worldObj == this.worldObj)
|
||||
{
|
||||
EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, this.posX, this.posY, this.posZ, 5.0F);
|
||||
|
||||
if (!MinecraftForge.EVENT_BUS.post(event))
|
||||
{
|
||||
if (shootingEntity.isRiding())
|
||||
|
@ -140,42 +121,14 @@ public class TeleportProjectile extends EnergyBlastProjectile
|
|||
}
|
||||
|
||||
shootingEntity.setPositionAndUpdate(event.targetX, event.targetY, event.targetZ);
|
||||
// this.getThrower().fallDistance = 0.0F;
|
||||
// this.getThrower().attackEntityFrom(DamageSource.fall, event.attackDamage);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
// int x = (int)this.posX + mop.worldObj.rand.nextInt(100) - mop.worldObj.rand.nextInt(100);
|
||||
// int y = (int)this.posY + mop.worldObj.rand.nextInt(10) - mop.worldObj.rand.nextInt(10);
|
||||
// int z = (int)this.posZ + mop.worldObj.rand.nextInt(100) - mop.worldObj.rand.nextInt(100);
|
||||
//
|
||||
// boolean bool = false;
|
||||
// int i = 0;
|
||||
//
|
||||
// while(!bool&&i<100)
|
||||
// {
|
||||
// if(worldObj.isAirBlock(x, y, z)||worldObj.isAirBlock(x, y+1, z))
|
||||
// {
|
||||
// ((EntityLivingBase) mop).setPositionAndUpdate(x, y, z);
|
||||
// bool=true;
|
||||
// }else
|
||||
// {
|
||||
// x = (int)this.posX + mop.worldObj.rand.nextInt(100) - mop.worldObj.rand.nextInt(100);
|
||||
// y = (int)this.posY + mop.worldObj.rand.nextInt(10) - mop.worldObj.rand.nextInt(10);
|
||||
// z = (int)this.posZ + mop.worldObj.rand.nextInt(100) - mop.worldObj.rand.nextInt(100);
|
||||
// i++;
|
||||
// }
|
||||
// }
|
||||
SpellTeleport.teleportRandomly((EntityLivingBase) mop, 64);
|
||||
}
|
||||
|
||||
//doDamage(projectileDamage, mop);
|
||||
//((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2);
|
||||
}
|
||||
|
||||
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
|
||||
}
|
||||
|
||||
spawnHitParticles("magicCrit", 8);
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.projectile;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.PacketHandler;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class WaterProjectile extends EnergyBlastProjectile
|
||||
{
|
||||
|
@ -61,23 +60,11 @@ public class WaterProjectile extends EnergyBlastProjectile
|
|||
{
|
||||
if (mop == shootingEntity && ticksInAir > 3)
|
||||
{
|
||||
//shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1);
|
||||
this.setDead();
|
||||
} else
|
||||
{
|
||||
//doDamage(8 + d6(), mop);
|
||||
if (mop instanceof EntityLivingBase)
|
||||
{
|
||||
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
|
||||
//((EntityLivingBase)mop).setFire(50);
|
||||
//((EntityLivingBase)mop).setRevengeTarget(shootingEntity);
|
||||
// if(((EntityLivingBase)mop).isEntityUndead())
|
||||
// {
|
||||
// doDamage((int)(projectileDamage*2),mop);
|
||||
// }else
|
||||
// {
|
||||
// doDamage(projectileDamage, mop);
|
||||
// }
|
||||
if (((EntityLivingBase) mop).isImmuneToFire())
|
||||
{
|
||||
doDamage(projectileDamage * 2, mop);
|
||||
|
@ -87,11 +74,7 @@ public class WaterProjectile extends EnergyBlastProjectile
|
|||
doDamage(projectileDamage, mop);
|
||||
((EntityLivingBase) mop).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 80, 0));
|
||||
}
|
||||
|
||||
//((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2);
|
||||
}
|
||||
|
||||
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
|
||||
}
|
||||
|
||||
spawnHitParticles("magicCrit", 8);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package WayofTime.alchemicalWizardry.common.entity.projectile;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class WindGustProjectile extends EnergyBlastProjectile
|
||||
{
|
||||
|
@ -48,19 +48,6 @@ public class WindGustProjectile extends EnergyBlastProjectile
|
|||
this.onImpact(mop.entityHit);
|
||||
} else if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
// for(int i=-1;i<=1;i++)
|
||||
// {
|
||||
// for(int j=-1;j<=1;j++)
|
||||
// {
|
||||
// for(int k=-1;k<=1;k++)
|
||||
// {
|
||||
// if(worldObj.isAirBlock((int)this.posX+i, (int)this.posY+j, (int)this.posZ+k))
|
||||
// {
|
||||
// worldObj.setBlock( (int)this.posX+i, (int)this.posY+j, (int)this.posZ+k,Block.fire.blockID);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
|
@ -71,30 +58,15 @@ public class WindGustProjectile extends EnergyBlastProjectile
|
|||
{
|
||||
if (mop == shootingEntity && ticksInAir > 3)
|
||||
{
|
||||
//shootingEntity.attackEntityFrom(DamageSource.causePlayerDamage(shootingEntity), 1);
|
||||
this.setDead();
|
||||
} else
|
||||
{
|
||||
//doDamage(8 + d6(), mop);
|
||||
if (mop instanceof EntityLivingBase)
|
||||
{
|
||||
//((EntityLivingBase)mop).addPotionEffect(new PotionEffect(Potion.weakness.id, 60,2));
|
||||
//((EntityLivingBase)mop).setFire(50);
|
||||
//((EntityLivingBase)mop).setRevengeTarget(shootingEntity);
|
||||
// if(((EntityLivingBase)mop).isEntityUndead())
|
||||
// {
|
||||
// doDamage((int)(projectileDamage*2),mop);
|
||||
// }else
|
||||
// {
|
||||
// doDamage(projectileDamage, mop);
|
||||
// }
|
||||
((EntityLivingBase) mop).motionX = this.motionX * 2;
|
||||
((EntityLivingBase) mop).motionY = 1.5;
|
||||
((EntityLivingBase) mop).motionZ = this.motionZ * 2;
|
||||
//((EntityLivingBase)mop).setVelocity(this.motionX*2, ((EntityLivingBase)mop).motionY+1.5, this.motionZ*2);
|
||||
}
|
||||
|
||||
//worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(0.1), true);
|
||||
}
|
||||
|
||||
spawnHitParticles("magicCrit", 8);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.harvest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
@ -10,120 +9,121 @@ 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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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 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;
|
||||
}
|
||||
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.func_147480_a(xCoord, yCoord, zCoord, false);
|
||||
@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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
IPlantable seed = this.getSeedItem(block);
|
||||
|
||||
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;
|
||||
}
|
||||
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.func_147480_a(xCoord, yCoord, zCoord, false);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
|
@ -1,39 +1,32 @@
|
|||
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;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class CactusReedHarvestHandler implements IHarvestHandler
|
||||
{
|
||||
public boolean canHandleBlock(Block block)
|
||||
{
|
||||
return block == Blocks.reeds || block == Blocks.cactus;
|
||||
}
|
||||
public boolean canHandleBlock(Block block)
|
||||
{
|
||||
return block == Blocks.reeds || block == Blocks.cactus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta)
|
||||
{
|
||||
if(!this.canHandleBlock(block))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(world.getBlock(xCoord, yCoord-1, zCoord) != block || world.getBlock(xCoord, yCoord-2, zCoord) != block)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta)
|
||||
{
|
||||
if (!this.canHandleBlock(block))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
world.func_147480_a(xCoord, yCoord, zCoord, true);
|
||||
if (world.getBlock(xCoord, yCoord - 1, zCoord) != block || world.getBlock(xCoord, yCoord - 2, zCoord) != block)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
world.func_147480_a(xCoord, yCoord, zCoord, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,74 +1,67 @@
|
|||
package WayofTime.alchemicalWizardry.common.harvest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
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 GenericPamSeedlessFruitHarvestHandler implements IHarvestHandler
|
||||
{
|
||||
public Block harvestBlock;
|
||||
public int harvestMeta;
|
||||
public int resetMeta;
|
||||
|
||||
public GenericPamSeedlessFruitHarvestHandler(String block, int harvestMeta, int resetMeta)
|
||||
{
|
||||
this.harvestBlock = getBlockForString(block);
|
||||
this.harvestMeta = harvestMeta;
|
||||
this.resetMeta = resetMeta;
|
||||
}
|
||||
|
||||
public boolean isHarvesterValid()
|
||||
{
|
||||
return harvestBlock != null;
|
||||
}
|
||||
|
||||
public static Block getBlockForString(String str)
|
||||
{
|
||||
String[] parts = str.split(":");
|
||||
String modId = parts[0];
|
||||
String name = parts[1];
|
||||
return GameRegistry.findBlock(modId, name);
|
||||
}
|
||||
|
||||
public static Item getItemForString(String str)
|
||||
{
|
||||
String[] parts = str.split(":");
|
||||
String modId = parts[0];
|
||||
String name = parts[1];
|
||||
return GameRegistry.findItem(modId, name);
|
||||
}
|
||||
|
||||
public boolean canHandleBlock(Block block)
|
||||
{
|
||||
return block == harvestBlock;
|
||||
}
|
||||
public Block harvestBlock;
|
||||
public int harvestMeta;
|
||||
public int resetMeta;
|
||||
|
||||
public int getHarvestMeta(Block block)
|
||||
{
|
||||
return harvestMeta;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
world.func_147480_a(xCoord, yCoord, zCoord, true);
|
||||
|
||||
world.setBlock(xCoord, yCoord, zCoord, harvestBlock, resetMeta, 3);
|
||||
|
||||
return true;
|
||||
}
|
||||
public GenericPamSeedlessFruitHarvestHandler(String block, int harvestMeta, int resetMeta)
|
||||
{
|
||||
this.harvestBlock = getBlockForString(block);
|
||||
this.harvestMeta = harvestMeta;
|
||||
this.resetMeta = resetMeta;
|
||||
}
|
||||
|
||||
public boolean isHarvesterValid()
|
||||
{
|
||||
return harvestBlock != null;
|
||||
}
|
||||
|
||||
public static Block getBlockForString(String str)
|
||||
{
|
||||
String[] parts = str.split(":");
|
||||
String modId = parts[0];
|
||||
String name = parts[1];
|
||||
return GameRegistry.findBlock(modId, name);
|
||||
}
|
||||
|
||||
public static Item getItemForString(String str)
|
||||
{
|
||||
String[] parts = str.split(":");
|
||||
String modId = parts[0];
|
||||
String name = parts[1];
|
||||
return GameRegistry.findItem(modId, name);
|
||||
}
|
||||
|
||||
public boolean canHandleBlock(Block block)
|
||||
{
|
||||
return block == harvestBlock;
|
||||
}
|
||||
|
||||
public int getHarvestMeta(Block block)
|
||||
{
|
||||
return harvestMeta;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
world.func_147480_a(xCoord, yCoord, zCoord, true);
|
||||
|
||||
world.setBlock(xCoord, yCoord, zCoord, harvestBlock, resetMeta, 3);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,139 +1,137 @@
|
|||
package WayofTime.alchemicalWizardry.common.harvest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.harvest.IHarvestHandler;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GenericSeededHarvestHandler implements IHarvestHandler
|
||||
{
|
||||
public Block harvestBlock;
|
||||
public int harvestMeta;
|
||||
public IPlantable harvestSeed;
|
||||
|
||||
public GenericSeededHarvestHandler(String block, int meta, String seed)
|
||||
{
|
||||
harvestBlock = getBlockForString(block);
|
||||
harvestMeta = meta;
|
||||
Item testSeed = getItemForString(seed);
|
||||
if(testSeed instanceof IPlantable)
|
||||
{
|
||||
harvestSeed = (IPlantable)testSeed;
|
||||
}else
|
||||
{
|
||||
harvestSeed = null;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isHarvesterValid()
|
||||
{
|
||||
return harvestBlock != null && harvestSeed != null;
|
||||
}
|
||||
|
||||
public static Block getBlockForString(String str)
|
||||
{
|
||||
String[] parts = str.split(":");
|
||||
String modId = parts[0];
|
||||
String name = parts[1];
|
||||
return GameRegistry.findBlock(modId, name);
|
||||
}
|
||||
|
||||
public static Item getItemForString(String str)
|
||||
{
|
||||
String[] parts = str.split(":");
|
||||
String modId = parts[0];
|
||||
String name = parts[1];
|
||||
return GameRegistry.findItem(modId, name);
|
||||
}
|
||||
|
||||
public boolean canHandleBlock(Block block)
|
||||
{
|
||||
return block == harvestBlock;
|
||||
}
|
||||
public Block harvestBlock;
|
||||
public int harvestMeta;
|
||||
public IPlantable harvestSeed;
|
||||
|
||||
public int getHarvestMeta(Block block)
|
||||
{
|
||||
return harvestMeta;
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
world.func_147480_a(xCoord, yCoord, zCoord, true);
|
||||
public GenericSeededHarvestHandler(String block, int meta, String seed)
|
||||
{
|
||||
harvestBlock = getBlockForString(block);
|
||||
harvestMeta = meta;
|
||||
Item testSeed = getItemForString(seed);
|
||||
if (testSeed instanceof IPlantable)
|
||||
{
|
||||
harvestSeed = (IPlantable) testSeed;
|
||||
} else
|
||||
{
|
||||
harvestSeed = null;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}else
|
||||
{
|
||||
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.func_147480_a(xCoord, yCoord, zCoord, false);
|
||||
public boolean isHarvesterValid()
|
||||
{
|
||||
return harvestBlock != null && harvestSeed != null;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return harvestSeed;
|
||||
}
|
||||
public static Block getBlockForString(String str)
|
||||
{
|
||||
String[] parts = str.split(":");
|
||||
String modId = parts[0];
|
||||
String name = parts[1];
|
||||
return GameRegistry.findBlock(modId, name);
|
||||
}
|
||||
|
||||
public static Item getItemForString(String str)
|
||||
{
|
||||
String[] parts = str.split(":");
|
||||
String modId = parts[0];
|
||||
String name = parts[1];
|
||||
return GameRegistry.findItem(modId, name);
|
||||
}
|
||||
|
||||
public boolean canHandleBlock(Block block)
|
||||
{
|
||||
return block == harvestBlock;
|
||||
}
|
||||
|
||||
public int getHarvestMeta(Block block)
|
||||
{
|
||||
return harvestMeta;
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
world.func_147480_a(xCoord, yCoord, zCoord, true);
|
||||
|
||||
return true;
|
||||
} else
|
||||
{
|
||||
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.func_147480_a(xCoord, yCoord, zCoord, false);
|
||||
|
||||
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)
|
||||
{
|
||||
return harvestSeed;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,34 +1,25 @@
|
|||
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;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class GourdHarvestHandler implements IHarvestHandler
|
||||
{
|
||||
public boolean canHandleBlock(Block block)
|
||||
{
|
||||
return block == Blocks.melon_block || block == Blocks.pumpkin;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
world.func_147480_a(xCoord, yCoord, zCoord, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta)
|
||||
{
|
||||
if (!this.canHandleBlock(block))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
world.func_147480_a(xCoord, yCoord, zCoord, true);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -2,124 +2,124 @@ package WayofTime.alchemicalWizardry.common.harvest;
|
|||
|
||||
import WayofTime.alchemicalWizardry.api.harvest.HarvestRegistry;
|
||||
|
||||
public class PamHarvestCompatRegistry
|
||||
public class PamHarvestCompatRegistry
|
||||
{
|
||||
public static void registerPamHandlers()
|
||||
{
|
||||
registerSeededHandler("blackberry", 7);
|
||||
registerSeededHandler("blueberry", 7);
|
||||
registerSeededHandler("candleberry", 7);
|
||||
registerSeededHandler("raspberry", 7);
|
||||
registerSeededHandler("strawberry", 7);
|
||||
registerSeededHandler("cactusfruit", 7);
|
||||
registerSeededHandler("asparagus", 7);
|
||||
registerSeededHandler("barley", 7);
|
||||
registerSeededHandler("oats", 7);
|
||||
registerSeededHandler("rye", 7);
|
||||
registerSeededHandler("corn", 7);
|
||||
registerSeededHandler("bambooshoot", 7);
|
||||
registerSeededHandler("cantaloupe", 7);
|
||||
registerSeededHandler("cucumber", 7);
|
||||
registerSeededHandler("windersquash", 7);
|
||||
registerSeededHandler("zucchini", 7);
|
||||
registerSeededHandler("beat", 7);
|
||||
registerSeededHandler("onion", 7);
|
||||
registerSeededHandler("parsnip", 7);
|
||||
registerSeededHandler("peanut", 7);
|
||||
registerSeededHandler("radish", 7);
|
||||
registerSeededHandler("rutabaga", 7);
|
||||
registerSeededHandler("sweetpotato", 7);
|
||||
registerSeededHandler("turnip", 7);
|
||||
registerSeededHandler("rhubarb", 7);
|
||||
registerSeededHandler("celery", 7);
|
||||
registerSeededHandler("garlic", 7);
|
||||
registerSeededHandler("ginger", 7);
|
||||
registerSeededHandler("spiceleaf", 7);
|
||||
registerSeededHandler("tealeaf", 7);
|
||||
registerSeededHandler("coffeebean", 7);
|
||||
registerSeededHandler("mustardseeds", 7);
|
||||
registerSeededHandler("brocolli", 7);
|
||||
registerSeededHandler("cauliflower", 7);
|
||||
registerSeededHandler("leek", 7);
|
||||
registerSeededHandler("lettuce", 7);
|
||||
registerSeededHandler("scallion", 7);
|
||||
registerSeededHandler("artichoke", 7);
|
||||
registerSeededHandler("brusselsprout", 7);
|
||||
registerSeededHandler("cabbage", 7);
|
||||
registerSeededHandler("whitemushroom", 7);
|
||||
registerSeededHandler("bean", 7);
|
||||
registerSeededHandler("soybean", 7);
|
||||
registerSeededHandler("bellpepper", 7);
|
||||
registerSeededHandler("chili", 7);
|
||||
registerSeededHandler("eggplant", 7);
|
||||
registerSeededHandler("pamokra", 7);
|
||||
registerSeededHandler("peas", 7);
|
||||
registerSeededHandler("tomato", 7);
|
||||
registerSeededHandler("cotton", 7);
|
||||
registerSeededHandler("pineapple", 7);
|
||||
registerSeededHandler("grape", 7);
|
||||
registerSeededHandler("kiwi", 7);
|
||||
registerSeededHandler("cranberry", 7);
|
||||
registerSeededHandler("rice", 7);
|
||||
registerSeededHandler("seaweed", 7);
|
||||
public static void registerPamHandlers()
|
||||
{
|
||||
registerSeededHandler("blackberry", 7);
|
||||
registerSeededHandler("blueberry", 7);
|
||||
registerSeededHandler("candleberry", 7);
|
||||
registerSeededHandler("raspberry", 7);
|
||||
registerSeededHandler("strawberry", 7);
|
||||
registerSeededHandler("cactusfruit", 7);
|
||||
registerSeededHandler("asparagus", 7);
|
||||
registerSeededHandler("barley", 7);
|
||||
registerSeededHandler("oats", 7);
|
||||
registerSeededHandler("rye", 7);
|
||||
registerSeededHandler("corn", 7);
|
||||
registerSeededHandler("bambooshoot", 7);
|
||||
registerSeededHandler("cantaloupe", 7);
|
||||
registerSeededHandler("cucumber", 7);
|
||||
registerSeededHandler("windersquash", 7);
|
||||
registerSeededHandler("zucchini", 7);
|
||||
registerSeededHandler("beat", 7);
|
||||
registerSeededHandler("onion", 7);
|
||||
registerSeededHandler("parsnip", 7);
|
||||
registerSeededHandler("peanut", 7);
|
||||
registerSeededHandler("radish", 7);
|
||||
registerSeededHandler("rutabaga", 7);
|
||||
registerSeededHandler("sweetpotato", 7);
|
||||
registerSeededHandler("turnip", 7);
|
||||
registerSeededHandler("rhubarb", 7);
|
||||
registerSeededHandler("celery", 7);
|
||||
registerSeededHandler("garlic", 7);
|
||||
registerSeededHandler("ginger", 7);
|
||||
registerSeededHandler("spiceleaf", 7);
|
||||
registerSeededHandler("tealeaf", 7);
|
||||
registerSeededHandler("coffeebean", 7);
|
||||
registerSeededHandler("mustardseeds", 7);
|
||||
registerSeededHandler("brocolli", 7);
|
||||
registerSeededHandler("cauliflower", 7);
|
||||
registerSeededHandler("leek", 7);
|
||||
registerSeededHandler("lettuce", 7);
|
||||
registerSeededHandler("scallion", 7);
|
||||
registerSeededHandler("artichoke", 7);
|
||||
registerSeededHandler("brusselsprout", 7);
|
||||
registerSeededHandler("cabbage", 7);
|
||||
registerSeededHandler("whitemushroom", 7);
|
||||
registerSeededHandler("bean", 7);
|
||||
registerSeededHandler("soybean", 7);
|
||||
registerSeededHandler("bellpepper", 7);
|
||||
registerSeededHandler("chili", 7);
|
||||
registerSeededHandler("eggplant", 7);
|
||||
registerSeededHandler("pamokra", 7);
|
||||
registerSeededHandler("peas", 7);
|
||||
registerSeededHandler("tomato", 7);
|
||||
registerSeededHandler("cotton", 7);
|
||||
registerSeededHandler("pineapple", 7);
|
||||
registerSeededHandler("grape", 7);
|
||||
registerSeededHandler("kiwi", 7);
|
||||
registerSeededHandler("cranberry", 7);
|
||||
registerSeededHandler("rice", 7);
|
||||
registerSeededHandler("seaweed", 7);
|
||||
|
||||
registerFruitHandler("apple", 7, 0);
|
||||
registerFruitHandler("Almond", 7, 0);
|
||||
registerFruitHandler("Apricot", 7, 0);
|
||||
registerFruitHandler("Avocado", 7, 0);
|
||||
registerFruitHandler("Banana", 7, 0);
|
||||
registerFruitHandler("Cashew", 7, 0);
|
||||
registerFruitHandler("Cherry", 7, 0);
|
||||
registerFruitHandler("Chestnut", 7, 0);
|
||||
registerFruitHandler("Cinnamon", 7, 0);
|
||||
registerFruitHandler("Coconut", 7, 0);
|
||||
registerFruitHandler("Date", 7, 0);
|
||||
registerFruitHandler("Dragonfruit", 7, 0);
|
||||
registerFruitHandler("Durian", 7, 0);
|
||||
registerFruitHandler("Fig", 7, 0);
|
||||
registerFruitHandler("Grapefruit", 7, 0);
|
||||
registerFruitHandler("Lemon", 7, 0);
|
||||
registerFruitHandler("Lime", 7, 0);
|
||||
registerFruitHandler("Maple", 7, 0);
|
||||
registerFruitHandler("Mango", 7, 0);
|
||||
registerFruitHandler("Nutmeg", 7, 0);
|
||||
registerFruitHandler("Olive", 7, 0);
|
||||
registerFruitHandler("Orange", 7, 0);
|
||||
registerFruitHandler("Papaya", 7, 0);
|
||||
registerFruitHandler("Paperbark", 7, 0);
|
||||
registerFruitHandler("Peach", 7, 0);
|
||||
registerFruitHandler("Pear", 7, 0);
|
||||
registerFruitHandler("Pecan", 7, 0);
|
||||
registerFruitHandler("Peppercorn", 7, 0);
|
||||
registerFruitHandler("Persimmon", 7, 0);
|
||||
registerFruitHandler("Pistachio", 7, 0);
|
||||
registerFruitHandler("Plum", 7, 0);
|
||||
registerFruitHandler("Pomegranate", 7, 0);
|
||||
registerFruitHandler("Starfruit", 7, 0);
|
||||
registerFruitHandler("Vanillabean", 7, 0);
|
||||
registerFruitHandler("Walnut", 7, 0);
|
||||
}
|
||||
|
||||
public static void registerSeededHandler(String name, int meta)
|
||||
{
|
||||
String block = "harvestcraft:pam" + name + "Crop";
|
||||
String seed = "harvestcraft:" + name + "Item";
|
||||
|
||||
GenericSeededHarvestHandler handler = new GenericSeededHarvestHandler(block, meta, seed);
|
||||
if(handler.isHarvesterValid())
|
||||
{
|
||||
HarvestRegistry.registerHarvestHandler(handler);
|
||||
}
|
||||
}
|
||||
|
||||
public static void registerFruitHandler(String name, int harvestMeta, int resetMeta)
|
||||
{
|
||||
String block = "harvestcraft:pam" + name;
|
||||
|
||||
GenericPamSeedlessFruitHarvestHandler handler = new GenericPamSeedlessFruitHarvestHandler(block, harvestMeta, resetMeta);
|
||||
if(handler.isHarvesterValid())
|
||||
{
|
||||
HarvestRegistry.registerHarvestHandler(handler);
|
||||
}
|
||||
}
|
||||
registerFruitHandler("apple", 7, 0);
|
||||
registerFruitHandler("Almond", 7, 0);
|
||||
registerFruitHandler("Apricot", 7, 0);
|
||||
registerFruitHandler("Avocado", 7, 0);
|
||||
registerFruitHandler("Banana", 7, 0);
|
||||
registerFruitHandler("Cashew", 7, 0);
|
||||
registerFruitHandler("Cherry", 7, 0);
|
||||
registerFruitHandler("Chestnut", 7, 0);
|
||||
registerFruitHandler("Cinnamon", 7, 0);
|
||||
registerFruitHandler("Coconut", 7, 0);
|
||||
registerFruitHandler("Date", 7, 0);
|
||||
registerFruitHandler("Dragonfruit", 7, 0);
|
||||
registerFruitHandler("Durian", 7, 0);
|
||||
registerFruitHandler("Fig", 7, 0);
|
||||
registerFruitHandler("Grapefruit", 7, 0);
|
||||
registerFruitHandler("Lemon", 7, 0);
|
||||
registerFruitHandler("Lime", 7, 0);
|
||||
registerFruitHandler("Maple", 7, 0);
|
||||
registerFruitHandler("Mango", 7, 0);
|
||||
registerFruitHandler("Nutmeg", 7, 0);
|
||||
registerFruitHandler("Olive", 7, 0);
|
||||
registerFruitHandler("Orange", 7, 0);
|
||||
registerFruitHandler("Papaya", 7, 0);
|
||||
registerFruitHandler("Paperbark", 7, 0);
|
||||
registerFruitHandler("Peach", 7, 0);
|
||||
registerFruitHandler("Pear", 7, 0);
|
||||
registerFruitHandler("Pecan", 7, 0);
|
||||
registerFruitHandler("Peppercorn", 7, 0);
|
||||
registerFruitHandler("Persimmon", 7, 0);
|
||||
registerFruitHandler("Pistachio", 7, 0);
|
||||
registerFruitHandler("Plum", 7, 0);
|
||||
registerFruitHandler("Pomegranate", 7, 0);
|
||||
registerFruitHandler("Starfruit", 7, 0);
|
||||
registerFruitHandler("Vanillabean", 7, 0);
|
||||
registerFruitHandler("Walnut", 7, 0);
|
||||
}
|
||||
|
||||
public static void registerSeededHandler(String name, int meta)
|
||||
{
|
||||
String block = "harvestcraft:pam" + name + "Crop";
|
||||
String seed = "harvestcraft:" + name + "Item";
|
||||
|
||||
GenericSeededHarvestHandler handler = new GenericSeededHarvestHandler(block, meta, seed);
|
||||
if (handler.isHarvesterValid())
|
||||
{
|
||||
HarvestRegistry.registerHarvestHandler(handler);
|
||||
}
|
||||
}
|
||||
|
||||
public static void registerFruitHandler(String name, int harvestMeta, int resetMeta)
|
||||
{
|
||||
String block = "harvestcraft:pam" + name;
|
||||
|
||||
GenericPamSeedlessFruitHarvestHandler handler = new GenericPamSeedlessFruitHarvestHandler(block, harvestMeta, resetMeta);
|
||||
if (handler.isHarvesterValid())
|
||||
{
|
||||
HarvestRegistry.registerHarvestHandler(handler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AWBaseItems extends Item
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -13,13 +13,9 @@ import net.minecraft.util.EnumChatFormatting;
|
|||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.AlchemyRecipeRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
public class ActivationCrystal extends EnergyItems
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class AirScribeTool extends ScribeTool
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class ApprenticeBloodOrb extends EnergyBattery
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class ArchmageBloodOrb extends EnergyBattery
|
||||
{
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -12,9 +11,8 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ArmourInhibitor extends EnergyItems
|
||||
{
|
||||
|
@ -26,7 +24,6 @@ public class ArmourInhibitor extends EnergyItems
|
|||
{
|
||||
super();
|
||||
this.maxStackSize = 1;
|
||||
//setMaxDamage(1000);
|
||||
setEnergyUsed(0);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
@ -92,23 +89,6 @@ public class ArmourInhibitor extends EnergyItems
|
|||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
// {
|
||||
//
|
||||
// if(applyBonemeal(par1ItemStack,par3World,par4,par5,par6,par2EntityPlayer))
|
||||
// {
|
||||
// if (par3World.isRemote)
|
||||
// {
|
||||
// par3World.playAuxSFX(2005, par4, par5, par6, 0);
|
||||
// EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed());
|
||||
// return true;
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
|
@ -134,7 +114,6 @@ public class ArmourInhibitor extends EnergyItems
|
|||
|
||||
if (!par3EntityPlayer.capabilities.isCreativeMode)
|
||||
{
|
||||
//EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, getEnergyUsed());
|
||||
}
|
||||
} else
|
||||
{
|
||||
|
@ -163,7 +142,6 @@ public class ArmourInhibitor extends EnergyItems
|
|||
{
|
||||
if (par2World.getWorldTime() % tickDelay == par1ItemStack.stackTagCompound.getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer)
|
||||
{
|
||||
//EnergyItems.syphonBatteries(par1ItemStack, (EntityPlayer)par3Entity, getEnergyUsed());
|
||||
}
|
||||
|
||||
//TODO Do stuff
|
||||
|
@ -172,44 +150,4 @@ public class ArmourInhibitor extends EnergyItems
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack) {
|
||||
//
|
||||
// int range = 5;
|
||||
// int verticalRange = 2;
|
||||
// int posX = (int)Math.round(player.posX-0.5f);
|
||||
// int posY = (int)player.posY;
|
||||
// int posZ = (int)Math.round(player.posZ-0.5f);
|
||||
//
|
||||
// for(int ix=posX-range;ix<=posX+range;ix++)
|
||||
// {
|
||||
// for(int iz=posZ-range;iz<=posZ+range;iz++)
|
||||
// {
|
||||
// for(int iy=posY-verticalRange;iy<=posY+verticalRange;iy++)
|
||||
// {
|
||||
// int id = world.getBlockId(ix, iy, iz);
|
||||
// Block block = Block.blocksList[id];
|
||||
// if(block instanceof IPlantable)
|
||||
// {
|
||||
// if(world.rand.nextInt(10)==0)
|
||||
// block.updateTick(world, ix, iy, iz, world.rand);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public boolean isUpgrade() {
|
||||
// // TODO Auto-generated method stub
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getEnergyForTenSeconds() {
|
||||
// // TODO Auto-generated method stub
|
||||
// return 50;
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -9,10 +11,8 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEHomHeart;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlankSpell extends EnergyItems
|
||||
{
|
||||
|
@ -61,7 +61,6 @@ public class BlankSpell extends EnergyItems
|
|||
|
||||
if (!par2World.isRemote)
|
||||
{
|
||||
//World world = MinecraftServer.getServer().worldServers[getDimensionID(par1ItemStack)];
|
||||
World world = DimensionManager.getWorld(getDimensionID(par1ItemStack));
|
||||
|
||||
if (world != null)
|
||||
|
@ -92,13 +91,7 @@ public class BlankSpell extends EnergyItems
|
|||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.fizz", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
// if (!par2World.isRemote)
|
||||
// {
|
||||
// //par2World.spawnEntityInWorld(new EnergyBlastProjectile(par2World, par3EntityPlayer, damage));
|
||||
// par2World.spawnEntityInWorld(new FireProjectile(par2World, par3EntityPlayer, 10));
|
||||
// }
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BloodShard extends Item implements ArmourUpgrade
|
||||
{
|
||||
|
@ -17,7 +17,6 @@ public class BloodShard extends Item implements ArmourUpgrade
|
|||
{
|
||||
super();
|
||||
this.maxStackSize = 64;
|
||||
//setEnergyUsed(100);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
|
@ -40,8 +39,8 @@ public class BloodShard extends Item implements ArmourUpgrade
|
|||
|
||||
public int getBloodShardLevel()
|
||||
{
|
||||
if (this.equals(ModItems.weakBloodShard))
|
||||
{
|
||||
if (this.equals(ModItems.weakBloodShard))
|
||||
{
|
||||
return 1;
|
||||
} else if (this.equals(ModItems.demonBloodShard))
|
||||
{
|
||||
|
@ -54,20 +53,17 @@ public class BloodShard extends Item implements ArmourUpgrade
|
|||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpgrade()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyForTenSeconds()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue