generated from tilera/1710mod
fix: research table extension
This commit is contained in:
parent
881e51ec6c
commit
0e909e82de
|
@ -24,7 +24,7 @@ apply from: './gradle/scripts/mixins.gradle'
|
|||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
version = "1.6.0"
|
||||
version = "1.6.1"
|
||||
group= "dev.tilera"
|
||||
archivesBaseName = "auracore"
|
||||
|
||||
|
|
|
@ -1,30 +1,37 @@
|
|||
package dev.tilera.auracore.api.research;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
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 WeakReference<IResearchTable> researchTable;
|
||||
|
||||
public ResearchTableExtension(IResearchTable researchTable) {
|
||||
this.world = researchTable.getWorld();
|
||||
this.xCoord = researchTable.getXCoord();
|
||||
this.yCoord = researchTable.getYCoord();
|
||||
this.zCoord = researchTable.getZCoord();
|
||||
this.researchTable = new WeakReference<>(researchTable);
|
||||
}
|
||||
|
||||
public World getWorld() {
|
||||
return researchTable.get().getWorld();
|
||||
}
|
||||
|
||||
public int getXCoord() {
|
||||
return researchTable.get().getXCoord();
|
||||
}
|
||||
|
||||
public int getYCoord() {
|
||||
return researchTable.get().getYCoord();
|
||||
}
|
||||
|
||||
public int getZCoord() {
|
||||
return researchTable.get().getZCoord();
|
||||
}
|
||||
|
||||
public IResearchTable getResearchTable() {
|
||||
TileEntity te = this.world.getTileEntity(this.xCoord, this.yCoord, this.zCoord);
|
||||
if (te instanceof IResearchTable) {
|
||||
return (IResearchTable) te;
|
||||
}
|
||||
return null;
|
||||
return researchTable.get();
|
||||
}
|
||||
|
||||
public abstract void writeToNBT(NBTTagCompound nbt);
|
||||
|
|
Loading…
Reference in New Issue