Work on networking update

This commit is contained in:
Aidan C. Brady committed 2014-06-01 17:42:23 +02:00
1 parent da444327f8
commit ec2040cccc
16 files changed
+86 -108

No files matched your search

+12 -1
View File
@@ -5,7 +5,6 @@ import io.netty.buffer.ByteBuf;
import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
@@ -16,6 +15,8 @@ import net.minecraftforge.common.util.ForgeDirection;
import com.google.common.io.ByteArrayDataInput;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
/**
* Coord4D - an integer-based way to keep track of and perform operations on blocks in a Minecraft-based environment. This also takes
* in account the dimension the coordinate is in.
@@ -248,6 +249,16 @@ public class Coord4D
{
return world.isAirBlock(xCoord+side.offsetX, yCoord+side.offsetY, zCoord+side.offsetZ);
}
/**
* Gets a TargetPoint with the defined range from this Coord4D with the appropriate coordinates and dimension ID.
* @param range - the range the packet can be sent in of this Coord4D
* @return TargetPoint relative to this Coord4D
*/
public TargetPoint getTargetPoint(double range)
{
return new TargetPoint(dimensionId, xCoord, yCoord, zCoord, range);
}
/**
* Steps this Coord4D in the defined side's offset without creating a new value.