2016-02-21 20:10:56 -05:00
|
|
|
package WayofTime.bloodmagic.demonAura;
|
|
|
|
|
2016-03-17 13:00:44 -07:00
|
|
|
import WayofTime.bloodmagic.api.soul.DemonWillHolder;
|
2016-02-21 20:10:56 -05:00
|
|
|
import lombok.Getter;
|
|
|
|
import lombok.Setter;
|
|
|
|
import net.minecraft.world.chunk.Chunk;
|
2016-03-17 13:00:44 -07:00
|
|
|
|
|
|
|
import java.lang.ref.WeakReference;
|
2016-02-21 20:10:56 -05:00
|
|
|
|
|
|
|
@Getter
|
|
|
|
@Setter
|
|
|
|
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.xPosition, chunk.zPosition);
|
|
|
|
this.chunkRef = new WeakReference(chunk);
|
|
|
|
this.base = base;
|
|
|
|
this.currentWill = currentWill;
|
|
|
|
}
|
|
|
|
|
2016-12-12 19:56:36 -08:00
|
|
|
public boolean isModified() {
|
|
|
|
return (this.chunkRef != null) && (this.chunkRef.get() != null) && this.chunkRef.get().needsSaving(false);
|
2016-02-21 20:10:56 -05:00
|
|
|
}
|
|
|
|
}
|