This commit is contained in:
ryanhamshire 2013-01-05 08:19:42 -08:00
parent 239f069d2b
commit 6fa1b7340c
6 changed files with 2816 additions and 2799 deletions

View File

@ -2,7 +2,7 @@ name: GriefPrevention
main: me.ryanhamshire.GriefPrevention.GriefPrevention main: me.ryanhamshire.GriefPrevention.GriefPrevention
softdepend: [Vault, Multiverse-Core, My Worlds, MystCraft, Transporter] softdepend: [Vault, Multiverse-Core, My Worlds, MystCraft, Transporter]
dev-url: http://dev.bukkit.org/server-mods/grief-prevention dev-url: http://dev.bukkit.org/server-mods/grief-prevention
version: 7.1.2 version: 7.2
commands: commands:
abandonclaim: abandonclaim:
description: Deletes a claim. description: Deletes a claim.

File diff suppressed because it is too large Load Diff

View File

@ -105,6 +105,7 @@ public class GriefPrevention extends JavaPlugin
public String config_spam_banMessage; //message to show an automatically banned player public String config_spam_banMessage; //message to show an automatically banned player
public String config_spam_warningMessage; //message to show a player who is close to spam level public String config_spam_warningMessage; //message to show a player who is close to spam level
public String config_spam_allowedIpAddresses; //IP addresses which will not be censored public String config_spam_allowedIpAddresses; //IP addresses which will not be censored
public int config_spam_deathMessageCooldownSeconds; //cooldown period for death messages (per player) in seconds
public ArrayList<World> config_pvp_enabledWorlds; //list of worlds where pvp anti-grief rules apply public ArrayList<World> config_pvp_enabledWorlds; //list of worlds where pvp anti-grief rules apply
public boolean config_pvp_protectFreshSpawns; //whether to make newly spawned players immune until they pick up an item public boolean config_pvp_protectFreshSpawns; //whether to make newly spawned players immune until they pick up an item
@ -324,6 +325,7 @@ public class GriefPrevention extends JavaPlugin
this.config_spam_banOffenders = config.getBoolean("GriefPrevention.Spam.BanOffenders", true); this.config_spam_banOffenders = config.getBoolean("GriefPrevention.Spam.BanOffenders", true);
this.config_spam_banMessage = config.getString("GriefPrevention.Spam.BanMessage", "Banned for spam."); this.config_spam_banMessage = config.getString("GriefPrevention.Spam.BanMessage", "Banned for spam.");
String slashCommandsToMonitor = config.getString("GriefPrevention.Spam.MonitorSlashCommands", "/me;/tell;/global;/local"); String slashCommandsToMonitor = config.getString("GriefPrevention.Spam.MonitorSlashCommands", "/me;/tell;/global;/local");
this.config_spam_deathMessageCooldownSeconds = config.getInt("GriefPrevention.Spam.DeathMessageCooldownSeconds", 60);
this.config_pvp_protectFreshSpawns = config.getBoolean("GriefPrevention.PvP.ProtectFreshSpawns", true); this.config_pvp_protectFreshSpawns = config.getBoolean("GriefPrevention.PvP.ProtectFreshSpawns", true);
this.config_pvp_punishLogout = config.getBoolean("GriefPrevention.PvP.PunishLogout", true); this.config_pvp_punishLogout = config.getBoolean("GriefPrevention.PvP.PunishLogout", true);
@ -561,6 +563,7 @@ public class GriefPrevention extends JavaPlugin
config.set("GriefPrevention.Spam.BanOffenders", this.config_spam_banOffenders); config.set("GriefPrevention.Spam.BanOffenders", this.config_spam_banOffenders);
config.set("GriefPrevention.Spam.BanMessage", this.config_spam_banMessage); config.set("GriefPrevention.Spam.BanMessage", this.config_spam_banMessage);
config.set("GriefPrevention.Spam.AllowedIpAddresses", this.config_spam_allowedIpAddresses); config.set("GriefPrevention.Spam.AllowedIpAddresses", this.config_spam_allowedIpAddresses);
config.set("GriefPrevention.Spam.DeathMessageCooldownSeconds", this.config_spam_deathMessageCooldownSeconds);
config.set("GriefPrevention.PvP.Worlds", pvpEnabledWorldNames); config.set("GriefPrevention.PvP.Worlds", pvpEnabledWorldNames);
config.set("GriefPrevention.PvP.ProtectFreshSpawns", this.config_pvp_protectFreshSpawns); config.set("GriefPrevention.PvP.ProtectFreshSpawns", this.config_pvp_protectFreshSpawns);
@ -903,11 +906,6 @@ public class GriefPrevention extends JavaPlugin
GriefPrevention.sendMessage(player, TextMode.Instr, Messages.TransferClaimMissing); GriefPrevention.sendMessage(player, TextMode.Instr, Messages.TransferClaimMissing);
return true; return true;
} }
else if(!claim.isAdminClaim())
{
GriefPrevention.sendMessage(player, TextMode.Err, Messages.TransferClaimAdminOnly);
return true;
}
OfflinePlayer targetPlayer = this.resolvePlayer(args[0]); OfflinePlayer targetPlayer = this.resolvePlayer(args[0]);
if(targetPlayer == null) if(targetPlayer == null)
@ -1493,7 +1491,7 @@ public class GriefPrevention extends JavaPlugin
//load the target player's data //load the target player's data
PlayerData playerData = this.dataStore.getPlayerData(otherPlayer.getName()); PlayerData playerData = this.dataStore.getPlayerData(otherPlayer.getName());
GriefPrevention.sendMessage(player, TextMode.Instr, " " + playerData.accruedClaimBlocks + "(+" + playerData.bonusClaimBlocks + this.dataStore.getGroupBonusBlocks(otherPlayer.getName()) + ")=" + (playerData.accruedClaimBlocks + playerData.bonusClaimBlocks + this.dataStore.getGroupBonusBlocks(otherPlayer.getName()))); GriefPrevention.sendMessage(player, TextMode.Instr, " " + playerData.accruedClaimBlocks + "(+" + (playerData.bonusClaimBlocks + this.dataStore.getGroupBonusBlocks(otherPlayer.getName())) + ")=" + (playerData.accruedClaimBlocks + playerData.bonusClaimBlocks + this.dataStore.getGroupBonusBlocks(otherPlayer.getName())));
for(int i = 0; i < playerData.claims.size(); i++) for(int i = 0; i < playerData.claims.size(); i++)
{ {
Claim claim = playerData.claims.get(i); Claim claim = playerData.claims.get(i);
@ -2392,7 +2390,7 @@ public class GriefPrevention extends JavaPlugin
SendPlayerMessageTask task = new SendPlayerMessageTask(player, color, message); SendPlayerMessageTask task = new SendPlayerMessageTask(player, color, message);
if(delayInTicks > 0) if(delayInTicks > 0)
{ {
GriefPrevention.instance.getServer().getScheduler().scheduleAsyncDelayedTask(GriefPrevention.instance, task, delayInTicks); GriefPrevention.instance.getServer().getScheduler().runTaskLater(GriefPrevention.instance, task, delayInTicks);
} }
else else
{ {
@ -2537,7 +2535,7 @@ public class GriefPrevention extends JavaPlugin
//create task //create task
//when done processing, this task will create a main thread task to actually update the world with processing results //when done processing, this task will create a main thread task to actually update the world with processing results
RestoreNatureProcessingTask task = new RestoreNatureProcessingTask(snapshots, miny, chunk.getWorld().getEnvironment(), lesserBoundaryCorner.getBlock().getBiome(), lesserBoundaryCorner, greaterBoundaryCorner, this.getSeaLevel(chunk.getWorld()), aggressiveMode, GriefPrevention.instance.creativeRulesApply(lesserBoundaryCorner), playerReceivingVisualization); RestoreNatureProcessingTask task = new RestoreNatureProcessingTask(snapshots, miny, chunk.getWorld().getEnvironment(), lesserBoundaryCorner.getBlock().getBiome(), lesserBoundaryCorner, greaterBoundaryCorner, this.getSeaLevel(chunk.getWorld()), aggressiveMode, GriefPrevention.instance.creativeRulesApply(lesserBoundaryCorner), playerReceivingVisualization);
GriefPrevention.instance.getServer().getScheduler().scheduleAsyncDelayedTask(GriefPrevention.instance, task, delayInTicks); GriefPrevention.instance.getServer().getScheduler().runTaskLaterAsynchronously(GriefPrevention.instance, task, delayInTicks);
} }
private void parseMaterialListFromConfig(List<String> stringsToParse, MaterialCollection materialCollection) private void parseMaterialListFromConfig(List<String> stringsToParse, MaterialCollection materialCollection)

View File

@ -70,6 +70,9 @@ public class PlayerData
//number of blocks placed outside claims before next warning //number of blocks placed outside claims before next warning
int unclaimedBlockPlacementsUntilWarning = 1; int unclaimedBlockPlacementsUntilWarning = 1;
//timestamp of last death, for use in preventing death message spam
long lastDeathTimeStamp = 0;
//spam //spam
public Date lastLogin; //when the player last logged into the server public Date lastLogin; //when the player last logged into the server
public String lastMessage = ""; //the player's last chat message, or slash command complete with parameters public String lastMessage = ""; //the player's last chat message, or slash command complete with parameters

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +1,31 @@
/* /*
GriefPrevention Server Plugin for Minecraft GriefPrevention Server Plugin for Minecraft
Copyright (C) 2012 Ryan Hamshire Copyright (C) 2012 Ryan Hamshire
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package me.ryanhamshire.GriefPrevention; package me.ryanhamshire.GriefPrevention;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
//just a few constants for chat color codes //just a few constants for chat color codes
class TextMode class TextMode
{ {
final static ChatColor Info = ChatColor.BLUE; final static ChatColor Info = ChatColor.AQUA;
final static ChatColor Instr = ChatColor.YELLOW; final static ChatColor Instr = ChatColor.YELLOW;
final static ChatColor Warn = ChatColor.GOLD; final static ChatColor Warn = ChatColor.GOLD;
final static ChatColor Err = ChatColor.RED; final static ChatColor Err = ChatColor.RED;
final static ChatColor Success = ChatColor.GREEN; final static ChatColor Success = ChatColor.GREEN;
} }