Update AllPay, Hopefully fix the BOSEcon bug

This commit is contained in:
Eric Stokes 2011-08-16 18:02:43 -06:00
parent 93fab486ff
commit afc388637f
5 changed files with 16 additions and 52 deletions

@ -1 +1 @@
Subproject commit 44e62ec33ec37d89cb1b8a2dd897b0747d148833
Subproject commit c8c6a2096af3e8b07749b9ea80f6a1bb0a088d4e

View File

@ -158,6 +158,13 @@
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>me.ashtheking.currency</groupId>
<artifactId>MultiCurrency</artifactId>
<version>0.09</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- End of Economy Dependencies -->
<!-- Start of Permissions Dependencies -->

View File

@ -73,7 +73,11 @@ public class InfoCommand extends MultiverseCommand {
}
if (this.plugin.isMVWorld(worldName)) {
showPage(pageNum, sender, this.buildEntireCommand(this.plugin.getMVWorld(worldName)));
Player p = null;
if(sender instanceof Player) {
p = (Player) sender;
}
showPage(pageNum, sender, this.buildEntireCommand(this.plugin.getMVWorld(worldName), p));
} else if (this.plugin.getServer().getWorld(worldName) != null) {
sender.sendMessage("That world exists, but multiverse does not know about it!");
sender.sendMessage("You can import it with" + ChatColor.AQUA + "/mv import " + ChatColor.GREEN + worldName + ChatColor.LIGHT_PURPLE + "{ENV}");
@ -81,7 +85,7 @@ public class InfoCommand extends MultiverseCommand {
}
}
private List<List<FancyText>> buildEntireCommand(MVWorld world) {
private List<List<FancyText>> buildEntireCommand(MVWorld world, Player p) {
List<FancyText> message = new ArrayList<FancyText>();
List<List<FancyText>> worldInfo = new ArrayList<List<FancyText>>();
// Page 1
@ -94,7 +98,7 @@ public class InfoCommand extends MultiverseCommand {
message.add(new FancyMessage("Spawn Location: ", "(" + spawn.getBlockX() + ", " + spawn.getBlockY() + ", " + spawn.getBlockZ() + ")", colors));
message.add(new FancyMessage("World Scale: ", world.getScaling().toString(), colors));
if (world.getPrice() > 0) {
message.add(new FancyMessage("Price to enter this world: ", this.plugin.getBank().getFormattedAmount(world.getPrice(), world.getCurrency()), colors));
message.add(new FancyMessage("Price to enter this world: ", this.plugin.getBank().getFormattedAmount(p, world.getPrice(), world.getCurrency()), colors));
} else {
message.add(new FancyMessage("Price to enter this world: ", ChatColor.GREEN + "FREE!", colors));
}

View File

@ -1,47 +0,0 @@
package com.onarandombox.MultiverseCore.listeners;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.event.block.BlockListener;
import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import com.onarandombox.MultiverseCore.MultiverseCore;
//import org.bukkit.event.block.BlockRightClickEvent;
public class MVBlockListener extends BlockListener {
MultiverseCore plugin;
public MVBlockListener(MultiverseCore plugin) {
this.plugin = plugin;
}
// public void onBlockRightClicked(BlockRightClickEvent event){
// }
@Override
public void onBlockDamage(BlockDamageEvent event) {
}
@Override
public void onBlockPhysics(BlockPhysicsEvent event) {
if (event.isCancelled()) {
return;
}
int id = event.getChangedTypeId();
if (id == 90) { // && config.getBoolean("portalanywhere", false)
event.setCancelled(true);
return;
}
}
public void onBlockPlaced(BlockPlaceEvent event) {
}
}

View File

@ -129,7 +129,7 @@ public class MVPlayerListener extends PlayerListener {
return;
}
GenericBank bank = plugin.getBank();
if (!bank.hasEnough(event.getPlayer(), toWorld.getPrice(), toWorld.getCurrency(), "You need " + bank.getFormattedAmount(toWorld.getPrice(), toWorld.getCurrency()) + " to enter " + toWorld.getColoredWorldString())) {
if (!bank.hasEnough(event.getPlayer(), toWorld.getPrice(), toWorld.getCurrency(), "You need " + bank.getFormattedAmount(event.getPlayer(), toWorld.getPrice(), toWorld.getCurrency()) + " to enter " + toWorld.getColoredWorldString())) {
event.setCancelled(true);
} else {
bank.pay(event.getPlayer(), toWorld.getPrice(), toWorld.getCurrency());