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
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
version = "1.6.0"
|
version = "1.6.1"
|
||||||
group= "dev.tilera"
|
group= "dev.tilera"
|
||||||
archivesBaseName = "auracore"
|
archivesBaseName = "auracore"
|
||||||
|
|
||||||
|
|
|
@ -1,30 +1,37 @@
|
||||||
package dev.tilera.auracore.api.research;
|
package dev.tilera.auracore.api.research;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public abstract class ResearchTableExtension {
|
public abstract class ResearchTableExtension {
|
||||||
|
|
||||||
public World world;
|
public WeakReference<IResearchTable> researchTable;
|
||||||
public int xCoord;
|
|
||||||
public int yCoord;
|
|
||||||
public int zCoord;
|
|
||||||
|
|
||||||
public ResearchTableExtension(IResearchTable researchTable) {
|
public ResearchTableExtension(IResearchTable researchTable) {
|
||||||
this.world = researchTable.getWorld();
|
this.researchTable = new WeakReference<>(researchTable);
|
||||||
this.xCoord = researchTable.getXCoord();
|
}
|
||||||
this.yCoord = researchTable.getYCoord();
|
|
||||||
this.zCoord = researchTable.getZCoord();
|
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() {
|
public IResearchTable getResearchTable() {
|
||||||
TileEntity te = this.world.getTileEntity(this.xCoord, this.yCoord, this.zCoord);
|
return researchTable.get();
|
||||||
if (te instanceof IResearchTable) {
|
|
||||||
return (IResearchTable) te;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void writeToNBT(NBTTagCompound nbt);
|
public abstract void writeToNBT(NBTTagCompound nbt);
|
||||||
|
|
Loading…
Reference in a new issue