Merge pull request #7 from CweepahCraft/unlockothersdrops
Add admin command to unlock the drops of other players.
This commit is contained in:
commit
7c5fe862cc
|
|
@ -1557,6 +1557,7 @@ public abstract class DataStore
|
||||||
this.addDefault(defaults, Messages.DropUnlockAdvertisement, "Other players can't pick up your dropped items unless you /UnlockDrops first.", null);
|
this.addDefault(defaults, Messages.DropUnlockAdvertisement, "Other players can't pick up your dropped items unless you /UnlockDrops first.", null);
|
||||||
this.addDefault(defaults, Messages.PickupBlockedExplanation, "You can't pick this up unless {0} uses /UnlockDrops.", "0: The item stack's owner.");
|
this.addDefault(defaults, Messages.PickupBlockedExplanation, "You can't pick this up unless {0} uses /UnlockDrops.", "0: The item stack's owner.");
|
||||||
this.addDefault(defaults, Messages.DropUnlockConfirmation, "Unlocked your drops. Other players may now pick them up (until you die again).", null);
|
this.addDefault(defaults, Messages.DropUnlockConfirmation, "Unlocked your drops. Other players may now pick them up (until you die again).", null);
|
||||||
|
this.addDefault(defaults, Messages.DropUnlockOthersConfirmation, "Unlocked {0}'s drops.", "0: The owner of the unlocked drops.");
|
||||||
this.addDefault(defaults, Messages.AdvertiseACandACB, "You may use /ACB to give yourself more claim blocks, or /AdminClaims to create a free administrative claim.", null);
|
this.addDefault(defaults, Messages.AdvertiseACandACB, "You may use /ACB to give yourself more claim blocks, or /AdminClaims to create a free administrative claim.", null);
|
||||||
this.addDefault(defaults, Messages.AdvertiseAdminClaims, "You could create an administrative land claim instead using /AdminClaims, which you'd share with other administrators.", null);
|
this.addDefault(defaults, Messages.AdvertiseAdminClaims, "You could create an administrative land claim instead using /AdminClaims, which you'd share with other administrators.", null);
|
||||||
this.addDefault(defaults, Messages.AdvertiseACB, "You may use /ACB to give yourself more claim blocks.", null);
|
this.addDefault(defaults, Messages.AdvertiseACB, "You may use /ACB to give yourself more claim blocks.", null);
|
||||||
|
|
|
||||||
|
|
@ -2131,9 +2131,27 @@ public class GriefPrevention extends JavaPlugin
|
||||||
//unlockItems
|
//unlockItems
|
||||||
else if(cmd.getName().equalsIgnoreCase("unlockdrops") && player != null)
|
else if(cmd.getName().equalsIgnoreCase("unlockdrops") && player != null)
|
||||||
{
|
{
|
||||||
PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId());
|
PlayerData playerData;
|
||||||
playerData.dropsAreUnlocked = true;
|
|
||||||
|
if (player.hasPermission("griefprevention.unlockothersdrops") && args.length == 1)
|
||||||
|
{
|
||||||
|
Player otherPlayer = Bukkit.getPlayer(args[0]);
|
||||||
|
if (otherPlayer == null)
|
||||||
|
{
|
||||||
|
GriefPrevention.sendMessage(player, TextMode.Err, Messages.PlayerNotFound2);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
playerData = this.dataStore.getPlayerData(otherPlayer.getUniqueId());
|
||||||
|
GriefPrevention.sendMessage(player, TextMode.Success, Messages.DropUnlockOthersConfirmation, otherPlayer.getName());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
playerData = this.dataStore.getPlayerData(player.getUniqueId());
|
||||||
GriefPrevention.sendMessage(player, TextMode.Success, Messages.DropUnlockConfirmation);
|
GriefPrevention.sendMessage(player, TextMode.Success, Messages.DropUnlockConfirmation);
|
||||||
|
}
|
||||||
|
|
||||||
|
playerData.dropsAreUnlocked = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -187,6 +187,7 @@ public enum Messages
|
||||||
DropUnlockAdvertisement,
|
DropUnlockAdvertisement,
|
||||||
PickupBlockedExplanation,
|
PickupBlockedExplanation,
|
||||||
DropUnlockConfirmation,
|
DropUnlockConfirmation,
|
||||||
|
DropUnlockOthersConfirmation,
|
||||||
AdvertiseACandACB,
|
AdvertiseACandACB,
|
||||||
AdvertiseAdminClaims,
|
AdvertiseAdminClaims,
|
||||||
AdvertiseACB,
|
AdvertiseACB,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user