-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
67 changed files
with
5,824 additions
and
5,788 deletions.
There are no files selected for viewing
216 changes: 108 additions & 108 deletions
216
...java/thaumcraft/api/BlockCoordinates.java → ...java/thaumcraft/api/BlockCoordinates.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
|
||
} |
54 changes: 27 additions & 27 deletions
54
src/main/java/thaumcraft/api/IArchitect.java → src/api/java/thaumcraft/api/IArchitect.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
44 changes: 22 additions & 22 deletions
44
src/main/java/thaumcraft/api/IGoggles.java → src/api/java/thaumcraft/api/IGoggles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
} |
26 changes: 13 additions & 13 deletions
26
...main/java/thaumcraft/api/IRepairable.java → src/api/java/thaumcraft/api/IRepairable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | ||
|
||
|
||
} |
34 changes: 17 additions & 17 deletions
34
...a/thaumcraft/api/IRepairableExtended.java → ...a/thaumcraft/api/IRepairableExtended.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
} |
Oops, something went wrong.