@@ -13,7 +13,8 @@ export class DisplayEntityConfig {
1313 private __onApplyFunction ?: string
1414 private __billboard ?: BillboardMode
1515 private __overrideBrightness ?: boolean
16- private __brightnessOverride ?: number
16+ private __skyBrightness ?: number
17+ private __blockBrightness ?: number
1718 private __enchanted ?: boolean
1819 private __glowing ?: boolean
1920 private __overrideGlowColor ?: boolean
@@ -27,7 +28,8 @@ export class DisplayEntityConfig {
2728 on_apply_function : '' ,
2829 billboard : 'fixed' ,
2930 override_brightness : false ,
30- brightness_override : 0 ,
31+ sky_brightness : 0 ,
32+ block_brightness : 0 ,
3133 enchanted : false ,
3234 glowing : false ,
3335 override_glow_color : false ,
@@ -64,13 +66,22 @@ export class DisplayEntityConfig {
6466 this . __overrideBrightness = value
6567 }
6668
67- get brightnessOverride ( ) : NonNullable < DisplayEntityConfig [ '__brightnessOverride ' ] > {
68- if ( this . __brightnessOverride !== undefined ) return this . __brightnessOverride
69+ get skyBrightness ( ) : NonNullable < DisplayEntityConfig [ '__skyBrightness ' ] > {
70+ if ( this . __skyBrightness !== undefined ) return this . __skyBrightness
6971 const defaultConfig = DisplayEntityConfig . getDefault ( )
70- return defaultConfig . brightnessOverride
72+ return defaultConfig . skyBrightness
7173 }
72- set brightnessOverride ( value : DisplayEntityConfig [ '__brightnessOverride' ] ) {
73- this . __brightnessOverride = value
74+ set skyBrightness ( value : DisplayEntityConfig [ '__skyBrightness' ] ) {
75+ this . __skyBrightness = value
76+ }
77+
78+ get blockBrightness ( ) : NonNullable < DisplayEntityConfig [ '__blockBrightness' ] > {
79+ if ( this . __blockBrightness !== undefined ) return this . __blockBrightness
80+ const defaultConfig = DisplayEntityConfig . getDefault ( )
81+ return defaultConfig . blockBrightness
82+ }
83+ set blockBrightness ( value : DisplayEntityConfig [ '__blockBrightness' ] ) {
84+ this . __blockBrightness = value
7485 }
7586
7687 get enchanted ( ) : NonNullable < DisplayEntityConfig [ '__enchanted' ] > {
@@ -141,7 +152,8 @@ export class DisplayEntityConfig {
141152 this . __onApplyFunction === other . __onApplyFunction &&
142153 this . __billboard === other . __billboard &&
143154 this . __overrideBrightness === other . __overrideBrightness &&
144- this . __brightnessOverride === other . __brightnessOverride &&
155+ this . __skyBrightness === other . __skyBrightness &&
156+ this . __blockBrightness === other . __blockBrightness &&
145157 this . __enchanted === other . __enchanted &&
146158 this . __glowing === other . __glowing &&
147159 this . __overrideGlowColor === other . __overrideGlowColor &&
@@ -161,7 +173,8 @@ export class DisplayEntityConfig {
161173 on_apply_function : this . __onApplyFunction ,
162174 billboard : this . __billboard ,
163175 override_brightness : this . __overrideBrightness ,
164- brightness_override : this . __brightnessOverride ,
176+ sky_brightness : this . __skyBrightness ,
177+ block_brightness : this . __blockBrightness ,
165178 enchanted : this . __enchanted ,
166179 glowing : this . __glowing ,
167180 override_glow_color : this . __overrideGlowColor ,
@@ -177,8 +190,8 @@ export class DisplayEntityConfig {
177190 if ( other . __billboard !== undefined ) this . billboard = other . billboard
178191 if ( other . __overrideBrightness !== undefined )
179192 this . overrideBrightness = other . overrideBrightness
180- if ( other . __brightnessOverride !== undefined )
181- this . brightnessOverride = other . brightnessOverride
193+ if ( other . __skyBrightness !== undefined ) this . skyBrightness = other . skyBrightness
194+ if ( other . __blockBrightness !== undefined ) this . blockBrightness = other . blockBrightness
182195 if ( other . __enchanted !== undefined ) this . enchanted = other . enchanted
183196 if ( other . __glowing !== undefined ) this . glowing = other . glowing
184197 if ( other . __overrideGlowColor !== undefined )
@@ -195,8 +208,12 @@ export class DisplayEntityConfig {
195208 if ( json . billboard !== undefined ) config . __billboard = json . billboard
196209 if ( json . override_brightness !== undefined )
197210 config . __overrideBrightness = json . override_brightness
198- if ( json . brightness_override !== undefined )
199- config . __brightnessOverride = json . brightness_override
211+ if ( json . sky_brightness !== undefined ) config . __skyBrightness = json . sky_brightness
212+ if ( json . block_brightness !== undefined ) config . __blockBrightness = json . block_brightness
213+ if ( json . brightness_override !== undefined ) {
214+ config . __skyBrightness ??= json . brightness_override
215+ config . __blockBrightness ??= json . brightness_override
216+ }
200217 if ( json . enchanted !== undefined ) config . __enchanted = json . enchanted
201218 if ( json . glowing !== undefined ) config . __glowing = json . glowing
202219 if ( json . override_glow_color !== undefined )
@@ -217,8 +234,8 @@ export class DisplayEntityConfig {
217234 compound . set (
218235 'brightness' ,
219236 new NbtCompound ( )
220- . set ( 'block' , new NbtFloat ( this . brightnessOverride ) )
221- . set ( 'sky' , new NbtFloat ( this . brightnessOverride ) )
237+ . set ( 'block' , new NbtInt ( this . blockBrightness ) )
238+ . set ( 'sky' , new NbtInt ( this . skyBrightness ) )
222239 )
223240 }
224241
0 commit comments