Skip to content

Commit

Permalink
minor formatting/naming
Browse files Browse the repository at this point in the history
  • Loading branch information
drewdorris committed May 27, 2018
1 parent 716780c commit 59e1039
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
24 changes: 12 additions & 12 deletions src/main/java/com/ruinscraft/powder/util/ConfigUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,19 +288,19 @@ multiplier, getStart(powderConfig, powder, eachSection),
String eachEachSection = eachSection + ".layers." + sss;
Layer layer = new Layer();
layer.setPosition(powderConfig.getDouble(eachEachSection + ".position", 0));
for (String t : (List<String>) powderConfig
for (String ssss : (List<String>) powderConfig
.getList(eachEachSection + ".layerMatrix", new ArrayList<String>())) {
if (t.contains(":")) {
if (t.contains("img:")) {
if (ssss.contains(":")) {
if (ssss.contains("img:")) {
String urlName;
int width;
int height;
t = t.replace("img:", "");
urlName = t.substring(0, t.indexOf(";"));
t = t.substring(t.indexOf(";") + 1, t.length());
width = Integer.valueOf(t.substring(0, t.indexOf(";")));
t = t.substring(t.indexOf(";") + 1, t.length());
height = Integer.valueOf(t);
ssss = ssss.replace("img:", "");
urlName = ssss.substring(0, ssss.indexOf(";"));
ssss = ssss.substring(ssss.indexOf(";") + 1, ssss.length());
width = Integer.valueOf(ssss.substring(0, ssss.indexOf(";")));
ssss = ssss.substring(ssss.indexOf(";") + 1, ssss.length());
height = Integer.valueOf(ssss);
try {
ImageUtil.getRows(layer.getRows(), urlName, width, height);
} catch (IOException io) {
Expand All @@ -317,11 +317,11 @@ multiplier, getStart(powderConfig, powder, eachSection),
if (layer.getPosition() == 0) {
up++;
// if the string contains location/player
if (t.contains("?")) {
if (ssss.contains("?")) {
containsPlayer = true;
// set the left & up of the Layer
// so that createPowders() knows where to start
left = (t.indexOf("?")) + 1;
left = (ssss.indexOf("?")) + 1;
// set default if it's the matrix spawned immediately
if (particleMatrix.getStartTime() == 0) {
powder.setDefaultLeft(left - 1);
Expand All @@ -334,7 +334,7 @@ multiplier, getStart(powderConfig, powder, eachSection),
// add a row to the Layer if it has gone through everything
// rows contain PowderParticles
List<PowderParticle> row = new ArrayList<PowderParticle>();
for (char character : t.toCharArray()) {
for (char character : ssss.toCharArray()) {
PowderParticle powderParticle;
powderParticle = powder.getPowderParticle(character);
if (powderParticle == null) {
Expand Down
3 changes: 0 additions & 3 deletions src/main/resources/powders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ powders:
layers:
layer1:
position: 0
layerMatrix:
layerMatrix:
- 'img:flag-ca.png;39;39'
- '...................?'
Expand All @@ -467,7 +466,6 @@ powders:
layers:
layer1:
position: 0
layerMatrix:
layerMatrix:
- 'img:flag-eu.png;39;39'
- '...................?'
Expand All @@ -487,7 +485,6 @@ powders:
layers:
layer1:
position: 0
layerMatrix:
layerMatrix:
- 'img:flag-cn.png;39;39'
- '...................?'
Expand Down

0 comments on commit 59e1039

Please sign in to comment.