Massive rework of configs, items and blocks.
I redone where the items/blocsks are stored and how the configs are handled to clean up it and give space. You can change the config line to AWWayofTime if you want to keep the compatibility with old configs. Now you reference the blocks from the ModBlocks and Items from the ModItems.
This commit is contained in:
parent
8601e9faff
commit
e3644f2d2b
304 changed files with 3941 additions and 5108 deletions
|
@ -1,12 +1,8 @@
|
|||
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.common.entity.projectile.EnergyBlastProjectile;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
|
@ -19,13 +15,12 @@ import net.minecraftforge.event.ForgeSubscribe;
|
|||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class AlchemicalWizardryEventHooks
|
||||
{
|
||||
public static Map<String, Boolean> playerFlightBuff = new HashMap();
|
||||
public static Map<String, Boolean> playerBoostStepHeight = new HashMap();
|
||||
import java.util.*;
|
||||
|
||||
public class AlchemicalWizardryEventHooks {
|
||||
public static Map<String,Boolean> playerFlightBuff = new HashMap();
|
||||
public static Map<String,Boolean> playerBoostStepHeight = new HashMap();
|
||||
public static List<String> playersWith1Step = new ArrayList();
|
||||
|
||||
@ForgeSubscribe
|
||||
|
@ -51,7 +46,7 @@ public class AlchemicalWizardryEventHooks
|
|||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionReciprocation).getAmplifier();
|
||||
float damageRecieve = event.ammount / 2 * (i + 1);
|
||||
((EntityLivingBase)entityAttacking).attackEntityFrom(DamageSource.generic, damageRecieve);
|
||||
((EntityLivingBase) entityAttacking).attackEntityFrom(DamageSource.generic, damageRecieve);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,11 +60,11 @@ public class AlchemicalWizardryEventHooks
|
|||
@ForgeSubscribe
|
||||
public void onEntityUpdate(LivingUpdateEvent event)
|
||||
{
|
||||
EntityLivingBase entityLiving = event.entityLiving;
|
||||
EntityLivingBase entityLiving = event.entityLiving;
|
||||
|
||||
if (entityLiving instanceof EntityPlayer && entityLiving.worldObj.isRemote)
|
||||
{
|
||||
EntityPlayer entityPlayer = (EntityPlayer)entityLiving;
|
||||
EntityPlayer entityPlayer = (EntityPlayer) entityLiving;
|
||||
boolean highStepListed = playersWith1Step.contains(entityPlayer.username);
|
||||
boolean hasHighStep = entityPlayer.isPotionActive(AlchemicalWizardry.customPotionBoost);
|
||||
|
||||
|
@ -89,7 +84,7 @@ public class AlchemicalWizardryEventHooks
|
|||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionDrowning).getAmplifier();
|
||||
|
||||
if (event.entityLiving.worldObj.getWorldTime() % ((int)(20 / (i + 1))) == 0)
|
||||
if (event.entityLiving.worldObj.getWorldTime() % ((int) (20 / (i + 1))) == 0)
|
||||
{
|
||||
event.entityLiving.attackEntityFrom(DamageSource.drown, 2);
|
||||
event.entityLiving.hurtResistantTime = Math.min(event.entityLiving.hurtResistantTime, 20 / (i + 1));
|
||||
|
@ -106,13 +101,13 @@ public class AlchemicalWizardryEventHooks
|
|||
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer entityPlayer = (EntityPlayer)event.entityLiving;
|
||||
EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving;
|
||||
entityPlayer.stepHeight = 1.0f;
|
||||
|
||||
if (!entityPlayer.worldObj.isRemote)
|
||||
{
|
||||
float speed = ((Float)ReflectionHelper.getPrivateValue(PlayerCapabilities.class, entityPlayer.capabilities, new String[] { "walkSpeed", "g", "field_75097_g" })).floatValue();
|
||||
ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, entityPlayer.capabilities, Float.valueOf(speed + (float)percentIncrease), new String[] { "walkSpeed", "g", "field_75097_g" }); //CAUTION
|
||||
float speed = ((Float) ReflectionHelper.getPrivateValue(PlayerCapabilities.class, entityPlayer.capabilities, new String[]{"walkSpeed", "g", "field_75097_g"})).floatValue();
|
||||
ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, entityPlayer.capabilities, Float.valueOf(speed + (float) percentIncrease), new String[]{"walkSpeed", "g", "field_75097_g"}); //CAUTION
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -122,9 +117,9 @@ public class AlchemicalWizardryEventHooks
|
|||
{
|
||||
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionProjProt).getAmplifier();
|
||||
EntityLivingBase entity = event.entityLiving;
|
||||
int posX = (int)Math.round(entity.posX - 0.5f);
|
||||
int posY = (int)Math.round(entity.posY);
|
||||
int posZ = (int)Math.round(entity.posZ - 0.5f);
|
||||
int 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 = i;
|
||||
AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB(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);
|
||||
|
@ -133,7 +128,7 @@ public class AlchemicalWizardryEventHooks
|
|||
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
Entity projectile = (Entity)iterator.next();
|
||||
Entity projectile = (Entity) iterator.next();
|
||||
|
||||
if (projectile == null)
|
||||
{
|
||||
|
@ -147,17 +142,15 @@ public class AlchemicalWizardryEventHooks
|
|||
|
||||
if (projectile instanceof EntityArrow)
|
||||
{
|
||||
if (((EntityArrow)projectile).shootingEntity == null)
|
||||
if (((EntityArrow) projectile).shootingEntity == null)
|
||||
{
|
||||
}
|
||||
else if (!(((EntityArrow)projectile).shootingEntity == null) && ((EntityArrow)projectile).shootingEntity.equals(entity))
|
||||
} else if (!(((EntityArrow) projectile).shootingEntity == null) && ((EntityArrow) projectile).shootingEntity.equals(entity))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (projectile instanceof EnergyBlastProjectile)
|
||||
} else if (projectile instanceof EnergyBlastProjectile)
|
||||
{
|
||||
if (!(((EnergyBlastProjectile)projectile).shootingEntity == null) && ((EnergyBlastProjectile)projectile).shootingEntity.equals(entity))
|
||||
if (!(((EnergyBlastProjectile) projectile).shootingEntity == null) && ((EnergyBlastProjectile) projectile).shootingEntity.equals(entity))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -184,18 +177,17 @@ public class AlchemicalWizardryEventHooks
|
|||
{
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer entityPlayer = (EntityPlayer)event.entityLiving;
|
||||
EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving;
|
||||
String ownerName = entityPlayer.username;
|
||||
playerFlightBuff.put(ownerName, true);
|
||||
entityPlayer.capabilities.allowFlying = true;
|
||||
//entityPlayer.sendPlayerAbilities();
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
if (event.entityLiving instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer entityPlayer = (EntityPlayer)event.entityLiving;
|
||||
EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving;
|
||||
String ownerName = entityPlayer.username;
|
||||
|
||||
if (!playerFlightBuff.containsKey(ownerName))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue