Started work on Demon Will Inversion system.
This commit is contained in:
parent
0524daa16c
commit
2c49c49441
6 changed files with 440 additions and 0 deletions
41
src/main/java/WayofTime/bloodmagic/demonAura/WillChunk.java
Normal file
41
src/main/java/WayofTime/bloodmagic/demonAura/WillChunk.java
Normal file
|
@ -0,0 +1,41 @@
|
|||
package WayofTime.bloodmagic.demonAura;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import WayofTime.bloodmagic.api.soul.DemonWillHolder;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
public boolean isModified()
|
||||
{
|
||||
if ((this.chunkRef != null) && (this.chunkRef.get() != null))
|
||||
{
|
||||
return ((Chunk) this.chunkRef.get()).needsSaving(false);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue