Skip to content

Commit

Permalink
Added an option to change piston max distance.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew authored and Matthew committed Feb 7, 2013
1 parent be46685 commit 3f44a38
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/sk89q/craftbook/LocalConfiguration.java
Expand Up @@ -52,6 +52,7 @@ public abstract class LocalConfiguration {
public boolean physicsLadders;
public boolean physicsPots;
// Mechanics - BetterPistons
public int pistonMaxDistance;
public boolean pistonsEnabled;
public boolean pistonsCrusher;
public boolean pistonsSuperSticky;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/sk89q/craftbook/mech/BetterPistons.java
Expand Up @@ -218,8 +218,8 @@ public void onBlockRedstoneChange(SourcedBlockRedstoneEvent event) {

final boolean air = ((Sign) sign.getState()).getLine(3).equalsIgnoreCase("AIR");

if(block > 10)
block = 10;
if(block > CraftBookPlugin.inst().getConfiguration().pistonMaxDistance)
block = CraftBookPlugin.inst().getConfiguration().pistonMaxDistance;

final int fblock = block;

Expand Down Expand Up @@ -264,8 +264,8 @@ public void run () {
catch(Exception e){
}

if(block > 10)
block = 10;
if(block > CraftBookPlugin.inst().getConfiguration().pistonMaxDistance)
block = CraftBookPlugin.inst().getConfiguration().pistonMaxDistance;

final int fblock = block;

Expand Down
Expand Up @@ -87,6 +87,7 @@ public void load() {
pistonsSuperSticky = config.getBoolean("mechanics.better-pistons.super-sticky", true);
pistonsBounce = config.getBoolean("mechanics.better-pistons.bounce", true);
pistonsSuperPush = config.getBoolean("mechanics.better-pistons.super-push", true);
pistonMaxDistance = config.getInt("mechanics.better-pistons.max-distance", 12);

// Bookcase Configuration Listener
bookcaseEnabled = config.getBoolean("mechanics.bookcase.enable", true);
Expand Down

0 comments on commit 3f44a38

Please sign in to comment.