Moar Omega, fixed Bound tool check to see if block is silk-touchable

This commit is contained in:
WayofTime 2015-01-14 17:26:14 -05:00
parent 6cb1e06306
commit ac5a20d5b2
10 changed files with 89 additions and 6 deletions

View file

@ -116,6 +116,7 @@ import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour;
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigmEarth;
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigmWater;
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigmWind;
import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry;
import WayofTime.alchemicalWizardry.common.potion.PotionAmphibian;
import WayofTime.alchemicalWizardry.common.potion.PotionBoost;
@ -1321,6 +1322,7 @@ public class AlchemicalWizardry
OmegaRegistry.registerParadigm(ReagentRegistry.aquasalusReagent, new OmegaParadigmWater(ModItems.boundHelmetWater, ModItems.boundPlateWater, ModItems.boundLeggingsWater, ModItems.boundBootsWater));
OmegaRegistry.registerParadigm(ReagentRegistry.terraeReagent, new OmegaParadigmEarth(ModItems.boundHelmetEarth, ModItems.boundPlateEarth, ModItems.boundLeggingsEarth, ModItems.boundBootsEarth));
OmegaRegistry.registerParadigm(ReagentRegistry.aetherReagent, new OmegaParadigmWind(ModItems.boundHelmetWind, ModItems.boundPlateWind, ModItems.boundLeggingsWind, ModItems.boundBootsWind));
}
public static void initDemonPacketRegistiry()

View file

@ -81,7 +81,7 @@ public class AlchemicalWizardryEventHooks
EntityPlayer player = (EntityPlayer)event.entityLiving;
float prevHp = APISpellHelper.getCurrentAdditionalHP((EntityPlayer)event.entityLiving);
if(prevHp > 0) //TODO change the HP values to floats
if(prevHp > 0)
{
float recalculatedAmount = ArmorProperties.ApplyArmor(player, player.inventory.armorInventory, event.source, event.ammount);
if (recalculatedAmount <= 0) return;
@ -102,6 +102,20 @@ public class AlchemicalWizardryEventHooks
}else
{
event.ammount += hp / ratio;
Reagent reagent = APISpellHelper.getPlayerReagentType(player);
OmegaParadigm paradigm = OmegaRegistry.getParadigmForReagent(reagent);
if(paradigm != null)
{
ItemStack chestStack = player.inventory.armorInventory[2];
if(chestStack != null && chestStack.getItem() instanceof OmegaArmour)
{
if(((OmegaArmour)chestStack.getItem()).paradigm == paradigm)
{
paradigm.onHPBarDepleted(player, chestStack);
}
}
}
}
APISpellHelper.setCurrentAdditionalHP((EntityPlayer)event.entityLiving, Math.max(0, hp));

View file

@ -151,7 +151,7 @@ public class BoundAxe extends ItemAxe implements IBindable
if (str > 1.1f || block instanceof BlockLeavesBase && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k))
{
if (silkTouch)
if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta))
{
ItemStack droppedItem = new ItemStack(block, 1, meta);

View file

@ -158,7 +158,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
if (str > 1.1f && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k))
{
if (silkTouch)
if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta))
{
ItemStack droppedItem = new ItemStack(block, 1, meta);

View file

@ -157,7 +157,7 @@ public class BoundShovel extends ItemSpade implements IBindable
if (str > 1.1f && par2World.canMineBlock(par3EntityPlayer, posX + i, posY + j, posZ + k))
{
if (silkTouch)
if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta))
{
ItemStack droppedItem = new ItemStack(block, 1, meta);

View file

@ -55,6 +55,11 @@ public abstract class OmegaArmour extends BoundArmour
public ItemStack getSubstituteStack(ItemStack boundStack)
{
ItemStack omegaStack = new ItemStack(this);
if(boundStack != null && boundStack.hasTagCompound())
{
NBTTagCompound tag = (NBTTagCompound) boundStack.getTagCompound().copy();
omegaStack.setTagCompound(tag);
}
this.setContainedArmourStack(omegaStack, boundStack);
SoulNetworkHandler.checkAndSetItemOwner(omegaStack, SoulNetworkHandler.getOwnerName(boundStack));
return omegaStack;

View file

@ -100,4 +100,9 @@ public class OmegaParadigm
{
return false;
}
public boolean onHPBarDepleted(EntityPlayer player, ItemStack stack)
{
return false;
}
}

View file

@ -44,7 +44,7 @@ public class OmegaParadigmWater extends OmegaParadigm
{
if(entity instanceof EntityLivingBase)
{
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 100, 1));
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionDrowning.id, 100, 1, true));
}
return true;
}

View file

@ -0,0 +1,46 @@
package WayofTime.alchemicalWizardry.common.omega;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour;
public class OmegaParadigmWind extends OmegaParadigm
{
public OmegaParadigmWind(OmegaArmour helmet, OmegaArmour chestPiece, OmegaArmour leggings, OmegaArmour boots)
{
super(ReagentRegistry.aetherReagent, helmet, chestPiece, leggings, boots, new ReagentRegenConfiguration(50, 10, 100));
}
@Override
public float getCostPerTickOfUse(EntityPlayer player)
{
if(player.isAirBorne)
{
return 0.5f;
}else
{
return 1;
}
}
@Override
public void onUpdate(World world, EntityPlayer player, ItemStack stack)
{
}
@Override
public boolean getBlockEffectWhileInside(Entity entity, int x, int y, int z)
{
return true;
}
@Override
public void onOmegaKeyPressed(EntityPlayer player, ItemStack stack)
{
}
}

View file

@ -112,7 +112,9 @@ public class TEMimicBlock extends TileEntity
return false;
}
if (world.getTileEntity(x, y, z) == null && world.isAirBlock(x, y, z))
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity == null && world.isAirBlock(x, y, z))
{
ItemStack item = new ItemStack(block, 1, meta);
@ -126,6 +128,15 @@ public class TEMimicBlock extends TileEntity
world.markBlockForUpdate(x, y, z);
return true;
}
}else
{
if(tileEntity instanceof TEMimicBlock)
{
if(((TEMimicBlock) tileEntity).getBlock() == block && ((TEMimicBlock) tileEntity).getMetaOfMimic() == meta)
{
((TEMimicBlock) tileEntity).ticksRemaining = Math.max(duration, ((TEMimicBlock) tileEntity).ticksRemaining);
}
}
}
return false;