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
8 changes: 8 additions & 0 deletions MailBox/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="lib" path="C:/Users/Seth/git/rpextensions/craftbukkit-1.8.6.jar"/>
<classpathentry kind="lib" path="C:/Users/Seth/git/MailBox/Vault.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions MailBox/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>MailBox</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
11 changes: 11 additions & 0 deletions MailBox/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
1 change: 1 addition & 0 deletions MailBox/bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/me/
80 changes: 80 additions & 0 deletions MailBox/plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: MailBox
main: me.iaccidentally.mailbox.MailBoxPlugin
version: 2.8
authors: [safoo, Iaccidentally, sethhope]
description: Mailbox plugin for bukkit
softdepend: [Vault]
commands:
mailbox:
description: mailbox commands
usage: /mailbox
aliases: [mbox]
msend:
description: send a package. The same as /mailbox send <player_name>.
usage: /msend <player_name>

permissions:

mailbox.*:
description: Gives access to all mailbox commands
children:
mailbox.user.*: true
mailbox.admin.*: true
mailbox.postman.*: true
mailbox.nocooldown: true
mailbox.sendtoself: true

mailbox.user.*:
description: Gives access to all mailbox commands
children:
mailbox.user.create: true
mailbox.user.send: true
mailbox.user.remove: true

mailbox.admin.*:
description: Gives access to all doorman commands
children:
mailbox.admin.viewlog: true
mailbox.admin.removeany: true

mailbox.postman.*:
description: Gives access to all doorman commands
children:
mailbox.postman.createother: true
mailbox.postman.removeother: true

mailbox.user.create:
description: Can create own mailbox.
default: false

mailbox.user.send:
description: Can send a package.
default: false

mailbox.user.remove:
description: Can remove own mailbox.
default: false

mailbox.admin.viewlog:
description: Can view a log.
default: op

mailbox.admin.removeany:
description: Can remove any mailbox.
default: op

mailbox.postman.createother:
description: Can create a mailbox for someone else.
default: op

mailbox.postman.removeother:
description: Can remove mailboxes which he created.
default: op

mailbox.nocooldown:
description: Player does not have the send cooldown.
default: op

mailbox.sendtoself:
description: Player can send package to himself.
default: op
46 changes: 46 additions & 0 deletions MailBox/src/me/iaccidentally/mailbox/MailBoxPlayerListener.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package me.iaccidentally.mailbox;

import org.bukkit.GameMode;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;


public class MailBoxPlayerListener implements Listener
{
private final MailBoxPlugin plugin;

public MailBoxPlayerListener(MailBoxPlugin plugin)
{
this.plugin = plugin;
}

@EventHandler(priority = EventPriority.NORMAL)
public void onPlayerInteract(PlayerInteractEvent event)
{
if (event.getAction() != Action.LEFT_CLICK_BLOCK)
{
return;
}
Player player = event.getPlayer();
Block block = event.getClickedBlock();

if (this.plugin.akcia.get(player) == null)
{
return;
}
if (this.plugin.disable_in_creative == true && event.getPlayer().getGameMode() == GameMode.CREATIVE)
{
player.sendMessage("You cannot use this while in creative mode");
this.plugin.akcia.remove(player);
return;
}
String result = this.plugin.createMailBox(player, (String)this.plugin.akcia.get(player), block);
this.plugin.akcia.remove(player);
player.sendMessage(result);
}
}
Loading