Skip to content

Commit

Permalink
-Version bump.
Browse files Browse the repository at this point in the history
-Minor efficiency improvement to PanelCellPos class. Index getter caches value to reduce calculations when grabbing index multiple times.
  • Loading branch information
dannydjdk committed Jun 11, 2021
1 parent 9a19dfb commit e9d3418
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = '1.16.5-1.8.2'
version = '1.16.5-1.8.3'
group = 'com.dannyandson.tinyredstone' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'tinyredstone'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class PanelCellPos {
private final int row;
private final int column;
private final int level;
private Integer index=null;
private final PanelTile panelTile;

protected PanelCellPos(PanelTile panelTile, int row, int column, int level) {
Expand Down Expand Up @@ -47,7 +48,9 @@ public int getLevel(){
}

public int getIndex() {
return (level*64) + (row * 8) + column;
if (this.index==null)
this.index=(level*64) + (row * 8) + column;
return this.index;
}

public PanelTile getPanelTile(){
Expand Down

0 comments on commit e9d3418

Please sign in to comment.