Big commitment~
This commit is contained in:
parent
a92efa364d
commit
4f9fad22c5
24 changed files with 1122 additions and 182 deletions
|
@ -117,12 +117,19 @@ public class BoundArmour extends ItemArmor implements ISpecialArmor,IBindable ,I
|
|||
return new ArmorProperties(-1, 0, 0);
|
||||
}
|
||||
|
||||
if (helmet.getItem().equals(ModItems.boundHelmet) || plate.getItem().equals(ModItems.boundPlate) || leggings.getItem().equals(ModItems.boundLeggings) || boots.getItem().equals(ModItems.boundBoots))
|
||||
if (helmet.getItem().equals(ModItems.boundHelmet) && plate.getItem().equals(ModItems.boundPlate) && leggings.getItem().equals(ModItems.boundLeggings) && boots.getItem().equals(ModItems.boundBoots))
|
||||
{
|
||||
if (source.isUnblockable())
|
||||
{
|
||||
return new ArmorProperties(-1, 3, 4);
|
||||
}
|
||||
|
||||
if(player.isPotionActive(AlchemicalWizardry.customPotionSoulFray))
|
||||
{
|
||||
int i = player.getActivePotionEffect(AlchemicalWizardry.customPotionSoulFray).getAmplifier() + 1;
|
||||
|
||||
return new ArmorProperties(-1, 3, (int)(25*(1.0f - 0.15f*i)));
|
||||
}
|
||||
|
||||
return new ArmorProperties(-1, 3, 100000);
|
||||
}
|
||||
|
@ -209,7 +216,7 @@ public class BoundArmour extends ItemArmor implements ISpecialArmor,IBindable ,I
|
|||
//TODO Make the armour invisible when the player has Invisibility on.
|
||||
if (entity instanceof EntityLivingBase)
|
||||
{
|
||||
if (((EntityLivingBase) entity).isPotionActive(Potion.invisibility.id))
|
||||
if (this.getIsInvisible(stack))
|
||||
{
|
||||
if (this== ModItems.boundHelmet || this == ModItems.boundPlate || this == ModItems.boundBoots)
|
||||
{
|
||||
|
@ -265,6 +272,8 @@ public class BoundArmour extends ItemArmor implements ISpecialArmor,IBindable ,I
|
|||
{
|
||||
tickInternalInventory(itemStack, world, player, 0, false);
|
||||
}
|
||||
|
||||
this.setIsInvisible(itemStack, player.isPotionActive(Potion.invisibility.id));
|
||||
|
||||
if (itemStack.getItemDamage() > 0)
|
||||
{
|
||||
|
@ -577,6 +586,30 @@ public class BoundArmour extends ItemArmor implements ISpecialArmor,IBindable ,I
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean getIsInvisible(ItemStack armourStack)
|
||||
{
|
||||
NBTTagCompound tag = armourStack.getTagCompound();
|
||||
if(tag != null)
|
||||
{
|
||||
return tag.getBoolean("invisible");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setIsInvisible(ItemStack armourStack, boolean invisible)
|
||||
{
|
||||
NBTTagCompound tag = armourStack.getTagCompound();
|
||||
|
||||
if(tag == null)
|
||||
{
|
||||
armourStack.setTagCompound(new NBTTagCompound());
|
||||
tag = armourStack.getTagCompound();
|
||||
}
|
||||
|
||||
tag.setBoolean("invisible", invisible);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "Thaumcraft")
|
||||
|
|
|
@ -82,7 +82,13 @@ public class SacrificialDagger extends Item
|
|||
return par1ItemStack;
|
||||
}
|
||||
|
||||
findAndFillAltar(par2World, par3EntityPlayer, 200);
|
||||
if(par3EntityPlayer.isPotionActive(AlchemicalWizardry.customPotionSoulFray))
|
||||
{
|
||||
findAndFillAltar(par2World, par3EntityPlayer, 20);
|
||||
}else
|
||||
{
|
||||
findAndFillAltar(par2World, par3EntityPlayer, 200);
|
||||
}
|
||||
|
||||
if (par3EntityPlayer.getHealth() <= 0.001f)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.sigil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -21,6 +22,8 @@ import net.minecraftforge.fluids.FluidStack;
|
|||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -32,7 +35,8 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem
|
|||
private static final int STATE_PLACE = 2;
|
||||
private static final int STATE_INPUT_TANK = 3;
|
||||
private static final int STATE_DRAIN_TANK = 4;
|
||||
private static final int maxNumOfStates = 5;
|
||||
private static final int STATE_BEAST_DRAIN = 5;
|
||||
private static final int maxNumOfStates = 6;
|
||||
|
||||
public ItemFluidSigil()
|
||||
{
|
||||
|
@ -68,6 +72,9 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem
|
|||
case STATE_DRAIN_TANK:
|
||||
par3List.add("Drain Tank Mode");
|
||||
break;
|
||||
case STATE_BEAST_DRAIN:
|
||||
par3List.add("Beast Mode");
|
||||
break;
|
||||
}
|
||||
|
||||
FluidStack fluid = this.getFluid(par1ItemStack);
|
||||
|
@ -118,6 +125,8 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem
|
|||
return this.fillSelectedTank(par1ItemStack, par2World, par3EntityPlayer);
|
||||
case STATE_DRAIN_TANK:
|
||||
return this.drainSelectedTank(par1ItemStack, par2World, par3EntityPlayer);
|
||||
case STATE_BEAST_DRAIN:
|
||||
return this.fillItemFromBeastWorld(par1ItemStack, par2World, par3EntityPlayer, true);
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
|
@ -181,11 +190,216 @@ public class ItemFluidSigil extends Item implements IFluidContainerItem
|
|||
case STATE_DRAIN_TANK:
|
||||
cmc.appendText("Now in Drain Tank Mode");
|
||||
break;
|
||||
case STATE_BEAST_DRAIN:
|
||||
cmc.appendText("Now in Beast Mode");
|
||||
break;
|
||||
}
|
||||
player.addChatComponentMessage(cmc);
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack fillItemFromBeastWorld(ItemStack container, World world, EntityPlayer player, boolean forceFill)
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
return container;
|
||||
}
|
||||
int range = 5;
|
||||
|
||||
float f = 1.0F;
|
||||
double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double)f;
|
||||
double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double)f + 1.62D - (double)player.yOffset;
|
||||
double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double)f;
|
||||
boolean flag = true;
|
||||
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, flag);
|
||||
|
||||
if (movingobjectposition == null)
|
||||
{
|
||||
return container;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
int z = movingobjectposition.blockZ;
|
||||
|
||||
if (!world.canMineBlock(player, x, y, z))
|
||||
{
|
||||
return container;
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(x, y, z, movingobjectposition.sideHit, container))
|
||||
{
|
||||
return container;
|
||||
}
|
||||
|
||||
boolean[][][] boolList = new boolean[range * 2 + 1][range * 2 + 1][range * 2 + 1];
|
||||
|
||||
for (int i = 0; i < 2 * range + 1; i++)
|
||||
{
|
||||
for (int j = 0; j < 2 * range + 1; j++)
|
||||
{
|
||||
for(int k = 0; k < 2 * range + 1; k++)
|
||||
{
|
||||
boolList[i][j][k] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<Int3> positionList = new ArrayList();
|
||||
|
||||
boolList[range][range][range] = true;
|
||||
positionList.add(new Int3(range, range, range));
|
||||
boolean isReady = false;
|
||||
|
||||
while (!isReady)
|
||||
{
|
||||
isReady = true;
|
||||
|
||||
for (int i = 0; i < 2 * range + 1; i++)
|
||||
{
|
||||
for (int j = 0; j < 2 * range + 1; j++)
|
||||
{
|
||||
for(int k=0; k < 2*range+1;k++)
|
||||
{
|
||||
if (boolList[i][j][k])
|
||||
{
|
||||
if (i - 1 >= 0 && !boolList[i - 1][j][k])
|
||||
{
|
||||
Block block = world.getBlock(x - range + i - 1, y - range + j, z - range + k);
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
{
|
||||
boolList[i - 1][j][k] = true;
|
||||
positionList.add(new Int3(i-1,j,k));
|
||||
isReady = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (j - 1 >= 0 && !boolList[i][j - 1][k])
|
||||
{
|
||||
Block block = world.getBlock(x - range + i, y - range + j - 1, z - range + k);
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
{
|
||||
boolList[i][j - 1][k] = true;
|
||||
positionList.add(new Int3(i,j-1,k));
|
||||
isReady = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(k - 1 >=0 && !boolList[i][j][k - 1])
|
||||
{
|
||||
Block block = world.getBlock(x - range + i, y - range + j, z - range + k - 1);
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
{
|
||||
boolList[i][j][k - 1] = true;
|
||||
positionList.add(new Int3(i,j,k-1));
|
||||
isReady = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (i + 1 <= 2 * range && !boolList[i + 1][j][k])
|
||||
{
|
||||
Block block = world.getBlock(x - range + i + 1, y - range + j, z - range + k);
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
{
|
||||
boolList[i + 1][j][k] = true;
|
||||
positionList.add(new Int3(i+1,j,k));
|
||||
isReady = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (j + 1 <= 2 * range && !boolList[i][j + 1][k])
|
||||
{
|
||||
Block block = world.getBlock(x - range + i, y - range + j + 1, z - range + k);
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
{
|
||||
boolList[i][j + 1][k] = true;
|
||||
positionList.add(new Int3(i,j+1,k));
|
||||
isReady = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(k + 1 <= 2*range && !boolList[i][j][k+1])
|
||||
{
|
||||
Block block = world.getBlock(x - range + i, y - range + j, z - range + k + 1);
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
if (fluid != null)
|
||||
{
|
||||
boolList[i][j][k+1] = true;
|
||||
positionList.add(new Int3(i,j,k+1));
|
||||
isReady = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(Int3 pos : positionList)
|
||||
{
|
||||
int i = pos.xCoord;
|
||||
int j = pos.yCoord;
|
||||
int k = pos.zCoord;
|
||||
|
||||
if(!boolList[i][j][k])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (world.getBlock(x+i-range, y+j-range, z+k-range) != null && world.getBlock(x+i-range, y+j-range, z+k-range).getMaterial() instanceof MaterialLiquid)
|
||||
{
|
||||
//world.setBlockToAir(x+i-range, y+j-range, z+k-range);
|
||||
Block block = world.getBlock(x+i-range, y+j-range, z+k-range);
|
||||
if(block == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Fluid fluid = FluidRegistry.lookupFluidForBlock(block);
|
||||
|
||||
System.out.println("x: " + (i-range) + " y: " + (j-range) + " z: " + (k-range));
|
||||
|
||||
|
||||
if(fluid==null || world.getBlockMetadata(x+i-range, y+j-range, z+k-range) != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
FluidStack fillStack = new FluidStack(fluid,1000);
|
||||
|
||||
int amount = this.fill(container, fillStack, false);
|
||||
|
||||
if((amount > 0 && forceFill) || (amount >=1000 && !forceFill))
|
||||
{
|
||||
//if(!player.capabilities.isCreativeMode)
|
||||
{
|
||||
world.setBlockToAir(x+i-range, y+j-range, z+k-range);
|
||||
|
||||
}
|
||||
|
||||
this.fill(container, new FluidStack(fluid,1000), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return container;
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack fillItemFromWorld(ItemStack container, World world, EntityPlayer player, boolean forceFill)
|
||||
{
|
||||
float f = 1.0F;
|
||||
|
|
|
@ -131,6 +131,11 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade
|
|||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
|
||||
|
||||
if(par2World.isRemote)
|
||||
{
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if (par3EntityPlayer.isSneaking())
|
||||
{
|
||||
|
@ -259,6 +264,11 @@ public class SigilOfGrowth extends EnergyItems implements ArmourUpgrade
|
|||
@Override
|
||||
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int range = 5;
|
||||
int verticalRange = 2;
|
||||
int posX = (int) Math.round(player.posX - 0.5f);
|
||||
|
|
|
@ -2,20 +2,20 @@ package WayofTime.alchemicalWizardry.common.items.sigil;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
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.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TESpectralBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -205,16 +205,28 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade
|
|||
//for(int iy=posY-verticalRange;iy<=posY+verticalRange;iy++)
|
||||
{
|
||||
Block block = par2World.getBlock(ix, posY + verticalOffset, iz);
|
||||
|
||||
|
||||
|
||||
if (par2World.isAirBlock(ix, posY + verticalOffset, iz))
|
||||
{
|
||||
par2World.setBlock(ix, posY + verticalOffset, iz, ModBlocks.spectralBlock, 0, 3);
|
||||
|
||||
TileEntity tile = par2World.getTileEntity(ix, posY + verticalOffset, iz);
|
||||
if(tile instanceof TESpectralBlock)
|
||||
{
|
||||
((TESpectralBlock) tile).setDuration(100);
|
||||
}
|
||||
|
||||
if (par2World.rand.nextInt(2) == 0)
|
||||
{
|
||||
incremented++;
|
||||
}
|
||||
}else if(block == ModBlocks.spectralBlock)
|
||||
{
|
||||
TileEntity tile = par2World.getTileEntity(ix, posY + verticalOffset, iz);
|
||||
if(tile instanceof TESpectralBlock)
|
||||
{
|
||||
((TESpectralBlock) tile).setDuration(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -284,12 +296,24 @@ public class SigilOfTheBridge extends EnergyItems implements ArmourUpgrade
|
|||
{
|
||||
//for(int iy=posY-verticalRange;iy<=posY+verticalRange;iy++)
|
||||
{
|
||||
Block block = world.getBlock(ix, posY + verticalOffset, iz);
|
||||
Block block = world.getBlock(ix, posY + verticalOffset, iz);
|
||||
|
||||
|
||||
if (world.isAirBlock(ix, posY + verticalOffset, iz))
|
||||
{
|
||||
world.setBlock(ix, posY + verticalOffset, iz, ModBlocks.spectralBlock, 0, 3);
|
||||
|
||||
TileEntity tile = world.getTileEntity(ix, posY + verticalOffset, iz);
|
||||
if(tile instanceof TESpectralBlock)
|
||||
{
|
||||
((TESpectralBlock) tile).setDuration(100);
|
||||
}
|
||||
}else if(block == ModBlocks.spectralBlock)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(ix, posY + verticalOffset, iz);
|
||||
if(tile instanceof TESpectralBlock)
|
||||
{
|
||||
((TESpectralBlock) tile).setDuration(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue