@@ -148,9 +148,7 @@ private static List<BakedQuad> genCtmQuads(BakedQuad frameQuad, List<BakedQuad>
148
148
TextureAtlasSprite sprite = frameQuad .getSprite ();
149
149
TextureAtlasSprite ctmSprite = Minecraft .getInstance ()
150
150
.getTextureAtlas (InventoryMenu .BLOCK_ATLAS )
151
- .apply (new ResourceLocation (RGBBlocks .MOD_ID ,
152
- "block/antiblock_ctm"
153
- ));
151
+ .apply (new ResourceLocation (RGBBlocks .MOD_ID , "block/antiblock_ctm" ));
154
152
155
153
List <BakedQuad > quads = new ArrayList <>(bgQuads );
156
154
@@ -303,6 +301,30 @@ public IModelData getModelData(@NotNull BlockAndTintGetter level, @NotNull Block
303
301
boolean west = false ;
304
302
boolean up = false ;
305
303
boolean down = false ;
304
+ boolean upNorth = false ;
305
+ boolean upNorthColor = false ;
306
+ boolean upEast = false ;
307
+ boolean upEastColor = false ;
308
+ boolean upSouth = false ;
309
+ boolean upSouthColor = false ;
310
+ boolean upWest = false ;
311
+ boolean upWestColor = false ;
312
+ boolean northEast = false ;
313
+ boolean northEastColor = false ;
314
+ boolean southEast = false ;
315
+ boolean southEastColor = false ;
316
+ boolean southWest = false ;
317
+ boolean southWestColor = false ;
318
+ boolean northWest = false ;
319
+ boolean northWestColor = false ;
320
+ boolean downNorth = false ;
321
+ boolean downNorthColor = false ;
322
+ boolean downEast = false ;
323
+ boolean downEastColor = false ;
324
+ boolean downSouth = false ;
325
+ boolean downSouthColor = false ;
326
+ boolean downWest = false ;
327
+ boolean downWestColor = false ;
306
328
307
329
if (getAntiblockAt (level , pos .north ()) instanceof RGBTileEntity otherBlockEntity )
308
330
north = otherBlockEntity .getColor () == blockEntity .getColor ();
@@ -316,18 +338,54 @@ public IModelData getModelData(@NotNull BlockAndTintGetter level, @NotNull Block
316
338
up = otherBlockEntity .getColor () == blockEntity .getColor ();
317
339
if (getAntiblockAt (level , pos .below ()) instanceof RGBTileEntity otherBlockEntity )
318
340
down = otherBlockEntity .getColor () == blockEntity .getColor ();
319
- boolean upNorth = getAntiblockAt (level , pos .above ().north ()) instanceof RGBTileEntity ;
320
- boolean upEast = getAntiblockAt (level , pos .above ().east ()) instanceof RGBTileEntity ;
321
- boolean upSouth = getAntiblockAt (level , pos .above ().south ()) instanceof RGBTileEntity ;
322
- boolean upWest = getAntiblockAt (level , pos .above ().west ()) instanceof RGBTileEntity ;
323
- boolean northEast = getAntiblockAt (level , pos .north ().east ()) instanceof RGBTileEntity ;
324
- boolean southEast = getAntiblockAt (level , pos .south ().east ()) instanceof RGBTileEntity ;
325
- boolean southWest = getAntiblockAt (level , pos .south ().west ()) instanceof RGBTileEntity ;
326
- boolean northWest = getAntiblockAt (level , pos .north ().west ()) instanceof RGBTileEntity ;
327
- boolean downNorth = getAntiblockAt (level , pos .below ().north ()) instanceof RGBTileEntity ;
328
- boolean downEast = getAntiblockAt (level , pos .below ().east ()) instanceof RGBTileEntity ;
329
- boolean downSouth = getAntiblockAt (level , pos .below ().south ()) instanceof RGBTileEntity ;
330
- boolean downWest = getAntiblockAt (level , pos .below ().west ()) instanceof RGBTileEntity ;
341
+ if (getAntiblockAt (level , pos .above ().north ()) instanceof RGBTileEntity otherBlockEntity ) {
342
+ upNorth = true ;
343
+ upNorthColor = otherBlockEntity .getColor () == blockEntity .getColor ();
344
+ }
345
+ if (getAntiblockAt (level , pos .above ().east ()) instanceof RGBTileEntity otherBlockEntity ) {
346
+ upEast = true ;
347
+ upEastColor = otherBlockEntity .getColor () == blockEntity .getColor ();
348
+ }
349
+ if (getAntiblockAt (level , pos .above ().south ()) instanceof RGBTileEntity otherBlockEntity ) {
350
+ upSouth = true ;
351
+ upSouthColor = otherBlockEntity .getColor () == blockEntity .getColor ();
352
+ }
353
+ if (getAntiblockAt (level , pos .above ().west ()) instanceof RGBTileEntity otherBlockEntity ) {
354
+ upWest = true ;
355
+ upWestColor = otherBlockEntity .getColor () == blockEntity .getColor ();
356
+ }
357
+ if (getAntiblockAt (level , pos .north ().east ()) instanceof RGBTileEntity otherBlockEntity ) {
358
+ northEast = true ;
359
+ northEastColor = otherBlockEntity .getColor () == blockEntity .getColor ();
360
+ }
361
+ if (getAntiblockAt (level , pos .south ().east ()) instanceof RGBTileEntity otherBlockEntity ) {
362
+ southEast = true ;
363
+ southEastColor = otherBlockEntity .getColor () == blockEntity .getColor ();
364
+ }
365
+ if (getAntiblockAt (level , pos .south ().west ()) instanceof RGBTileEntity otherBlockEntity ) {
366
+ southWest = true ;
367
+ southWestColor = otherBlockEntity .getColor () == blockEntity .getColor ();
368
+ }
369
+ if (getAntiblockAt (level , pos .north ().west ()) instanceof RGBTileEntity otherBlockEntity ) {
370
+ northWest = true ;
371
+ northWestColor = otherBlockEntity .getColor () == blockEntity .getColor ();
372
+ }
373
+ if (getAntiblockAt (level , pos .below ().north ()) instanceof RGBTileEntity otherBlockEntity ) {
374
+ downNorth = true ;
375
+ downNorthColor = otherBlockEntity .getColor () == blockEntity .getColor ();
376
+ }
377
+ if (getAntiblockAt (level , pos .below ().east ()) instanceof RGBTileEntity otherBlockEntity ) {
378
+ downEast = true ;
379
+ downEastColor = otherBlockEntity .getColor () == blockEntity .getColor ();
380
+ }
381
+ if (getAntiblockAt (level , pos .below ().south ()) instanceof RGBTileEntity otherBlockEntity ) {
382
+ downSouth = true ;
383
+ downSouthColor = otherBlockEntity .getColor () == blockEntity .getColor ();
384
+ }
385
+ if (getAntiblockAt (level , pos .below ().west ()) instanceof RGBTileEntity otherBlockEntity ) {
386
+ downWest = true ;
387
+ downWestColor = otherBlockEntity .getColor () == blockEntity .getColor ();
388
+ }
331
389
boolean upNorthEast = getAntiblockAt (level , pos .above ().north ().east ()) instanceof RGBTileEntity ;
332
390
boolean upSouthEast = getAntiblockAt (level , pos .above ().south ().east ()) instanceof RGBTileEntity ;
333
391
boolean upSouthWest = getAntiblockAt (level , pos .above ().south ().west ()) instanceof RGBTileEntity ;
@@ -339,23 +397,27 @@ public IModelData getModelData(@NotNull BlockAndTintGetter level, @NotNull Block
339
397
340
398
modelData .setData (AntiblockModelData .ANTIBLOCK_MODEL_DATA , new AntiblockModelData (
341
399
new Connections (Direction .NORTH , up && !upNorth , down && !downNorth , east && !northEast ,
342
- west && !northWest , upEast && !upNorthEast , upWest && !upNorthWest ,
343
- downEast && !downNorthEast , downWest && !downNorthWest
400
+ west && !northWest , upEast && upEastColor && !upNorthEast ,
401
+ upWest && upWestColor && !upNorthWest , downEast && downEastColor && !downNorthEast ,
402
+ downWest && downWestColor && !downNorthWest
344
403
), new Connections (Direction .EAST , up && !upEast , down && !downEast , south && !southEast ,
345
- north && !northEast , upSouth && !upSouthEast , upNorth && !upNorthEast ,
346
- downSouth && !downSouthEast , downNorth && !downNorthEast
404
+ north && !northEast , upSouth && upSouthColor && !upSouthEast ,
405
+ upNorth && upNorthColor && !upNorthEast ,
406
+ downSouth && downSouthColor && !downSouthEast ,
407
+ downNorth && downNorthColor && !downNorthEast
347
408
), new Connections (Direction .SOUTH , up && !upSouth , down && !downSouth , west && !southWest , east && !southEast ,
348
- upWest && !upSouthWest , upEast && ! upSouthEast , downWest && !downSouthWest ,
349
- downEast && !downSouthEast
409
+ upWest && upWestColor && !upSouthWest , upEast && upEastColor && !upSouthEast ,
410
+ downWest && downWestColor && ! downSouthWest , downEast && downEastColor && !downSouthEast
350
411
), new Connections (Direction .WEST , up && !upWest , down && !downWest , north && !northWest , south && !southWest ,
351
- upNorth && !upNorthWest , upSouth && ! upSouthWest , downNorth && !downNorthWest ,
352
- downSouth && !downSouthWest
412
+ upNorth && upNorthColor && !upNorthWest , upSouth && upSouthColor && !upSouthWest ,
413
+ downNorth && downNorthColor && ! downNorthWest , downSouth && downSouthColor && !downSouthWest
353
414
), new Connections (Direction .UP , north && !upNorth , south && !upSouth , west && !upWest , east && !upEast ,
354
- northWest && !upNorthWest , northEast && ! upNorthEast , southWest & ! upSouthWest ,
355
- southEast && !upSouthEast
415
+ northWest && northWestColor && !upNorthWest , northEast && northEastColor && ! upNorthEast ,
416
+ southWest && southWestColor && ! upSouthWest , southEast && southEastColor && !upSouthEast
356
417
), new Connections (Direction .DOWN , south && !downSouth , north && !downNorth , west && !downWest ,
357
- east && !downEast , southWest && !downSouthWest , southEast && !downSouthEast ,
358
- northWest && !downNorthWest , northEast && !downNorthEast
418
+ east && !downEast , southWest && southWestColor && !downSouthWest ,
419
+ southEast && southEastColor && !downSouthEast , northWest && northWestColor && !downNorthWest ,
420
+ northEast && northEastColor && !downNorthEast
359
421
)));
360
422
return modelData ;
361
423
}
0 commit comments