Moar Omega, fixed Bound tool check to see if block is silk-touchable
This commit is contained in:
parent
6cb1e06306
commit
ac5a20d5b2
|
@ -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()
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -100,4 +100,9 @@ public class OmegaParadigm
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onHPBarDepleted(EntityPlayer player, ItemStack stack)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue