Skip to content

Commit

Permalink
Merged branch dev into master
Browse files Browse the repository at this point in the history
  • Loading branch information
KryptonCaptain committed Nov 10, 2016
2 parents c0a4101 + d2d9406 commit 4f8a3e3
Show file tree
Hide file tree
Showing 67 changed files with 5,824 additions and 5,788 deletions.
Original file line number Diff line number Diff line change
@@ -1,108 +1,108 @@
package thaumcraft.api;

import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;

public class BlockCoordinates implements Comparable
{
public int x;

/** the y coordinate */
public int y;

/** the z coordinate */
public int z;

public BlockCoordinates() {}

public BlockCoordinates(int par1, int par2, int par3)
{
this.x = par1;
this.y = par2;
this.z = par3;
}

public BlockCoordinates(TileEntity tile)
{
this.x = tile.xCoord;
this.y = tile.yCoord;
this.z = tile.zCoord;
}

public BlockCoordinates(BlockCoordinates par1ChunkCoordinates)
{
this.x = par1ChunkCoordinates.x;
this.y = par1ChunkCoordinates.y;
this.z = par1ChunkCoordinates.z;
}

public boolean equals(Object par1Obj)
{
if (!(par1Obj instanceof BlockCoordinates))
{
return false;
}
else
{
BlockCoordinates coordinates = (BlockCoordinates)par1Obj;
return this.x == coordinates.x && this.y == coordinates.y && this.z == coordinates.z ;
}
}

public int hashCode()
{
return this.x + this.y << 8 + this.z << 16;
}

/**
* Compare the coordinate with another coordinate
*/
public int compareWorldCoordinate(BlockCoordinates par1)
{
return this.y == par1.y ? (this.z == par1.z ? this.x - par1.x : this.z - par1.z) : this.y - par1.y;
}

public void set(int par1, int par2, int par3, int d)
{
this.x = par1;
this.y = par2;
this.z = par3;
}

/**
* Returns the squared distance between this coordinates and the coordinates given as argument.
*/
public float getDistanceSquared(int par1, int par2, int par3)
{
float f = (float)(this.x - par1);
float f1 = (float)(this.y - par2);
float f2 = (float)(this.z - par3);
return f * f + f1 * f1 + f2 * f2;
}

/**
* Return the squared distance between this coordinates and the ChunkCoordinates given as argument.
*/
public float getDistanceSquaredToWorldCoordinates(BlockCoordinates par1ChunkCoordinates)
{
return this.getDistanceSquared(par1ChunkCoordinates.x, par1ChunkCoordinates.y, par1ChunkCoordinates.z);
}

public int compareTo(Object par1Obj)
{
return this.compareWorldCoordinate((BlockCoordinates)par1Obj);
}

public void readNBT(NBTTagCompound nbt) {
this.x = nbt.getInteger("b_x");
this.y = nbt.getInteger("b_y");
this.z = nbt.getInteger("b_z");
}

public void writeNBT(NBTTagCompound nbt) {
nbt.setInteger("b_x",x);
nbt.setInteger("b_y",y);
nbt.setInteger("b_z",z);
}

}
package thaumcraft.api;

import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;

public class BlockCoordinates implements Comparable
{
public int x;

/** the y coordinate */
public int y;

/** the z coordinate */
public int z;

public BlockCoordinates() {}

public BlockCoordinates(int par1, int par2, int par3)
{
this.x = par1;
this.y = par2;
this.z = par3;
}

public BlockCoordinates(TileEntity tile)
{
this.x = tile.xCoord;
this.y = tile.yCoord;
this.z = tile.zCoord;
}

public BlockCoordinates(BlockCoordinates par1ChunkCoordinates)
{
this.x = par1ChunkCoordinates.x;
this.y = par1ChunkCoordinates.y;
this.z = par1ChunkCoordinates.z;
}

public boolean equals(Object par1Obj)
{
if (!(par1Obj instanceof BlockCoordinates))
{
return false;
}
else
{
BlockCoordinates coordinates = (BlockCoordinates)par1Obj;
return this.x == coordinates.x && this.y == coordinates.y && this.z == coordinates.z ;
}
}

public int hashCode()
{
return this.x + this.y << 8 + this.z << 16;
}

/**
* Compare the coordinate with another coordinate
*/
public int compareWorldCoordinate(BlockCoordinates par1)
{
return this.y == par1.y ? (this.z == par1.z ? this.x - par1.x : this.z - par1.z) : this.y - par1.y;
}

public void set(int par1, int par2, int par3, int d)
{
this.x = par1;
this.y = par2;
this.z = par3;
}

/**
* Returns the squared distance between this coordinates and the coordinates given as argument.
*/
public float getDistanceSquared(int par1, int par2, int par3)
{
float f = (float)(this.x - par1);
float f1 = (float)(this.y - par2);
float f2 = (float)(this.z - par3);
return f * f + f1 * f1 + f2 * f2;
}

/**
* Return the squared distance between this coordinates and the ChunkCoordinates given as argument.
*/
public float getDistanceSquaredToWorldCoordinates(BlockCoordinates par1ChunkCoordinates)
{
return this.getDistanceSquared(par1ChunkCoordinates.x, par1ChunkCoordinates.y, par1ChunkCoordinates.z);
}

public int compareTo(Object par1Obj)
{
return this.compareWorldCoordinate((BlockCoordinates)par1Obj);
}

public void readNBT(NBTTagCompound nbt) {
this.x = nbt.getInteger("b_x");
this.y = nbt.getInteger("b_y");
this.z = nbt.getInteger("b_z");
}

public void writeNBT(NBTTagCompound nbt) {
nbt.setInteger("b_x",x);
nbt.setInteger("b_y",y);
nbt.setInteger("b_z",z);
}

}
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
package thaumcraft.api;

import java.util.ArrayList;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public interface IArchitect {

/**
* Returns a list of blocks that should be highlighted in world.
*/
public ArrayList<BlockCoordinates> getArchitectBlocks(ItemStack stack, World world,
int x, int y, int z, int side, EntityPlayer player);

/**
* which axis should be displayed.
*/
public boolean showAxis(ItemStack stack, World world, EntityPlayer player, int side, EnumAxis axis);

public enum EnumAxis {
X, // east / west
Y, // up / down
Z; // north / south
}
}
package thaumcraft.api;

import java.util.ArrayList;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public interface IArchitect {

/**
* Returns a list of blocks that should be highlighted in world.
*/
public ArrayList<BlockCoordinates> getArchitectBlocks(ItemStack stack, World world,
int x, int y, int z, int side, EntityPlayer player);

/**
* which axis should be displayed.
*/
public boolean showAxis(ItemStack stack, World world, EntityPlayer player, int side, EnumAxis axis);

public enum EnumAxis {
X, // east / west
Y, // up / down
Z; // north / south
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package thaumcraft.api;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;

/**
*
* @author Azanor
*
* Equipped head slot items that extend this class will be able to perform most functions that
* goggles of revealing can apart from view nodes which is handled by IRevealer.
*
*/

public interface IGoggles {

/*
* If this method returns true things like block essentia contents will be shown.
*/
public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player);

}
package thaumcraft.api;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;

/**
*
* @author Azanor
*
* Equipped head slot items that extend this class will be able to perform most functions that
* goggles of revealing can apart from view nodes which is handled by IRevealer.
*
*/

public interface IGoggles {

/*
* If this method returns true things like block essentia contents will be shown.
*/
public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player);

}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package thaumcraft.api;



/**
* @author Azanor
* Items, armor and tools with this interface can receive the Repair enchantment.
* Repairs 1 point of durability every 10 seconds (2 for repair II)
*/
public interface IRepairable {


}
package thaumcraft.api;



/**
* @author Azanor
* Items, armor and tools with this interface can receive the Repair enchantment.
* Repairs 1 point of durability every 10 seconds (2 for repair II)
*/
public interface IRepairable {


}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package thaumcraft.api;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;



/**
* @author Azanor
* Items, armor and tools with this interface can receive the Repair enchantment.
* Repairs 1 point of durability every 10 seconds (2 for repair II)
*/
public interface IRepairableExtended extends IRepairable {

public boolean doRepair(ItemStack stack, EntityPlayer player, int enchantlevel);

}
package thaumcraft.api;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;



/**
* @author Azanor
* Items, armor and tools with this interface can receive the Repair enchantment.
* Repairs 1 point of durability every 10 seconds (2 for repair II)
*/
public interface IRepairableExtended extends IRepairable {

public boolean doRepair(ItemStack stack, EntityPlayer player, int enchantlevel);

}
Loading

0 comments on commit 4f8a3e3

Please sign in to comment.