BloodMagic/src/main/java/WayofTime/bloodmagic/demonAura/WillChunk.java
Nicholas Ignoffo 2fecb427fd Merge apibutnotreally with the main packages
Do not consider anything outside of the true API safe to use. And even then,
I'm changing things. Just wait. Please I beg you.
2018-02-15 18:49:07 -08:00

60 lines
1.4 KiB
Java

package WayofTime.bloodmagic.demonAura;
import WayofTime.bloodmagic.soul.DemonWillHolder;
import net.minecraft.world.chunk.Chunk;
import java.lang.ref.WeakReference;
public class WillChunk {
PosXY loc;
private short base;
private DemonWillHolder currentWill = new DemonWillHolder();
private WeakReference<Chunk> chunkRef;
public WillChunk(PosXY loc) {
this.loc = loc;
}
public WillChunk(Chunk chunk, short base, DemonWillHolder currentWill) {
this.loc = new PosXY(chunk.x, chunk.z);
this.chunkRef = new WeakReference(chunk);
this.base = base;
this.currentWill = currentWill;
}
public boolean isModified() {
return (this.chunkRef != null) && (this.chunkRef.get() != null) && this.chunkRef.get().needsSaving(false);
}
public PosXY getLoc() {
return loc;
}
public void setLoc(PosXY loc) {
this.loc = loc;
}
public short getBase() {
return base;
}
public void setBase(short base) {
this.base = base;
}
public DemonWillHolder getCurrentWill() {
return currentWill;
}
public void setCurrentWill(DemonWillHolder currentWill) {
this.currentWill = currentWill;
}
public WeakReference<Chunk> getChunkRef() {
return chunkRef;
}
public void setChunkRef(WeakReference<Chunk> chunkRef) {
this.chunkRef = chunkRef;
}
}