File tree 2 files changed +1
-4
lines changed
2 files changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,6 @@ void makeViewDistanceFitZoomLevel() {
35
35
setViewDistance(numBlocksVisible + 4 );
36
36
}
37
37
38
- // This function is called each frame.
39
- // I tried to only call this each time the state.player stepped on a new block, but it did not seem to improve the fps.
40
- // That also introduced other problems (block would not be mined until stepped new block), so I chose to keep it like this.
41
38
void loadVisibleBlocks () {
42
39
for (int x = 0 ; x < settings. viewDistance; x++ ) {
43
40
for (int y = 0 ; y < settings. viewDistance; y++ ) {
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ public class Player extends Body {
115
115
116
116
boolean selectedItemIsBlock () {
117
117
ItemSlot slot = getSelectedItemSlot();
118
- return slot. item. itemType == ItemType . BLOCK ;
118
+ return slot. item != null && slot . item . itemType == ItemType . BLOCK ;
119
119
}
120
120
121
121
ItemSlot getSelectedItemSlot () {
You can’t perform that action at this time.
0 commit comments