Fix dupe bugs.

This commit is contained in:
drtshock
2013-03-29 00:06:30 -05:00
parent eb33490ba8
commit de1327466b
25 changed files with 139 additions and 2 deletions
+31
View File
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
+23
View File
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>PlayerVaults</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
+5
View File
@@ -0,0 +1,5 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.6
+4
View File
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
@@ -13,10 +13,12 @@ import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.player.PlayerChangedWorldEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.inventory.Inventory;
import com.drtshock.playervaults.commands.Commands;
@@ -86,6 +88,16 @@ public class Listeners implements Listener {
}
}
@EventHandler
public void onWorld(PlayerChangedWorldEvent event) {
saveVault(event.getPlayer());
}
@EventHandler
public void onTeleport(PlayerTeleportEvent event) {
saveVault(event.getPlayer());
}
/**
* Check if a player is trying to do something while
* in a vault.
@@ -121,7 +133,12 @@ public class Listeners implements Listener {
public void onInteractEntity(PlayerInteractEntityEvent event) {
Player player = event.getPlayer();
EntityType type = event.getRightClicked().getType();
if((type == EntityType.VILLAGER||type==EntityType.MINECART) && Commands.inVault.containsKey(player.getName())) {
if((type == EntityType.VILLAGER
|| type == EntityType.MINECART
|| type == EntityType.MINECART_CHEST
|| type == EntityType.MINECART_FURNACE
|| type == EntityType.MINECART_HOPPER)
&& Commands.inVault.containsKey(player.getName())) {
event.setCancelled(true);
}
}
Binary file not shown.
+26
View File
@@ -0,0 +1,26 @@
# PlayerVaults by drsthock and gomeow!
# http://dev.bukkit.org/server-mods/playervaults
# Made with love :3
# Whether or not you want to check for updates.
# Will not download an update, that is your job :)
check-update: true
# Settings here are for economy integration. playervaults.free bypasses it.
economy:
enabled: false
# Cost to create a vault. You can give players playervaults.free to bypass this.
cost-to-create: 100
cost-to-open: 10
refund-on-delete: 50
# Configuration for dropping inventories on death.
# Bypass with playervaults.ignore.drop
drop-on-death:
enabled: false
# Max amount of inventories you want to be dropped.
# Set to 99 (or highest amount you give people) if you want all inventories to be dropped.
# WARNING: This can cause a lot of items to be dropped on the ground. Use caution :3
inventories: 1
+19
View File
@@ -0,0 +1,19 @@
# Use & for color codes.
# %p is where the player name will get inserted.
# %v is where the vault number will get inserted.
# %price is the price.
# Made with love :)
title-name: "&4[&fPlayerVaults&4]:"
open-vault: "&fOpening vault &a%v"
open-other-vault: "&fOpening vault &a%v &fof &a%p"
delete-vault: "&fDeleted vault &a%v"
delete-other-vault: "&fDeleted vault &a%v &fof &a%p"
player-only: "Sorry but that can only be run by a player!"
must-be-number: "&cYou need to specify a number between 1-99"
invalid-args: "&cInvalid args!"
delete-vault-error: "&cError deleting vault :("
no-permissions: "&cYou don't have permission for that!"
insufficient-funds: "&cYou don't have enough money for that!"
refund-amount: "&fYou were refunded &a%price &ffor deleting that vault."
cost-to-create: "&fYou were charged &c%price &ffor creating that vault."
cost-to-open: "&fYou were charged &c%price &ffor opening that vault."
+12
View File
@@ -0,0 +1,12 @@
name: PlayerVaults
main: com.drtshock.playervaults.Main
authors: [drtshock, gomeow, chester]
version: 2.1.1
website: http://dev.bukkit.org/server-mods/PlayerVaults
softdepend: [Vault]
commands:
pv:
description: Open a vault with /vault <number>
aliases: [vault, playervault, playervaults]
pvdel:
description: Delete a vault.