@@ -445,13 +445,13 @@ private void ReplaceBlock(Block b) {
445445
446446 for (Entry <BlockFace , Block > entry : get6Blocks (b , false ).entrySet ()) {
447447 Block block = entry .getValue ();
448- for ( TickUpdateComponent tuc : block .getComponents (TickUpdateComponent .class )) {
449- Engine .TickableBlocks .add (tuc );
448+ if ( block .getComponents (TickUpdateComponent .class ). size () > 0 ) {
449+ Engine .TickableBlocks .add (block . pos );
450450 }
451451 }
452452
453- for ( TickUpdateComponent tuc : b .getComponents (TickUpdateComponent .class )) {
454- Engine .TickableBlocks .add (tuc );
453+ if ( b .getComponents (TickUpdateComponent .class ). size () > 0 ) {
454+ Engine .TickableBlocks .add (b . pos );
455455 }
456456
457457 for (DayNightComponent dnc : b .getComponents (DayNightComponent .class )) {
@@ -504,7 +504,8 @@ public void destroyBlock(Block b, boolean resend) {
504504 }else {
505505
506506 if (getBlockAtP (b .pos ) == Block .NOTHING ) {
507- Main .err ("Attempted to destroy air block: " +b .pos );
507+ Thread .dumpStack ();
508+ //Main.err("Attempted to destroy air block: "+b.pos);
508509 return ;
509510 }
510511
@@ -520,13 +521,16 @@ public void destroyBlock(Block b, boolean resend) {
520521
521522 for (Entry <BlockFace , Block > entry : get6Blocks (b , false ).entrySet ()) {
522523 Block bu = entry .getValue ();
523- for ( TickUpdateComponent tuc : bu .getComponents (TickUpdateComponent .class )) {
524- Engine .TickableBlocks .add (tuc );
524+ if ( bu .getComponents (TickUpdateComponent .class ). size () > 0 ) {
525+ Engine .TickableBlocks .add (bu . pos );
525526 }
527+
526528 }
527529
528- for (TickUpdateComponent tuc : b .getComponents (TickUpdateComponent .class )) {
529- Engine .TickableBlocks .remove (tuc );
530+
531+
532+ if (b .getComponents (TickUpdateComponent .class ).size () > 0 ) {
533+ Engine .TickableBlocks .remove (b .pos );
530534 }
531535
532536 for (DayNightComponent dnc : b .getComponents (DayNightComponent .class )) {
0 commit comments