@@ -80,17 +80,17 @@ public static Builder builder(Location center, Direction direction) {
8080 @ NotNull
8181 public Map <String , Object > serialize () {
8282 return SerializationUtil .newBuilder ()
83- .add ("id" , id )
84- .add ("minHeight" , minHeight )
85- .add ("plot" , plot )
86- .add ("elementSize" , elementSize )
87- .add ("offset" , offset )
88- .add ("rows" , rows )
89- .add ("columns" , columns )
90- .add ("borderMaterial" , borderMaterial )
91- .add ("offsetMaterial" , offsetMaterial )
92- .add ("floorMaterial" , floorMaterial )
93- .build ();
83+ .add ("id" , id )
84+ .add ("minHeight" , minHeight )
85+ .add ("plot" , plot )
86+ .add ("elementSize" , elementSize )
87+ .add ("offset" , offset )
88+ .add ("rows" , rows )
89+ .add ("columns" , columns )
90+ .add ("borderMaterial" , borderMaterial )
91+ .add ("offsetMaterial" , offsetMaterial )
92+ .add ("floorMaterial" , floorMaterial )
93+ .build ();
9494 }
9595
9696 /**
@@ -168,8 +168,8 @@ public Optional<Plot> getRegion(BlockVector2 vector) {
168168 var totalElementSize = elementSize + 2 + offset ;
169169 var min = plot .min ();
170170
171- var xOffset = EMath .diff (min .getX (), vector .getX ());
172- var zOffset = EMath .diff (min .getZ (), vector .getZ ());
171+ var xOffset = EMath .diff (min .x (), vector .x ());
172+ var zOffset = EMath .diff (min .z (), vector .z ());
173173
174174 var xIndex = xOffset % totalElementSize ;
175175 var zIndex = zOffset % totalElementSize ;
@@ -182,8 +182,8 @@ public Optional<Plot> getRegion(BlockVector2 vector) {
182182 return Optional .empty ();
183183 }
184184
185- var gridX = Math .floor (xOffset / totalElementSize );
186- var gridZ = Math .floor (zOffset / totalElementSize );
185+ var gridX = Math .floor (xOffset / ( float ) totalElementSize );
186+ var gridZ = Math .floor (zOffset / ( float ) totalElementSize );
187187
188188 return Optional .ofNullable (getRegion (min , (int ) gridX , (int ) gridZ ));
189189 }
@@ -198,7 +198,7 @@ public Optional<Plot> getRegion(BlockVector2 vector) {
198198 */
199199 public Plot getRegion (BlockVector2 base , int x , int z ) {
200200 var totalElementSize = elementSize + 2 + offset ;
201- var min = BlockVector2 .at (base .getX () + x * totalElementSize , base .getZ () + z * totalElementSize );
201+ var min = BlockVector2 .at (base .x () + x * totalElementSize , base .z () + z * totalElementSize );
202202 return Plot .of (min , min .add (BlockVector2 .at (elementSize + 1 , elementSize + 1 )));
203203 }
204204
@@ -262,8 +262,8 @@ public void id(int id) {
262262
263263 public List <Plot > getRegions () {
264264 List <Plot > plots = new ArrayList <>();
265- for (var x = plot .min ().getBlockX (); x < plot .max ().getBlockX (); x += elementSize + 2 + offset ) {
266- for (var z = plot .min ().getBlockZ (); z < plot .max ().getBlockZ (); z += elementSize + 2 + offset ) {
265+ for (var x = plot .min ().x (); x < plot .max ().x (); x += elementSize + 2 + offset ) {
266+ for (var z = plot .min ().z (); z < plot .max ().z (); z += elementSize + 2 + offset ) {
267267 getRegion (BlockVector2 .at (x , z )).ifPresent (plots ::add );
268268 }
269269 }
@@ -348,38 +348,38 @@ public BlockVector2 floorVector(Vector vector) {
348348
349349 public String asComponent () {
350350 var message = MessageComposer .create ()
351- .text ("<%s>Cluster Settings" , Colors .HEADING ).newLine ()
352- .text ("<%s>Location: <%s>%s|%s" , Colors .NAME , Colors .VALUE , center .getBlockX (), center .getBlockZ ())
353- .space ()
354- .text ("<%s><click:run_command:'/sbrg cluster modify center'>[change]</click>" , Colors .CHANGE )
355- .newLine ()
356- .text ("<%s>Direction: <%s>%s" , Colors .NAME , Colors .VALUE , direction .name ()).space ()
357- .text ("<%s><click:run_command:'/sbrg cluster modify direction'>[change]</click>" , Colors .CHANGE )
358- .newLine ()
359- .text ("<%s>Expand: <%s>%s" , Colors .NAME , Colors .VALUE , expandRight ? "right" : "left" ).space ()
360- .text ("<%s><click:run_command:'/sbrg cluster modify expandRight'>[change]</click>" , Colors .CHANGE )
361- .newLine ()
362- .text ("<%s>Size: <%s>%s" , Colors .NAME , Colors .VALUE , elementSize ).space ()
363- .text ("<%s><click:suggest_command:'/sbrg cluster modify size '>[change]</click>" , Colors .CHANGE )
364- .newLine ()
365- .text ("<%s>Rows: <%s>%s" , Colors .NAME , Colors .VALUE , rows ).space ()
366- .text ("<%s><click:suggest_command:'/sbrg cluster modify rows '>[change]</click>" , Colors .CHANGE )
367- .newLine ()
368- .text ("<%s>Columns: <%s>%s" , Colors .NAME , Colors .VALUE , columns ).space ()
369- .text ("<%s><click:suggest_command:'/sbrg cluster modify columns '>[change]</click>" , Colors .CHANGE )
370- .newLine ()
371- .text ("<%s>Offset: <%s>%s" , Colors .NAME , Colors .VALUE , offset ).space ()
372- .text ("<%s><click:suggest_command:'/sbrg cluster modify offset '>[change]</click>" , Colors .CHANGE )
373- .newLine ()
374- .text ("<%s>Floor Material: <%s>%s" , Colors .NAME , Colors .VALUE , floorMaterial ).space ()
375- .text ("<%s><click:suggest_command:'/sbrg cluster modify floorMaterial '>[change]</click>" , Colors .CHANGE )
376- .newLine ()
377- .text ("<%s>Border Material: <%s>%s" , Colors .NAME , Colors .VALUE , borderMaterial ).space ()
378- .text ("<%s><click:suggest_command:'/sbrg cluster modify borderMaterial '>[change]</click>" , Colors .CHANGE )
379- .newLine ()
380- .text ("<%s>Offset Material: <%s>%s" , Colors .NAME , Colors .VALUE , offsetMaterial ).space ()
381- .text ("<%s><click:suggest_command:'/sbrg cluster modify offsetMaterial '>[change]</click>" , Colors .CHANGE )
382- .build ();
351+ .text ("<%s>Cluster Settings" , Colors .HEADING ).newLine ()
352+ .text ("<%s>Location: <%s>%s|%s" , Colors .NAME , Colors .VALUE , center .getBlockX (), center .getBlockZ ())
353+ .space ()
354+ .text ("<%s><click:run_command:'/sbrg cluster modify center'>[change]</click>" , Colors .CHANGE )
355+ .newLine ()
356+ .text ("<%s>Direction: <%s>%s" , Colors .NAME , Colors .VALUE , direction .name ()).space ()
357+ .text ("<%s><click:run_command:'/sbrg cluster modify direction'>[change]</click>" , Colors .CHANGE )
358+ .newLine ()
359+ .text ("<%s>Expand: <%s>%s" , Colors .NAME , Colors .VALUE , expandRight ? "right" : "left" ).space ()
360+ .text ("<%s><click:run_command:'/sbrg cluster modify expandRight'>[change]</click>" , Colors .CHANGE )
361+ .newLine ()
362+ .text ("<%s>Size: <%s>%s" , Colors .NAME , Colors .VALUE , elementSize ).space ()
363+ .text ("<%s><click:suggest_command:'/sbrg cluster modify size '>[change]</click>" , Colors .CHANGE )
364+ .newLine ()
365+ .text ("<%s>Rows: <%s>%s" , Colors .NAME , Colors .VALUE , rows ).space ()
366+ .text ("<%s><click:suggest_command:'/sbrg cluster modify rows '>[change]</click>" , Colors .CHANGE )
367+ .newLine ()
368+ .text ("<%s>Columns: <%s>%s" , Colors .NAME , Colors .VALUE , columns ).space ()
369+ .text ("<%s><click:suggest_command:'/sbrg cluster modify columns '>[change]</click>" , Colors .CHANGE )
370+ .newLine ()
371+ .text ("<%s>Offset: <%s>%s" , Colors .NAME , Colors .VALUE , offset ).space ()
372+ .text ("<%s><click:suggest_command:'/sbrg cluster modify offset '>[change]</click>" , Colors .CHANGE )
373+ .newLine ()
374+ .text ("<%s>Floor Material: <%s>%s" , Colors .NAME , Colors .VALUE , floorMaterial ).space ()
375+ .text ("<%s><click:suggest_command:'/sbrg cluster modify floorMaterial '>[change]</click>" , Colors .CHANGE )
376+ .newLine ()
377+ .text ("<%s>Border Material: <%s>%s" , Colors .NAME , Colors .VALUE , borderMaterial ).space ()
378+ .text ("<%s><click:suggest_command:'/sbrg cluster modify borderMaterial '>[change]</click>" , Colors .CHANGE )
379+ .newLine ()
380+ .text ("<%s>Offset Material: <%s>%s" , Colors .NAME , Colors .VALUE , offsetMaterial ).space ()
381+ .text ("<%s><click:suggest_command:'/sbrg cluster modify offsetMaterial '>[change]</click>" , Colors .CHANGE )
382+ .build ();
383383 return message ;
384384 }
385385
0 commit comments