2015-04-20 21:08:14 +02:00
|
|
|
/*
|
|
|
|
* This file was made by modmuss50. View the licence file to see what licence this is is on. You can always ask me if you would like to use part or all of this file in your project.
|
|
|
|
*/
|
|
|
|
|
2015-04-20 22:02:25 +02:00
|
|
|
package techreborn.partSystem;
|
2015-04-20 21:08:14 +02:00
|
|
|
|
2015-11-23 15:40:30 +01:00
|
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
2015-04-20 21:08:14 +02:00
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
import net.minecraft.world.World;
|
2015-11-08 13:15:45 +01:00
|
|
|
import reborncore.common.misc.vecmath.Vecs3d;
|
|
|
|
import reborncore.common.misc.vecmath.Vecs3dCube;
|
2015-07-02 20:49:30 +02:00
|
|
|
|
|
|
|
import java.util.List;
|
2015-04-20 21:08:14 +02:00
|
|
|
|
|
|
|
/**
|
2015-04-24 15:20:09 +02:00
|
|
|
* This is based of
|
|
|
|
* https://github.com/Qmunity/QmunityLib/blob/master/src/main/java
|
|
|
|
* /uk/co/qmunity/lib/part/IPart.java
|
2015-04-20 21:08:14 +02:00
|
|
|
* <p/>
|
|
|
|
* You should not be implementing this.
|
|
|
|
*/
|
|
|
|
public interface IModPart {
|
|
|
|
|
2015-08-09 12:05:32 +02:00
|
|
|
/**
|
|
|
|
* Adds all of this part's collision boxes to the list. These boxes can
|
|
|
|
* depend on the entity that's colliding with them.
|
|
|
|
*/
|
|
|
|
public void addCollisionBoxesToList(List<Vecs3dCube> boxes, Entity entity);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets this part's selection boxes.
|
|
|
|
*/
|
|
|
|
public List<Vecs3dCube> getSelectionBoxes();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets this part's occlusion boxes.
|
|
|
|
*/
|
|
|
|
public List<Vecs3dCube> getOcclusionBoxes();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders this part dynamically (every render tick).
|
|
|
|
*/
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public void renderDynamic(Vecs3d translation, double delta);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders this part statically. A tessellator has alredy started drawing. <br>
|
|
|
|
* Only called when there's a block/lighting/render update in the chunk this
|
|
|
|
* part is in.
|
|
|
|
*/
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public boolean renderStatic(Vecs3d translation, int pass);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Writes the part's data to an NBT tag, which is saved with the game data.
|
|
|
|
*/
|
|
|
|
public void writeToNBT(NBTTagCompound tag);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reads the part's data from an NBT tag, which was stored in the game data.
|
|
|
|
*/
|
|
|
|
public void readFromNBT(NBTTagCompound tag);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the itemstack that places this part.
|
|
|
|
*/
|
|
|
|
public ItemStack getItem();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the name of this part.
|
|
|
|
*/
|
|
|
|
public String getName();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the world of this part.
|
|
|
|
*/
|
|
|
|
public World getWorld();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is the item texture eg: "network:cable"
|
|
|
|
*/
|
|
|
|
public String getItemTextureName();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the X cord of this part.
|
|
|
|
*/
|
|
|
|
public int getX();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the Y cord of this part.
|
|
|
|
*/
|
|
|
|
public int getY();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the Z cord of this part.
|
|
|
|
*/
|
|
|
|
public int getZ();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called every tick
|
|
|
|
*/
|
|
|
|
public void tick();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when a block or part has been changed. Can be used for cables to
|
|
|
|
* check nearby blocks
|
|
|
|
*/
|
|
|
|
public void nearByChange();
|
|
|
|
|
|
|
|
public void onAdded();
|
|
|
|
|
|
|
|
public void onRemoved();
|
2015-07-14 17:45:45 +02:00
|
|
|
|
|
|
|
public IModPart copy();
|
2015-10-05 18:39:45 +02:00
|
|
|
|
|
|
|
public boolean needsItem();
|
2015-04-20 21:08:14 +02:00
|
|
|
}
|