diff --git a/plugin.yml b/plugin.yml index 30596cf..dc0e216 100644 --- a/plugin.yml +++ b/plugin.yml @@ -3,7 +3,7 @@ main: me.ryanhamshire.GriefPrevention.GriefPrevention softdepend: [Vault, Multiverse-Core, My Worlds, MystCraft, Transporter, TheUnderground, WorldGuard, WorldEdit, RoyalCommands] dev-url: http://dev.bukkit.org/server-mods/grief-prevention loadbefore: [TheUnderground] -version: 13.5.1 +version: 13.5.2 commands: abandonclaim: description: Deletes a claim. diff --git a/src/me/ryanhamshire/GriefPrevention/CustomLogEntryTypes.java b/src/me/ryanhamshire/GriefPrevention/CustomLogEntryTypes.java index 1db8e90..9b36c47 100644 --- a/src/me/ryanhamshire/GriefPrevention/CustomLogEntryTypes.java +++ b/src/me/ryanhamshire/GriefPrevention/CustomLogEntryTypes.java @@ -24,5 +24,6 @@ public enum CustomLogEntryTypes SuspiciousActivity, AdminActivity, Debug, - Exception + Exception, + MutedChat } diff --git a/src/me/ryanhamshire/GriefPrevention/CustomLogger.java b/src/me/ryanhamshire/GriefPrevention/CustomLogger.java index a547f42..39c9903 100644 --- a/src/me/ryanhamshire/GriefPrevention/CustomLogger.java +++ b/src/me/ryanhamshire/GriefPrevention/CustomLogger.java @@ -85,6 +85,7 @@ class CustomLogger if(entryType == CustomLogEntryTypes.SuspiciousActivity && !GriefPrevention.instance.config_logs_suspiciousEnabled) return false; if(entryType == CustomLogEntryTypes.AdminActivity && !GriefPrevention.instance.config_logs_adminEnabled) return false; if(entryType == CustomLogEntryTypes.Debug && !GriefPrevention.instance.config_logs_debugEnabled) return false; + if(entryType == CustomLogEntryTypes.MutedChat && !GriefPrevention.instance.config_logs_mutedChatEnabled) return false; return true; } diff --git a/src/me/ryanhamshire/GriefPrevention/EntityEventHandler.java b/src/me/ryanhamshire/GriefPrevention/EntityEventHandler.java index 5f97d4b..65c4487 100644 --- a/src/me/ryanhamshire/GriefPrevention/EntityEventHandler.java +++ b/src/me/ryanhamshire/GriefPrevention/EntityEventHandler.java @@ -49,11 +49,13 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Monster; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; +import org.bukkit.entity.Rabbit; +import org.bukkit.entity.Rabbit.Type; import org.bukkit.entity.Tameable; import org.bukkit.entity.ThrownPotion; import org.bukkit.entity.Villager; import org.bukkit.entity.WaterMob; - +import org.bukkit.entity.minecart.ExplosiveMinecart; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; @@ -99,7 +101,7 @@ public class EntityEventHandler implements Listener @EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST) public void onEntityChangeBLock(EntityChangeBlockEvent event) { - if(!GriefPrevention.instance.config_endermenMoveBlocks && event.getEntityType() == EntityType.ENDERMAN) + if(!GriefPrevention.instance.config_endermenMoveBlocks && event.getEntityType() == EntityType.ENDERMAN) { event.setCancelled(true); } @@ -561,6 +563,13 @@ public class EntityEventHandler implements Listener //monsters are never protected if(event.getEntity() instanceof Monster) return; + //nor are killer bunnies + if(event.getEntity() instanceof Rabbit) + { + Rabbit rabbit = (Rabbit)event.getEntity(); + if(rabbit.getRabbitType() == Rabbit.Type.THE_KILLER_BUNNY) return; + } + //horse protections can be disabled if(event.getEntity() instanceof Horse && !GriefPrevention.instance.config_claims_protectHorses) return; @@ -791,7 +800,7 @@ public class EntityEventHandler implements Listener PlayerData playerData = null; //if not a player or an explosive, allow - if(attacker == null && damageSource != null && !(damageSource instanceof Projectile) && damageSource.getType() != EntityType.CREEPER && !(damageSource instanceof Explosive)) + if(attacker == null && damageSource != null && !(damageSource instanceof Projectile) && damageSource.getType() != EntityType.CREEPER && !(damageSource instanceof Explosive) && !(damageSource instanceof ExplosiveMinecart)) { return; } diff --git a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java index 232ea25..824a298 100644 --- a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -189,6 +189,7 @@ public class GriefPrevention extends JavaPlugin public boolean config_logs_suspiciousEnabled; public boolean config_logs_adminEnabled; public boolean config_logs_debugEnabled; + public boolean config_logs_mutedChatEnabled; //ban management plugin interop settings public boolean config_ban_useCommand; @@ -727,6 +728,7 @@ public class GriefPrevention extends JavaPlugin this.config_logs_suspiciousEnabled = config.getBoolean("GriefPrevention.Abridged Logs.Included Entry Types.Suspicious Activity", true); this.config_logs_adminEnabled = config.getBoolean("GriefPrevention.Abridged Logs.Included Entry Types.Administrative Activity", false); this.config_logs_debugEnabled = config.getBoolean("GriefPrevention.Abridged Logs.Included Entry Types.Debug", false); + this.config_logs_mutedChatEnabled = config.getBoolean("GriefPrevention.Abridged Logs.Included Entry Types.Muted Chat Messages", false); //claims mode by world for(World world : this.config_claims_worldModes.keySet()) @@ -846,6 +848,7 @@ public class GriefPrevention extends JavaPlugin outConfig.set("GriefPrevention.Abridged Logs.Included Entry Types.Suspicious Activity", this.config_logs_suspiciousEnabled); outConfig.set("GriefPrevention.Abridged Logs.Included Entry Types.Administrative Activity", this.config_logs_adminEnabled); outConfig.set("GriefPrevention.Abridged Logs.Included Entry Types.Debug", this.config_logs_debugEnabled); + outConfig.set("GriefPrevention.Abridged Logs.Included Entry Types.Muted Chat Messages", this.config_logs_mutedChatEnabled); try { @@ -1032,6 +1035,7 @@ public class GriefPrevention extends JavaPlugin } Visualization visualization = Visualization.FromClaim(result.claim, player.getEyeLocation().getBlockY(), VisualizationType.Claim, player.getLocation()); Visualization.Apply(player, visualization); + playerData.claimResizing = null; playerData.lastShovelLocation = null; this.autoExtendClaim(result.claim); @@ -1102,7 +1106,6 @@ public class GriefPrevention extends JavaPlugin //determine new corner coordinates org.bukkit.util.Vector direction = player.getLocation().getDirection(); -GriefPrevention.AddLogEntry(direction.toString()); if(direction.getY() > .75) { GriefPrevention.sendMessage(player, TextMode.Info, Messages.ClaimsExtendToSky); diff --git a/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java b/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java index 9b13343..5e198d3 100644 --- a/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java +++ b/src/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java @@ -144,7 +144,7 @@ class PlayerEventHandler implements Listener recipients.clear(); recipients.addAll(recipientsToKeep); - GriefPrevention.AddLogEntry(notificationMessage, CustomLogEntryTypes.AdminActivity, false); + GriefPrevention.AddLogEntry(notificationMessage, CustomLogEntryTypes.MutedChat, false); } //troll and excessive profanity filter @@ -170,7 +170,7 @@ class PlayerEventHandler implements Listener //otherwise assume chat troll and mute all chat from this sender until an admin says otherwise else { - GriefPrevention.AddLogEntry("Auto-muted new player " + player.getName() + " for profanity shortly after join. Use /SoftMute to undo."); + GriefPrevention.AddLogEntry("Auto-muted new player " + player.getName() + " for profanity shortly after join. Use /SoftMute to undo.", CustomLogEntryTypes.AdminActivity); GriefPrevention.instance.dataStore.toggleSoftMute(player.getUniqueId()); } } @@ -635,6 +635,7 @@ class PlayerEventHandler implements Listener //otherwise build a list of all the aliases of this command across all installed plugins HashSet aliases = new HashSet(); aliases.add(commandName); + aliases.add("minecraft:" + commandName); for(Plugin plugin : Bukkit.getServer().getPluginManager().getPlugins()) { JavaPlugin javaPlugin = (JavaPlugin)plugin;