-
Notifications
You must be signed in to change notification settings - Fork 4
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
Tim W
committed
Jul 13, 2020
1 parent
5688b13
commit 659344c
Showing
17 changed files
with
365 additions
and
26 deletions.
There are no files selected for viewing
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
48 changes: 48 additions & 0 deletions
48
src/main/java/tim03we/futureplots/commands/sub/DeleteHomeCommand.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,48 @@ | ||
package tim03we.futureplots.commands.sub; | ||
|
||
/* | ||
* This software is distributed under "GNU General Public License v3.0". | ||
* This license allows you to use it and/or modify it but you are not at | ||
* all allowed to sell this plugin at any cost. If found doing so the | ||
* necessary action required would be taken. | ||
* | ||
* FuturePlots is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License v3.0 for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License v3.0 | ||
* along with this program. If not, see | ||
* <https://opensource.org/licenses/GPL-3.0>. | ||
*/ | ||
|
||
import cn.nukkit.Player; | ||
import cn.nukkit.command.CommandSender; | ||
import tim03we.futureplots.FuturePlots; | ||
import tim03we.futureplots.commands.BaseCommand; | ||
import tim03we.futureplots.utils.Plot; | ||
import tim03we.futureplots.utils.PlotPlayer; | ||
|
||
public class DeleteHomeCommand extends BaseCommand { | ||
|
||
public DeleteHomeCommand(String name, String description, String usage) { | ||
super(name, description, usage); | ||
} | ||
|
||
@Override | ||
public void execute(CommandSender sender, String command, String[] args) { | ||
if(sender instanceof Player) { | ||
Plot plot = new PlotPlayer((Player) sender).getPlot(); | ||
if(plot != null) { | ||
if(plot.canByPass((Player) sender)) { | ||
FuturePlots.provider.deleteHome(plot); | ||
sender.sendMessage(translate(true, "plot.home.delete")); | ||
} else { | ||
sender.sendMessage(translate(true, "not.a.owner")); | ||
} | ||
} else { | ||
sender.sendMessage(translate(true, "not.in.plot")); | ||
} | ||
} | ||
} | ||
} |
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
48 changes: 48 additions & 0 deletions
48
src/main/java/tim03we/futureplots/commands/sub/SetHomeCommand.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,48 @@ | ||
package tim03we.futureplots.commands.sub; | ||
|
||
/* | ||
* This software is distributed under "GNU General Public License v3.0". | ||
* This license allows you to use it and/or modify it but you are not at | ||
* all allowed to sell this plugin at any cost. If found doing so the | ||
* necessary action required would be taken. | ||
* | ||
* FuturePlots is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License v3.0 for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License v3.0 | ||
* along with this program. If not, see | ||
* <https://opensource.org/licenses/GPL-3.0>. | ||
*/ | ||
|
||
import cn.nukkit.Player; | ||
import cn.nukkit.command.CommandSender; | ||
import tim03we.futureplots.FuturePlots; | ||
import tim03we.futureplots.commands.BaseCommand; | ||
import tim03we.futureplots.utils.Plot; | ||
import tim03we.futureplots.utils.PlotPlayer; | ||
|
||
public class SetHomeCommand extends BaseCommand { | ||
|
||
public SetHomeCommand(String name, String description, String usage) { | ||
super(name, description, usage); | ||
} | ||
|
||
@Override | ||
public void execute(CommandSender sender, String command, String[] args) { | ||
if(sender instanceof Player) { | ||
Plot plot = new PlotPlayer((Player) sender).getPlot(); | ||
if(plot != null) { | ||
if(plot.canByPass((Player) sender)) { | ||
FuturePlots.provider.setHome(plot, ((Player) sender).getLocation()); | ||
sender.sendMessage(translate(true, "plot.home.set")); | ||
} else { | ||
sender.sendMessage(translate(true, "not.a.owner")); | ||
} | ||
} else { | ||
sender.sendMessage(translate(true, "not.in.plot")); | ||
} | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.