1
0
mirror of https://e.coding.net/circlecloud/Residence.git synced 2024-10-31 22:38:48 +00:00

fix onPlayerMove NullPointerException...

Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
j502647092 2015-08-01 17:05:02 +08:00
parent 24127af11f
commit 7dcda9b2d9
3 changed files with 16 additions and 13 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>cn.CityCraft</groupId>
<artifactId>Residence</artifactId>
<version>2.7.0.5-SNAPSHOT</version>
<version>2.7.0.6-SNAPSHOT</version>
<name>Residence</name>
<build>
<finalName>${project.name}</finalName>

View File

@ -196,8 +196,8 @@ public class ResidencePlayerListener implements Listener {
ActionBar.send(
player,
(new StringBuilder()).append(ChatColor.YELLOW)
.append(insertMessages(player, areaname, res, enterMessage))
.toString());
.append(insertMessages(player, areaname, res, enterMessage))
.toString());
} else {
player.sendMessage(ChatColor.YELLOW
+ this.insertMessages(player, areaname, res, enterMessage));
@ -245,7 +245,7 @@ public class ResidencePlayerListener implements Listener {
|| mat == Material.PISTON_STICKY_BASE
|| mat == Material.DRAGON_EGG
|| Residence.getConfigManager().getCustomBothClick()
.contains(Integer.valueOf(block.getTypeId()));
.contains(Integer.valueOf(block.getTypeId()));
}
private boolean isCanUseEntity_RClickOnly(Material mat, Block block) {
@ -264,14 +264,14 @@ public class ResidencePlayerListener implements Listener {
|| mat == Material.BREWING_STAND
|| mat == Material.ENCHANTMENT_TABLE
|| Residence.getConfigManager().getCustomRightClick()
.contains(Integer.valueOf(block.getTypeId()));
.contains(Integer.valueOf(block.getTypeId()));
}
private boolean isContainer(Material mat, Block block) {
return FlagPermissions.getMaterialUseFlagList().containsKey(mat)
&& FlagPermissions.getMaterialUseFlagList().get(mat).equals("container")
|| Residence.getConfigManager().getCustomContainers()
.contains(Integer.valueOf(block.getTypeId()));
.contains(Integer.valueOf(block.getTypeId()));
}
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
@ -415,16 +415,16 @@ public class ResidencePlayerListener implements Listener {
player.sendMessage(ChatColor.GREEN
+ Residence.getLanguage().getPhrase("SelectPoint",
Residence.getLanguage().getPhrase("Primary"))
+ ChatColor.RED + "(" + loc.getBlockX() + "," + loc.getBlockY()
+ "," + loc.getBlockZ() + ")" + ChatColor.GREEN + "!");
+ ChatColor.RED + "(" + loc.getBlockX() + "," + loc.getBlockY()
+ "," + loc.getBlockZ() + ")" + ChatColor.GREEN + "!");
} else if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
Location loc = block.getLocation();
Residence.getSelectionManager().placeLoc2(player, loc);
player.sendMessage(ChatColor.GREEN
+ Residence.getLanguage().getPhrase("SelectPoint",
Residence.getLanguage().getPhrase("Secondary"))
+ ChatColor.RED + "(" + loc.getBlockX() + "," + loc.getBlockY()
+ "," + loc.getBlockZ() + ")" + ChatColor.GREEN + "!");
+ ChatColor.RED + "(" + loc.getBlockX() + "," + loc.getBlockY()
+ "," + loc.getBlockZ() + ")" + ChatColor.GREEN + "!");
}
event.setCancelled(true);
}
@ -452,7 +452,7 @@ public class ResidencePlayerListener implements Listener {
|| player.getItemInHand().getData().getData() == 3
&& block.getTypeId() == 17
&& (block.getData() == 3 || block.getData() == 7
|| block.getData() == 11 || block.getData() == 15)) {
|| block.getData() == 11 || block.getData() == 15)) {
perms = Residence.getPermsByLocForPlayer(
block.getRelative(event.getBlockFace()).getLocation(),
player);
@ -610,8 +610,11 @@ public class ResidencePlayerListener implements Listener {
Player player = event.getPlayer();
if (player == null)
return;
long last = lastUpdate.get(player.getName());
long now = System.currentTimeMillis();
if (!lastUpdate.containsKey(player.getName())) {
lastUpdate.put(player.getName(), now);
}
long last = lastUpdate.get(player.getName());
if (now - last < Residence.getConfigManager().getMinMoveUpdateInterval())
return;
lastUpdate.put(player.getName(), now);

View File

@ -1,6 +1,6 @@
name: Residence
main: com.bekvon.bukkit.residence.ResidenceCommandListener
version: 2.7.0.5
version: 2.7.0.6
website: http://ci.citycraft.cn:8800/jenkins/job/Residence-Fix/
description: Cuboid Residence Plugin
authors: [bekvon,nate302,t00thpick1,喵♂呜]