Skip to content

Commit

Permalink
clean pr/1881 and nearby code
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jan 17, 2019
1 parent c240df3 commit cc7d572
Showing 1 changed file with 7 additions and 5 deletions.
Expand Up @@ -2148,7 +2148,8 @@ else if (this.getWorld() == toLocation.getWorld()) {
face = ((Attachable) data).getAttachedFace();
}
if (face != BlockFace.SELF) {
return new dLocation(getBlock().getRelative(face).getLocation()).getAttribute(attribute.fulfill(1));
return new dLocation(getBlock().getRelative(face).getLocation())
.getAttribute(attribute.fulfill(1));
}
}

Expand All @@ -2162,7 +2163,8 @@ else if (this.getWorld() == toLocation.getWorld()) {
// -->
if (attribute.startsWith("custom_name")) {
if (getBlock().getState() instanceof Nameable) {
return new Element(((Nameable) getBlock().getState()).getCustomName()).getAttribute(attribute.fulfill(1));
return new Element(((Nameable) getBlock().getState()).getCustomName())
.getAttribute(attribute.fulfill(1));
}
}

Expand Down Expand Up @@ -2413,9 +2415,9 @@ else if (getBlock().getType() == Material.FLOWER_POT) {
// -->
if (mechanism.matches("custom_name")) {
if (getBlock().getState() instanceof Nameable) {
String title = mechanism.getValue().asString();
if (!mechanism.hasValue()) {
title = null;
String title = null;
if (mechanism.hasValue()) {
title = mechanism.getValue().asString();
}
BlockState state = getBlock().getState();
((Nameable) state).setCustomName(title);
Expand Down

0 comments on commit cc7d572

Please sign in to comment.