Skip to content

Commit

Permalink
Update to teleport method
Browse files Browse the repository at this point in the history
Update spawn minecart method
  • Loading branch information
DrakiaXYZ committed Jun 23, 2011
1 parent 85a98d8 commit 3d898ba
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
2 changes: 2 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ maxgates - If non-zero, will define the maximum amount of gates allowed on a net
=============
Changes
=============
[Version 0.5.0b]
- Updated the teleport method
[Version 0.4.9]
- Left-click to scroll signs up
- Show "(Not Connected)" on fixed-gates with a non-existant destination
Expand Down
8 changes: 3 additions & 5 deletions src/net/TheDgtl/Stargate/Portal.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,8 @@ public void teleport(Player player, Portal origin, PlayerMoveEvent event) {

exit.setYaw(origin.getRotation() - traveller.getYaw() + this.getRotation() + 180);

// Change "from" so we don't get hack warnings. Cancel player move event.
event.setFrom(exit);
player.teleport(exit);
event.setCancelled(true);
// The new method to teleport in a move event is set the "to" field.
event.setTo(exit);
}

public void teleport(final Vehicle vehicle) {
Expand Down Expand Up @@ -254,7 +252,7 @@ public void teleport(final Vehicle vehicle) {
if (passenger != null) {
vehicle.eject();
vehicle.remove();
final Minecart mc = exit.getWorld().spawnMinecart(exit);
final Minecart mc = exit.getWorld().spawn(exit, Minecart.class);
passenger.teleport(exit);
Stargate.server.getScheduler().scheduleSyncDelayedTask(Stargate.stargate, new Runnable() {
public void run() {
Expand Down
5 changes: 0 additions & 5 deletions src/net/TheDgtl/Stargate/Stargate.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
import org.bukkit.event.block.BlockListener;
import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.block.SignChangeEvent;
import org.bukkit.event.entity.EntityCombustEvent;
import org.bukkit.event.entity.EntityDamageByBlockEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityListener;
import org.bukkit.event.player.PlayerInteractEvent;
Expand Down Expand Up @@ -382,7 +379,6 @@ public void onPlayerMove(PlayerMoveEvent event) {
player.sendMessage(ChatColor.RED + denyMsg);
}
portal.teleport(player, portal, event);
event.setCancelled(true);
return;
}

Expand All @@ -395,7 +391,6 @@ public void onPlayerMove(PlayerMoveEvent event) {
player.sendMessage(ChatColor.RED + denyMsg);
}
portal.teleport(player, portal, event);
event.setCancelled(true);
portal.close(false);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Stargate
main: net.TheDgtl.Stargate.Stargate
version: 0.4.9
version: 0.5.0b
description: Stargate mod for Bukkit
author: Drakia
website: http://www.thedgtl.net
Expand Down

0 comments on commit 3d898ba

Please sign in to comment.