auracore/src/main/java/dev/tilera/auracore/api/research/ResearchTableExtension.java
Timo Ley 881e51ec6c
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
feat: add researchtable extension API
2023-01-13 13:23:12 +01:00

47 lines
1.3 KiB
Java

package dev.tilera.auracore.api.research;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public abstract class ResearchTableExtension {
public World world;
public int xCoord;
public int yCoord;
public int zCoord;
public ResearchTableExtension(IResearchTable researchTable) {
this.world = researchTable.getWorld();
this.xCoord = researchTable.getXCoord();
this.yCoord = researchTable.getYCoord();
this.zCoord = researchTable.getZCoord();
}
public IResearchTable getResearchTable() {
TileEntity te = this.world.getTileEntity(this.xCoord, this.yCoord, this.zCoord);
if (te instanceof IResearchTable) {
return (IResearchTable) te;
}
return null;
}
public abstract void writeToNBT(NBTTagCompound nbt);
public abstract void readFromNBT(NBTTagCompound nbt);
public abstract void writeToPacket(NBTTagCompound nbt);
public abstract void readFromPacket(NBTTagCompound nbt);
public abstract void onTick();
public abstract void markDirty();
public abstract boolean openGUI(EntityPlayer player);
public abstract String getNBTKey();
}