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
3 changes: 3 additions & 0 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ permissions:
plotme.use.bid: true
plotme.use.dispose: true
plotme.use.done: true
plotme.use.chat: true
plotme.admin:
description: Gives default administrator commands
children:
Expand Down Expand Up @@ -92,6 +93,8 @@ permissions:
description: Gives the remove command for plots owned
plotme.use.protect:
description: Gives the protect command
plotme.use.chat:
description: Gives the chat command
plotme.limit.*:
description: Gives unlimited plots
plotme.admin.claim.other:
Expand Down
26 changes: 26 additions & 0 deletions src/com/worldcretornica/plotme/PMCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public boolean onCommand(CommandSender s, Command c, String l, String[] args)
if (a0.equalsIgnoreCase(C("CommandAddtime"))) { return addtime(p, args);}
if (a0.equalsIgnoreCase(C("CommandDone"))) { return done(p, args);}
if (a0.equalsIgnoreCase(C("CommandDoneList"))) { return donelist(p, args);}
if (a0.equalsIgnoreCase(C("CommandChat"))) { return chat(p, args);}
if (a0.equalsIgnoreCase(C("CommandProtect"))) { return protect(p, args);}

if (a0.equalsIgnoreCase(C("CommandSell"))) { return sell(p, args);}
Expand All @@ -156,6 +157,31 @@ public boolean onCommand(CommandSender s, Command c, String l, String[] args)
return false;
}

private boolean chat(CommandSender s, String[] args)
{
if(PlotMe.cPerms(s, "PlotMe.use.chat"))
{
if(args.length <= 1)
{
Send(s, C("WordUsage") + ": " + RED + "/plotme " + C("CommandChat") + " <" + C("WordMessage") + "> " + RESET + "Example: " + RED + "/plotme " + C("CommandChat") + " Hello everyone on my plot! ");
}
else
{
String str = "";
boolean firstLoop=true;
for (String currentArg : args) {
if (!firstLoop) {
str = str + currentArg + " ";
} else {
firstLoop = false;
}
}
PlotManager.sendMessageToPlot(PlotManager.getPlotId((Player)s), str.trim());
}
}
return true;
}

private boolean resetexpired(CommandSender s, String[] args)
{
if(PlotMe.cPerms(s, "PlotMe.admin.resetexpired"))
Expand Down
12 changes: 12 additions & 0 deletions src/com/worldcretornica/plotme/PlotManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,17 @@ public static List<Player> getPlayersInPlot(String id)
}
return playersInPlot;
}
public static void sendMessageToPlot(String id, String msg)//TODO move this to the Plot class?
{
for (Player p : getPlayersInPlot(id))
{
if (p.hasPermission("plotme.use.chat"))
{
p.sendMessage(msg);
}
}
}


public static void adjustLinkedPlots(String id, World world)
{
Expand Down Expand Up @@ -590,6 +601,7 @@ public static void clear(Location bottom, Location top)
{
block = new Location(bottom.getWorld(), x, y, z).getBlock();


if(y == 0)
block.setTypeId(pmi.BottomBlockId);
else if(y < pmi.RoadHeight)
Expand Down
5 changes: 4 additions & 1 deletion src/com/worldcretornica/plotme/PlotMe.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.Map.Entry;
import java.util.TreeMap;
import java.util.logging.Logger;

import net.milkbowl.vault.economy.Economy;

import org.bukkit.Bukkit;
Expand Down Expand Up @@ -812,6 +813,7 @@ public void loadCaptions()
properties.put("WordBottom", "Bottom");
properties.put("WordTop", "Top");
properties.put("WordPossessive", "'s");
properties.put("WordMessage", "Message");

properties.put("SignOwner", "Owner:");
properties.put("SignId", "ID:");
Expand Down Expand Up @@ -860,6 +862,7 @@ public void loadCaptions()
properties.put("CommandAddtime", "addtime");
properties.put("CommandDone", "done");
properties.put("CommandDoneList", "donelist");
properties.put("CommandChat", "chat");
properties.put("CommandProtect", "protect");
properties.put("CommandSell", "sell");
properties.put("CommandSellBank", "sell bank");
Expand Down