Adding slot field to BlockPos, for future use with compound blocks #41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a new integer property
Slotto the BlockPos class, with the following behavior:BlockPos.SlotDontCarepos.Equals(other)now checks thatSlotproperties matchpos.GetHashCode()includes theSlotvalue in the hashSet,West, etc) will reset theSlotproperty toSlotDontCareBlockPosposition fields from external code (by any value from -15..15) will cause theSlotproperty to self-reset toSlotDontCareCopyandCopyAndCorrectDimensionwill copy theSlotvalueSlotpropertyBlockPos(int x, int y, int z, int dim, int slot)andBlockPos(Vec3i vec, int dim, int slot)public BlockPos SetSlot(int slot)Slotproperty as tag 4, but only if it is not currently set to the defaultSlotDontCareToBytes()andCreateFromBytes()) do not preserve theslotvalue (only x/y/z/dimension) as those methods are only used for particles, which don't need to know about slotsToString()includes the slot value in the output if the value is notSlotDontCareThis should have no impact on the game at present, as there isn't any code that reads or writes the
Slotproperty; allBlockPosinstances will grow by 4 bytes in size, but that seems incredibly unlikely to change anything.