@@ -14,28 +14,12 @@ class TerrainManager
1414 @blocksTex = options .blocksTex
1515 console .log @blocksTex
1616 genBlockFace : (type ,block ,pos )->
17- if @blocksTex [block .name ] isnt undefined
18- if @blocksTex [block .name ][" all" ] isnt undefined
19- toxX = @blocksMapping [@blocksTex [block .name ].all ][" x" ]
20- toxY = @blocksMapping [@blocksTex [block .name ].all ][" y" ]
21- else if @blocksTex [block .name ][" side" ] isnt undefined
22- mapka = {
23- " py" : " top"
24- " ny" : " bottom"
25- }
26- if mapka[type] isnt undefined
27- toxX = @blocksMapping [@blocksTex [block .name ][mapka[type]]][" x" ]
28- toxY = @blocksMapping [@blocksTex [block .name ][mapka[type]]][" y" ]
29- else
30- toxX = @blocksMapping [@blocksTex [block .name ][" side" ]][" x" ]
31- toxY = @blocksMapping [@blocksTex [block .name ][" side" ]][" y" ]
17+ if @blocksTex [block .name ] isnt undefined or @blocksTex [String (block .stateId )] isnt undefined
18+ if @blocksTex [String (block .stateId )] isnt undefined
19+ xd = @blocksTex [String (block .stateId )]
3220 else
33- toxX = @blocksMapping [@blocksTex [block .name ][type]][" x" ]
34- toxY = @blocksMapping [@blocksTex [block .name ][type]][" y" ]
35- else if @blocksTex [String (block .stateId )] isnt undefined
36- xd = @blocksTex [String (block .stateId )]
21+ xd = @blocksTex [block .name ]
3722 if xd[" all" ] isnt undefined
38- console .log " 1"
3923 toxX = @blocksMapping [xd .all ][" x" ]
4024 toxY = @blocksMapping [xd .all ][" y" ]
4125 else if xd[" side" ] isnt undefined
@@ -44,15 +28,12 @@ class TerrainManager
4428 " ny" : " bottom"
4529 }
4630 if mapka[type] isnt undefined
47- console .log " 2"
4831 toxX = @blocksMapping [xd[mapka[type]]][" x" ]
4932 toxY = @blocksMapping [xd[mapka[type]]][" y" ]
5033 else
51- console .log xd[" side" ]
5234 toxX = @blocksMapping [xd[" side" ]][" x" ]
5335 toxY = @blocksMapping [xd[" side" ]][" y" ]
5436 else
55- console .log xd[type]
5637 toxX = @blocksMapping [xd[type]][" x" ]
5738 toxY = @blocksMapping [xd[type]][" y" ]
5839 else if block .name is " water"
0 commit comments