Reduces the outwards offset of teleported entities
This commit is contained in:
parent
1e06e0e01d
commit
f95ee0b85d
@ -13,7 +13,6 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.block.data.Bisected;
|
import org.bukkit.block.data.Bisected;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
import org.bukkit.block.data.type.Slab;
|
import org.bukkit.block.data.type.Slab;
|
||||||
import org.bukkit.entity.AbstractHorse;
|
|
||||||
import org.bukkit.entity.Creature;
|
import org.bukkit.entity.Creature;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -59,7 +58,7 @@ public abstract class Teleporter {
|
|||||||
}
|
}
|
||||||
float newYaw = (portal.getYaw() + adjust) % 360;
|
float newYaw = (portal.getYaw() + adjust) % 360;
|
||||||
Stargate.debug("Portal::adjustRotation", "Setting exit yaw to " + newYaw);
|
Stargate.debug("Portal::adjustRotation", "Setting exit yaw to " + newYaw);
|
||||||
exit.setYaw(newYaw);
|
exit.setDirection(DirectionHelper.getDirectionVectorFromYaw(newYaw));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -141,14 +140,9 @@ public abstract class Teleporter {
|
|||||||
if (entitySize > 1) {
|
if (entitySize > 1) {
|
||||||
double entityOffset;
|
double entityOffset;
|
||||||
if (portal.getOptions().isAlwaysOn()) {
|
if (portal.getOptions().isAlwaysOn()) {
|
||||||
entityOffset = entityBoxSize / 2D;
|
entityOffset = (entityBoxSize / 2D) - 1;
|
||||||
} else {
|
} else {
|
||||||
entityOffset = (entitySize / 2D) - 1;
|
entityOffset = (entitySize / 2D) - 2;
|
||||||
}
|
|
||||||
//If a horse has a player riding it, the player will spawn inside the roof of a standard portal unless it's
|
|
||||||
// moved one block out.
|
|
||||||
if (entity instanceof AbstractHorse) {
|
|
||||||
entityOffset += 1;
|
|
||||||
}
|
}
|
||||||
exitLocation = DirectionHelper.moveLocation(exitLocation, 0, 0, entityOffset, portal.getYaw());
|
exitLocation = DirectionHelper.moveLocation(exitLocation, 0, 0, entityOffset, portal.getYaw());
|
||||||
}
|
}
|
||||||
@ -217,8 +211,8 @@ public abstract class Teleporter {
|
|||||||
protected void loadChunks() {
|
protected void loadChunks() {
|
||||||
for (Chunk chunk : getChunksToLoad()) {
|
for (Chunk chunk : getChunksToLoad()) {
|
||||||
chunk.addPluginChunkTicket(Stargate.getInstance());
|
chunk.addPluginChunkTicket(Stargate.getInstance());
|
||||||
//Allow the chunk to unload after 3 seconds
|
//Allow the chunk to unload after 10 seconds
|
||||||
Stargate.addChunkUnloadRequest(new ChunkUnloadRequest(chunk, 3000L));
|
Stargate.addChunkUnloadRequest(new ChunkUnloadRequest(chunk, 10000L));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user