Makes boats keep their boat type when teleported using the CraftBook fix
Some checks failed
EpicKnarvik97/Stargate/pipeline/head There was a failure building this commit
Some checks failed
EpicKnarvik97/Stargate/pipeline/head There was a failure building this commit
This commit is contained in:
parent
99bceb9165
commit
28d84450fb
@ -407,6 +407,7 @@ portalInfoServer=Server: %server%
|
||||
- Teleports boats/minecarts like other vehicles unless *enableCraftBookRemoveOnEjectFix* is enabled
|
||||
- Adds the *waitForPlayerAfterTeleportDelay* config option which allows changing the delay between vehicle teleportation
|
||||
and the player being teleported to the vehicle
|
||||
- Makes boats keep their wood type even when re-created
|
||||
|
||||
#### \[Version 0.9.3.3] EpicKnarvik97 fork
|
||||
|
||||
|
@ -8,6 +8,7 @@ import net.knarcraft.stargate.utility.DirectionHelper;
|
||||
import net.knarcraft.stargate.utility.TeleportHelper;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Boat;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
@ -156,6 +157,9 @@ public class VehicleTeleporter extends EntityTeleporter {
|
||||
}
|
||||
//Spawn a new vehicle
|
||||
Vehicle newVehicle = vehicleWorld.spawn(exit, teleportingVehicle.getClass());
|
||||
if (teleportingVehicle instanceof Boat boat) {
|
||||
((Boat) newVehicle).setWoodType(boat.getWoodType());
|
||||
}
|
||||
//Remove the old vehicle
|
||||
if (teleportingVehicle.eject()) {
|
||||
TeleportHelper.handleEntityPassengers(passengers, newVehicle, origin, portal, exit.getDirection());
|
||||
|
Loading…
Reference in New Issue
Block a user