Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions com/creadri/lazyroad/LazyRoad.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
return true;
}

RoadEnabled re = new RoadEnabled(player, road);
RoadEnabled re = new RoadEnabled(player, road, player.getLocation());
int count = 1;
if (args.length > 1) {
try {
Expand Down Expand Up @@ -244,7 +244,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
return true;
}

RoadEnabled re = new RoadEnabled(player, road);
RoadEnabled re = new RoadEnabled(player, road, player.getLocation());
int count = 1;
if (args.length > 1) {
try {
Expand Down Expand Up @@ -284,7 +284,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
return true;
}

RoadEnabled re = new RoadEnabled(player, road);
RoadEnabled re = new RoadEnabled(player, road, player.getLocation());
int count = 1;
if (args.length > 2) {
try {
Expand Down
2 changes: 1 addition & 1 deletion com/creadri/lazyroad/LazyRoadPlayerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void onPlayerMove(PlayerMoveEvent event) {
return;
}

road.drawRoad(event.getPlayer());
road.drawRoad(event.getPlayer(),event.getPlayer().getLocation());
}

@Override
Expand Down
7 changes: 2 additions & 5 deletions com/creadri/lazyroad/RoadEnabled.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ public class RoadEnabled {
private Undo undo;
private World world;

public RoadEnabled(Player player, Road road) {
Location loc = player.getLocation();
public RoadEnabled(Player player, Road road, Location loc) {
this.world = loc.getWorld();
this.oldX = loc.getBlockX();
this.oldZ = loc.getBlockZ();
Expand Down Expand Up @@ -58,9 +57,7 @@ public Undo getUndo() {
return undo;
}

public void drawRoad(Player player) {

Location playerLocation = player.getLocation();
public void drawRoad(Player player, Location playerLocation) {

// player current coordinates
int x = playerLocation.getBlockX();
Expand Down