3434import net .minecraft .util .Identifier ;
3535import net .minecraft .util .math .ChunkPos ;
3636import net .minecraft .world .GameRules ;
37- import net .modfest .fireblanket .command .*;
37+ import net .modfest .fireblanket .command .CmdFindReplaceCommand ;
38+ import net .modfest .fireblanket .command .DumpCommand ;
39+ import net .modfest .fireblanket .command .ItemBanCommand ;
40+ import net .modfest .fireblanket .command .RegionCommand ;
41+ import net .modfest .fireblanket .command .StareCommand ;
3842import net .modfest .fireblanket .compat .PolyMcCompat ;
3943import net .modfest .fireblanket .compat .roles .PlayerRolesCompat ;
4044import net .modfest .fireblanket .config .ConfigSpecs ;
45+ import net .modfest .fireblanket .config .EntityFilters ;
4146import net .modfest .fireblanket .config .FireblanketConfig ;
4247import net .modfest .fireblanket .mixin .accessor .ClientConnectionAccessor ;
4348import net .modfest .fireblanket .mixin .accessor .ServerChunkManagerAccessor ;
5257import net .modfest .fireblanket .world .render_regions .RegionSyncRequest ;
5358import net .modfest .fireblanket .world .render_regions .RenderRegions ;
5459import net .modfest .fireblanket .world .render_regions .RenderRegionsState ;
55- import net .modfest .fireblanket .config .EntityFilters ;
5660import org .slf4j .Logger ;
5761import org .slf4j .LoggerFactory ;
5862
59- import java .util .concurrent .LinkedBlockingQueue ;
6063import java .util .concurrent .atomic .AtomicInteger ;
6164import java .util .concurrent .locks .LockSupport ;
6265import java .util .function .Consumer ;
@@ -95,7 +98,7 @@ public void onInitialize() {
9598 LiteralArgumentBuilder <ServerCommandSource > base = CommandManager .literal ("fireblanket" );
9699
97100 DumpCommand .init (base , access );
98- // RegionCommand.init(base, access);
101+ RegionCommand .init (base , access );
99102 CmdFindReplaceCommand .init (base , access );
100103 StareCommand .init (base , access );
101104 ItemBanCommand .init (base , access );
@@ -200,7 +203,7 @@ public void onInitialize() {
200203 int max = (int ) Math .ceil (radius / 16 );
201204 int count = (max - min ) * (max - min );
202205 ChunkTicketManager mgr = ((ServerChunkManagerAccessor ) world .getChunkManager ()).fireblanket$getTicketManager ();
203- LOGGER .info ("Forcing " + count + " chunks to stay loaded (but not ticking)..." );
206+ LOGGER .info ("Forcing {} chunks to stay loaded (but not ticking)..." , count );
204207 int done = 0 ;
205208 long lastReport = System .nanoTime ();
206209 Stopwatch sw = Stopwatch .createStarted ();
@@ -214,11 +217,11 @@ public void onInitialize() {
214217 done ++;
215218 if (System .nanoTime () - lastReport > 1_000_000_000 ) {
216219 lastReport = System .nanoTime ();
217- LOGGER .info (done + "/" + count + " loaded (" + (( done * 100 ) / count ) + "%)..." );
220+ LOGGER .info ("{}/{} loaded ({}%)..." , done , count , ( done * 100 ) / count );
218221 }
219222 }
220223 }
221- LOGGER .info ("Done after " + sw );
224+ LOGGER .info ("Done after {}" , sw );
222225 }
223226 });
224227
@@ -232,14 +235,14 @@ public void onInitialize() {
232235 }
233236
234237 public static void fullRegionSync (ServerWorld world , Consumer <Packet <?>> sender ) {
235- // RenderRegions regions = RenderRegionsState.get(world).getRegions();
236- // RegionSyncRequest req;
237- // if (regions.getRegionsByName().isEmpty()) {
238- // req = new RegionSyncRequest.Reset(true);
239- // } else {
240- // req = regions.toPacket();
241- // }
242- // sender.accept(ServerPlayNetworking.createS2CPacket(req));
238+ RenderRegions regions = RenderRegionsState .get (world ).getRegions ();
239+ RegionSyncRequest req ;
240+ if (regions .getRegionsByName ().isEmpty ()) {
241+ req = new RegionSyncRequest .Reset (true );
242+ } else {
243+ req = regions .toPacket ();
244+ }
245+ sender .accept (ServerPlayNetworking .createS2CPacket (req ));
243246 }
244247
245248 public static LinkedBlocQueue <QueuedPacket > getNextQueue () {
0 commit comments