Skip to content

Commit bfd2a5a

Browse files
committed
Start of dyeable pockets.
1 parent 243ad4a commit bfd2a5a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/java/org/dimdev/pocketlib/Pocket.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import lombok.Getter;
44
import lombok.Setter;
5+
import net.minecraft.item.EnumDyeColor;
56
import net.minecraft.nbt.NBTTagCompound;
67
import net.minecraft.util.math.BlockPos;
78
import org.dimdev.annotatednbt.NBTSerializable;
@@ -16,6 +17,8 @@
1617
@Saved @Getter protected int z; // Grid y
1718
@Saved @Getter @Setter protected int size; // TODO: non chunk-based size, better bounds such as minX, minZ, maxX, maxZ, etc.
1819
@Saved @Getter @Setter protected VirtualLocation virtualLocation;
20+
@Saved protected EnumDyeColor color;
21+
@Saved protected int count = 0;
1922

2023
@Getter int dim; // Not saved
2124

@@ -45,4 +48,13 @@ public BlockPos getOrigin() {
4548
int gridSize = PocketRegistry.instance(dim).getGridSize();
4649
return new BlockPos(x * gridSize * 16, 0, z * gridSize * 16);
4750
}
51+
52+
public void addDye(EnumDyeColor color) {
53+
if(this.color != null && this.color == color) {
54+
count++;
55+
} else {
56+
this.color = color;
57+
count = 1;
58+
}
59+
}
4860
}

0 commit comments

Comments
 (0)