File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed
src/protocol/packets/play Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ uuid = "1.11.0"
4848default = []
4949compression = []
5050encryption = [" dep:cfb8" , " dep:aes" ]
51+ modern_art = []
5152lan = []
5253
5354full = [" compression" , " encryption" ]
Original file line number Diff line number Diff line change @@ -195,19 +195,35 @@ impl ChunkSection {
195195 pub fn anvil_to_sec ( value : & world:: Section , block_states : & Blocks ) -> Self {
196196 let mut blocks: [ i16 ; 16 * 16 * 16 ] = [ 0 ; 16 * 16 * 16 ] ;
197197 let bit_length = ( 64 - ( value. block_states . palette . len ( ) as u64 ) . leading_zeros ( ) ) . max ( 4 ) ;
198+
199+ #[ cfg( not( feature = "modern_art" ) ) ]
198200 let blocks_per_long = 64 / bit_length;
199201
202+ #[ cfg( not( feature = "modern_art" ) ) ]
200203 let bit_mask = ( 1 << bit_length) - 1 ;
201204
202205 match value. block_states . data {
203206 None => blocks. fill ( 0 ) ,
204207 Some ( ref data) => {
205208 let mut i = 0 ;
206209 for long in data. iter ( ) {
207- let long = * long as u64 ;
208- for b in 0 ..blocks_per_long {
209- blocks[ i] = ( ( long >> ( bit_length * b) ) & bit_mask) as i16 ;
210- i += 1 ;
210+ #[ cfg( not( feature = "modern_art" ) ) ]
211+ {
212+ let long = * long as u64 ;
213+ for b in 0 ..blocks_per_long {
214+ blocks[ i] = ( ( long >> ( bit_length * b) ) & bit_mask) as i16 ;
215+ i += 1 ;
216+ }
217+ }
218+
219+ #[ cfg( feature = "modern_art" ) ]
220+ {
221+ let mut long = * long as u64 ;
222+ while long != 0 {
223+ blocks[ i] = ( long & ( ( 1 << bit_length) - 1 ) ) as i16 ;
224+ long >>= bit_length;
225+ i += 1 ;
226+ }
211227 }
212228 }
213229 }
You can’t perform that action at this time.
0 commit comments