Take into account world/network restrictions for Vehicles
Properly teleport empty vehicles between worlds Properly teleport StoreageMinecarts between worlds Take into account vehicle type when teleporting
This commit is contained in:
parent
6c2b9b00aa
commit
4968927528
5
README
5
README
@ -130,6 +130,11 @@ maxgates - If non-zero, will define the maximum amount of gates allowed on a net
|
|||||||
=============
|
=============
|
||||||
Changes
|
Changes
|
||||||
=============
|
=============
|
||||||
|
[Version 0.5.1]
|
||||||
|
- Take into account world/network restrictions for Vehicles
|
||||||
|
- Properly teleport empty vehicles between worlds
|
||||||
|
- Properly teleport StoreageMinecarts between worlds
|
||||||
|
- Take into account vehicle type when teleporting
|
||||||
[Version 0.5.0]
|
[Version 0.5.0]
|
||||||
- Updated the teleport method
|
- Updated the teleport method
|
||||||
- Remove always-open gates from lists
|
- Remove always-open gates from lists
|
||||||
|
@ -18,6 +18,7 @@ import org.bukkit.block.Sign;
|
|||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Minecart;
|
import org.bukkit.entity.Minecart;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.StorageMinecart;
|
||||||
import org.bukkit.entity.Vehicle;
|
import org.bukkit.entity.Vehicle;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
import org.bukkit.material.Button;
|
import org.bukkit.material.Button;
|
||||||
@ -252,19 +253,23 @@ public class Portal {
|
|||||||
|
|
||||||
final Entity passenger = vehicle.getPassenger();
|
final Entity passenger = vehicle.getPassenger();
|
||||||
if (passenger != null) {
|
if (passenger != null) {
|
||||||
|
final Vehicle v = exit.getWorld().spawn(exit, vehicle.getClass());
|
||||||
vehicle.eject();
|
vehicle.eject();
|
||||||
vehicle.remove();
|
vehicle.remove();
|
||||||
final Minecart mc = exit.getWorld().spawn(exit, Minecart.class);
|
|
||||||
passenger.teleport(exit);
|
passenger.teleport(exit);
|
||||||
Stargate.server.getScheduler().scheduleSyncDelayedTask(Stargate.stargate, new Runnable() {
|
Stargate.server.getScheduler().scheduleSyncDelayedTask(Stargate.stargate, new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
mc.setPassenger(passenger);
|
v.setPassenger(passenger);
|
||||||
mc.setVelocity(newVelocity);
|
v.setVelocity(newVelocity);
|
||||||
}
|
}
|
||||||
}, 1);
|
}, 1);
|
||||||
} else {
|
} else {
|
||||||
vehicle.teleport(exit);
|
Vehicle mc = exit.getWorld().spawn(exit, vehicle.getClass());
|
||||||
vehicle.setVelocity(newVelocity);
|
if (mc instanceof StorageMinecart) {
|
||||||
|
StorageMinecart smc = (StorageMinecart)mc;
|
||||||
|
smc.getInventory().setContents(((StorageMinecart)vehicle).getInventory().getContents());
|
||||||
|
}
|
||||||
|
vehicle.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,6 +338,15 @@ public class Stargate extends JavaPlugin {
|
|||||||
Portal dest = portal.getDestination();
|
Portal dest = portal.getDestination();
|
||||||
if (dest == null) return;
|
if (dest == null) return;
|
||||||
|
|
||||||
|
if ((networkFilter && !hasPerm(player, "stargate.network." + portal.getNetwork(), player.isOp())) ||
|
||||||
|
(worldFilter && !hasPerm(player, "stargate.world." + portal.getDestination().getWorld().getName(), player.isOp()))) {
|
||||||
|
if (!denyMsg.isEmpty()) {
|
||||||
|
player.sendMessage(ChatColor.RED + denyMsg);
|
||||||
|
}
|
||||||
|
portal.close(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
boolean iConCharge = (iConomyHandler.useiConomy() && !portal.isFree() && !hasPerm(player, "stargate.free.use", player.isOp()));
|
boolean iConCharge = (iConomyHandler.useiConomy() && !portal.isFree() && !hasPerm(player, "stargate.free.use", player.isOp()));
|
||||||
if (!iConomyHandler.chargeFreeDestination)
|
if (!iConomyHandler.chargeFreeDestination)
|
||||||
iConCharge = iConCharge && !dest.isFree();
|
iConCharge = iConCharge && !dest.isFree();
|
||||||
@ -385,7 +394,6 @@ public class Stargate extends JavaPlugin {
|
|||||||
for (int j = 0; j < 3; j++) {
|
for (int j = 0; j < 3; j++) {
|
||||||
for (int k = 0; k < 3; k++) {
|
for (int k = 0; k < 3; k++) {
|
||||||
Block b = world.getBlockAt(cX + i, cY + j, cZ + k);
|
Block b = world.getBlockAt(cX + i, cY + j, cZ + k);
|
||||||
if (b.getType() != Material.PORTAL) continue;
|
|
||||||
Portal portal = Portal.getByEntrance(b);
|
Portal portal = Portal.getByEntrance(b);
|
||||||
if (portal != null) {
|
if (portal != null) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: Stargate
|
name: Stargate
|
||||||
main: net.TheDgtl.Stargate.Stargate
|
main: net.TheDgtl.Stargate.Stargate
|
||||||
version: 0.5.0
|
version: 0.5.1
|
||||||
description: Stargate mod for Bukkit
|
description: Stargate mod for Bukkit
|
||||||
author: Drakia
|
author: Drakia
|
||||||
website: http://www.thedgtl.net
|
website: http://www.thedgtl.net
|
||||||
|
Loading…
Reference in New Issue
Block a user