diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2023-03-07 22:09:56 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-07 22:09:56 -0600 |
| commit | 5dd35c7ed82c38ef36ca28f630e8d05c5db2cbea (patch) | |
| tree | 72719e46479e7884ea535c768ab7c244ce048063 /azalea-world/src/bit_storage.rs | |
| parent | 719379a8a76ab0685f2bd14bebe2f0cd1e97f06b (diff) | |
| download | azalea-drasl-5dd35c7ed82c38ef36ca28f630e8d05c5db2cbea.tar.xz | |
Add World::find_block (#80)
* start adding World::find_block
* keep working on find_block
* BlockStates
* fix sorting
* update examples that use find_one_block
* azalea_block::properties
* fix tests
* add a gotoblock command to testbot
Diffstat (limited to 'azalea-world/src/bit_storage.rs')
| -rwxr-xr-x | azalea-world/src/bit_storage.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/azalea-world/src/bit_storage.rs b/azalea-world/src/bit_storage.rs index f6ca4cd6..09b68fae 100755 --- a/azalea-world/src/bit_storage.rs +++ b/azalea-world/src/bit_storage.rs @@ -158,13 +158,13 @@ impl BitStorage { .unwrap() } + /// Get the data at the given index. + /// + /// # Panics + /// + /// This function will panic if the given index is greater than or equal to + /// the size of this storage. pub fn get(&self, index: usize) -> u64 { - // Validate.inclusiveBetween(0L, (long)(this.size - 1), (long)var1); - // int var2 = this.cellIndex(var1); - // long var3 = this.data[var2]; - // int var5 = (var1 - var2 * this.valuesPerLong) * this.bits; - // return (int)(var3 >> var5 & this.mask); - assert!( index < self.size, "Index {} out of bounds (must be less than {})", |
