Work on flame vector calculation - still need to get it to catch blocks and entities on fire properly

This commit is contained in:
Aidan C. Brady committed 2014-07-19 02:34:07 -04:00
1 parent 497997d0e4
commit 87f92326f9
2 files changed
+207 -20

No files matched your search

+20
View File
@@ -5,6 +5,8 @@ import io.netty.buffer.ByteBuf;
import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
@@ -165,10 +167,28 @@ public class Coord4D
return getFromSide(side, 1);
}
/**
* Creates and returns a new Coord4D translated to the defined offsets of the side by the defined amount.
* @param side - side to translate this Coord4D to
* @param amount - how far to translate this Coord4D
* @return translated Coord4D
*/
public Coord4D getFromSide(ForgeDirection side, int amount)
{
return new Coord4D(xCoord+(side.offsetX*amount), yCoord+(side.offsetY*amount), zCoord+(side.offsetZ*amount), dimensionId);
}
public ItemStack getStack(IBlockAccess world)
{
Block block = getBlock(world);
if(block == null || block == Blocks.air)
{
return null;
}
return new ItemStack(block, 1, getMetadata(world));
}
/**
* Returns a new Coord4D from a defined TileEntity's xCoord, yCoord and zCoord values.