Skip to content

Commit

Permalink
aka name
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Oct 2, 2020
1 parent 219eaa3 commit 3e1d716
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/main/java/carpet/microtick/enums/BlockUpdateType.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@

public enum BlockUpdateType
{
NEIGHBOR_CHANGED("NeighborChanged", Constants.NC_UPDATE_ORDER),
NEIGHBOR_CHANGED_EXCEPT("NeighborChanged Except", Constants.NC_UPDATE_ORDER),
POST_PLACEMENT("PostPlacement", Block.UPDATE_ORDER);
NEIGHBOR_CHANGED("NeighborChanged", "Block Update", Constants.NC_UPDATE_ORDER),
NEIGHBOR_CHANGED_EXCEPT("NeighborChanged Except", "Block Update Except", Constants.NC_UPDATE_ORDER),
POST_PLACEMENT("PostPlacement", "State Update", Constants.PP_UPDATE_ORDER);

private final String name;
private final String name, aka;
private final EnumFacing[] updateOrder;
private final Map<EnumFacing, String> updateOrderListCache = Maps.newHashMap();
private final String updateOrderListCacheNoSkip;

BlockUpdateType(String name, EnumFacing[] updateOrder)
BlockUpdateType(String name, String aka, EnumFacing[] updateOrder)
{
this.name = name;
this.aka = aka;
this.updateOrder = updateOrder;
for (EnumFacing enumFacing : EnumFacing.values())
{
Expand All @@ -39,10 +40,7 @@ private String _getUpdateOrderList(EnumFacing skipSide)
{
int counter = 0;
StringBuilder stringBuilder = new StringBuilder();
if (skipSide != null)
{
stringBuilder.append(String.format("Except: %s\n", skipSide));
}
stringBuilder.append(String.format("aka %s\n", this.aka));
for (EnumFacing enumfacing : this.updateOrder)
{
if (skipSide != enumfacing)
Expand All @@ -54,6 +52,10 @@ private String _getUpdateOrderList(EnumFacing skipSide)
stringBuilder.append(String.format("%d. %s", (++counter), enumfacing));
}
}
if (skipSide != null)
{
stringBuilder.append(String.format("Except: %s\n", skipSide));
}
return stringBuilder.toString();
}

Expand All @@ -65,5 +67,6 @@ public String getUpdateOrderList(EnumFacing skipSide)
static class Constants
{
static final EnumFacing[] NC_UPDATE_ORDER = new EnumFacing[]{EnumFacing.WEST, EnumFacing.EAST, EnumFacing.DOWN, EnumFacing.UP, EnumFacing.NORTH, EnumFacing.SOUTH};
static final EnumFacing[] PP_UPDATE_ORDER = Block.UPDATE_ORDER;
}
}

0 comments on commit 3e1d716

Please sign in to comment.