-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5fa5389
commit f56c945
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/main/java/net/countercraft/movecraft/repair/tasks/LecternRepair.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package net.countercraft.movecraft.repair.tasks; | ||
|
||
import com.sk89q.worldedit.WorldEditException; | ||
import com.sk89q.worldedit.bukkit.BukkitAdapter; | ||
import com.sk89q.worldedit.util.SideEffectSet; | ||
import com.sk89q.worldedit.world.block.BaseBlock; | ||
import org.bukkit.Location; | ||
|
||
public class LecternRepair extends RepairTask { | ||
private final BaseBlock block; | ||
|
||
public LecternRepair(Location location, BaseBlock block) { | ||
super(location); | ||
this.block = block; | ||
} | ||
|
||
@Override | ||
public void execute() { | ||
try { | ||
BukkitAdapter.adapt(location.getWorld()).setBlock(BukkitAdapter.asBlockVector(location), block, SideEffectSet.none()); | ||
} catch (WorldEditException e) { | ||
throw new RuntimeException("Unable to set block", e); | ||
} | ||
done = true; | ||
} | ||
|
||
@Override | ||
public int getPriority() { | ||
return -10000; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters